* sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
[glibc.git] / nptl / ChangeLog
blobf79a43e4366ff0077249fba78fbd2f4fc02f824a
1 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
4         unnecessary addr32 prefix.
6 2008-01-29  Roland McGrath  <roland@redhat.com>
8         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
10 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
12         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
14 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
16         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
17         a scratch register.
18         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
19         (__lll_lock_wait_private): Fix typo.
20         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
21         (pthread_barrier_wait): Likewise.  Adjust XADD use.
22         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
23         Adjust XADD use.
24         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
25         (pthread_rwlock_timedrdlock): Return correct return value.
26         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
27         (pthread_rwlock_timedwrlock): Likewise.
29 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
31         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
32         thread returns the program exits with an error code.
34 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
36         * pthread-errnos.sym: Add EOVERFLOW.
37         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
38         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
39         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
40         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
42 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
44         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
45         parameter.  Passed it as permission to mmap.
46         * allocatestack.c (allocate_stack): Pass prot as second parameter
47         to ARCH_RETRY_MMAP.
49 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
51         * tst-basic7.c: Allocate memory for the stack.
53         [BZ #5465]
54         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
55         (__pthread_cond_timedwait): Don't use VDSO.
56         Patch by Michal Januszewski.
58 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
60         [BZ #5455]
61         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
62         Allow label before pthread_cleanup_pop.
63         (pthread_cleanup_pop_restore_np): Likewise.
65 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
67         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
68         Store 2 before returning ETIMEDOUT.
70 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
72         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
73         Store 2 before returning ETIMEDOUT.
74         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
75         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
76         (__lll_lock_wait_private): Optimize.
77         (__lll_lock_wait): Likewise.
79 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
81         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
82         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
83         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
85 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
87         [BZ #5240]
88         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
89         If we time out, try one last time to lock the futex to avoid
90         losing a wakeup signal.
91         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
92         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
94         [BZ #5245]
95         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
96         if necessary.
98 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
100         [BZ #5245]
101         * allocatestack.c (allocate_stack): Change ENOMEM error in case
102         mmap failed to EAGAIN.
103         * Makefile (tests): Add tst-basic7.
104         * tst-basic7.c: New file.
106 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
108         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
109         Use __linkin_atfork.
111 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
113         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
114         missing line continuations.
115         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
116         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
118 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
120         [BZ #5220]
121         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
122         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
123         (struct timer): Add next element.
124         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
125         enqueue timer structure into __active_timer_sigev_thread list.
126         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
127         remove timer struct from __active_timer_sigev_thread.
128         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
129         Before using timer structure make sure it is still on the
130         __active_timer_sigev_thread list.  Keep lock until done.
131         Define __active_timer_sigev_thread and
132         __active_timer_sigev_thread_lock.
134 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
136         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
137         Redefine thread_atfork for use of ATFORK_MEM.
138         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
139         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
140         function.
141         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
142         Use atomic operation when removing first element of list.
144 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
146         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
147         routine instead of an alias to __new_sem_post.
149 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
151         * init.c (__pthread_initialize_minimal): Initialize word to appease
152         valgrind.
154 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
156         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
157         libc.so just clear NAME.
158         (__libc_rwlock_fini): Nop inside of libc.so.
159         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
160         all zeros.
162 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
164         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
165         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
166         unlocking failed.
167         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
169 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
171         [BZ #4938]
172         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
173         reclaimed stack if necessary.
174         * Makefile (tests): Add tst-tsd6.
175         * tst-tsd6.c: New file.
177 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
179         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
180         Add private argument.
182 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
184         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
185         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
187 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
189         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
190         (__lll_robust_timedlock): Pass private as last argument to
191         __lll_robust_timedlock_wait.
192         (__lll_unlock): Fix a pasto.
194 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
196         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
197         sparc_old_sem): New structs.
198         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
199         (__sem_wait_cleanup): New function.
200         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
201         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
202         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
203         lll_futex_wait.
204         (__old_sem_wait): New function.
205         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
206         nptl/sysdeps/unix/sysv/linux/sparc version.
207         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
208         Likewise.
209         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
210         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
211         (__new_sem_trywait): Use sparc_old_sem structure.
212         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
213         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
214         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
215         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
216         lll_futex_timed_wait.
217         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
218         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
219         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
220         lll_futex_wake.
221         (__old_sem_post): New function.
222         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
223         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
224         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
225         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
226         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
227         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
229 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
231         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
232         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
233         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
234         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
235         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
236         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
237         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
238         Use FUTEX_WAKE_OP.
239         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
240         kernel-features.h and tcb-offsets.h.
241         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
242         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
243         process private.
244         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
245         tcb-offsets.h.
246         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
247         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
248         process private.
249         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
250         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
251         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
252         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
253         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
254         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
257 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
259         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
260         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
261         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
262         lll_futex_timed_wait.
264         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
265         __lll_robust_unlock): Rewrite as macros instead of inline functions.
266         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
267         __lll_robust_unlock, __lll_wait_tid): Likewise.
269 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
271         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
272         Fix a pasto.
273         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
274         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
275         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
276         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
278         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
279         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
280         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
281         kernel-features.h.
282         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
283         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
284         process private.  Switch DW_CFA_advance_loc1 and some
285         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
286         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
287         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
288         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
289         process private.  Switch DW_CFA_advance_loc{1,2} and some
290         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
291         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
292         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
293         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
294         Likewise.
295         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
296         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
297         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
298         Likewise.
299         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
300         (__pthread_cond_broadcast): Compare %r8 instead of
301         dep_mutex-cond_*(%rdi) with $-1.
302         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
303         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
304         of oring.
306 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
308         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
310 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
312         * allocatestack.c: Include kernel-features.h.
313         * pthread_create.c: Likewise.
314         * pthread_mutex_init.c: Likewise.
315         * init.c: Likewise.
316         * pthread_cond_timedwait.c: Likewise.
317         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
318         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
319         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
320         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
321         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
322         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
323         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
324         Likewise.
325         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
326         Likewise.
327         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
328         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
329         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
330         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
332 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
334         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
335         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
336         byte elements.  One of them is the new __shared element.
337         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
338         adjust names of other padding elements.
339         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
340         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
341         byte elements.  One of them is the new __shared element.
342         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
343         adjust names of other padding elements.
344         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
345         Renamed __pad1 element to __shared, adjust names of other padding
346         elements.
347         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
348         (pthread_rwlock_t): Likewise.
349         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
350         typo.
352 2007-08-09  Anton Blanchard  <anton@samba.org>
354         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
356 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
358         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
359         <kernel-features.h>.
360         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
362 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
364         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
365         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
366         dealing with robust mutexes.
367         * pthread_mutex_timedlock.c: Likewise.
368         * pthread_mutex_trylock.c: Likewise.
369         * pthread_mutex_unlock.c: Likewise.
370         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
372 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
374         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
375         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
376         (PTHREAD_MUTEX_PSHARED): Define.
377         * pthread_mutex_init.c (__pthread_mutex_init): Set
378         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
379         mutexes.
380         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
381         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
382         as second argument to lll_lock.
383         (LLL_MUTEX_TRYLOCK): Take mutex as argument
384         instead of its __data.__lock field.
385         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
386         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
387         to lll_robust_lock.
388         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
389         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
390         instead of mutex->__data.__kind directly, pass
391         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
392         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
393         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
394         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
395         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
396         to lll_timedlock, lll_robust_timedlock, lll_unlock and
397         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
398         of mutex->__data.__kind directly.
399         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
400         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
401         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
402         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
403         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
404         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
405         and lll_futex_wake.
406         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
407         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
408         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
409         directly.
410         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
411         Take mutex as argument instead of its __data.__lock field, pass
412         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
413         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
414         __data.__lock field.
415         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
416         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
417         to lll_robust_cond_lock.
418         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
419         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
420         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
421         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
422         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
423         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
424         lll_futex_wait.
425         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
426         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
427         lll_futex_wake.
428         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
429         pshared variable, pass it to lll_lock, lll_unlock,
430         lll_futex_timedwait and lll_futex_wake.
431         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
432         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
433         and lll_futex_wake.
434         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
435         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
436         macro.
437         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
438         lll_futex_wake_unlock): Likewise.
439         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
440         Likewise.
441         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
442         lll_futex_wake_unlock): Likewise.
443         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
444         Likewise.
445         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
446         lll_futex_wake_unlock): Likewise.
447         (lll_futex_wake): Fix a typo.
448         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
449         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
450         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
451         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
452         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
453         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
454         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
455         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
456         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
457         (__pthread_cond_timedwait): Likewise.
458         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
459         (__condvar_cleanup, __pthread_cond_wait): Likewise.
461 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
463         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
464         Don't use CGOTSETUP and CGOTRESTORE macros.
465         (CGOTSETUP, CGOTRESTORE): Remove.
466         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
467         @local symbol.
469 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
471         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
472         definitions for private futexes.
473         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
474         kernel-features.h and lowlevellock.h.  Use private futexes if
475         they are available.
476         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
477         (__lll_mutex_lock_wait): Rename to
478         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
479         (__lll_mutex_timedlock_wait): Rename to ...
480         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
481         Don't compile in for libc.so.
482         (__lll_mutex_unlock_wake): Rename to ...
483         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
484         (__lll_timedwait_tid): Use __NR_gettimeofday.
485         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
486         the header from assembler.  Renamed all lll_mutex_* resp.
487         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
488         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
489         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
490         Define.
491         (__lll_lock_wait_private): Add prototype.
492         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
493         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
494         __lll_unlock_wake): Likewise.
495         (lll_lock): Add private argument.  Call __lll_lock_wait_private
496         if private is constant LLL_PRIVATE.
497         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
498         lll_timedlock, lll_robust_timedlock): Add private argument.
499         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
500         if private is constant LLL_PRIVATE.
501         (lll_robust_unlock, lll_robust_dead): Add private argument.
502         (lll_lock_t): Remove.
503         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
504         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
505         lll_cond_wake, lll_cond_broadcast): Remove.
506         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
507         kernel-features.h and lowlevellock.h.
508         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
509         (LOAD_FUTEX_WAIT): Define.
510         (__lll_robust_mutex_lock_wait): Rename to ...
511         (__lll_robust_lock_wait): ... this.  Add private argument.
512         Use LOAD_FUTEX_WAIT macro.
513         (__lll_robust_mutex_timedlock_wait): Rename to ...
514         (__lll_robust_timedlock_wait): ... this.    Add private argument.
515         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
516         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
517         lowlevellock.h.
518         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
519         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
520         __lll_mutex_{lock,unlock}_*.
521         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
522         lowlevellock.h and pthread-errnos.h.
523         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
524         FUTEX_CMP_REQUEUE, EINVAL): Remove.
525         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
526         __lll_mutex_{lock,unlock}_*.
527         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
528         lowlevellock.h and pthread-errnos.h.
529         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
530         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
531         __lll_mutex_{lock,unlock}_*.
532         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
533         lowlevellock.h.
534         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
535         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
536         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
537         (__condvar_tw_cleanup): Likewise.
538         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
539         lowlevellock.h.
540         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
541         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
542         __lll_mutex_{lock,unlock}_*.
543         ( __condvar_w_cleanup): Likewise.
544         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
545         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
546         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
547         lowlevellock.h.
548         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
549         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
550         __lll_mutex_{lock,unlock}_*.
551         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
552         lowlevellock.h.
553         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
554         FUTEX_PRIVATE_FLAG): Remove.
555         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
556         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
557         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
558         lowlevellock.h.
559         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
560         FUTEX_PRIVATE_FLAG): Remove.
561         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
562         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
563         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
564         lowlevellock.h.
565         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
566         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
567         __lll_mutex_{lock,unlock}_*.
568         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
569         lowlevellock.h.
570         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
571         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
572         __lll_mutex_{lock,unlock}_*.
573         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
574         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
575         (__new_sem_post): Use standard initial exec code sequences.
576         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
577         lowlevellock.h.
578         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
579         FUTEX_PRIVATE_FLAG): Remove.
580         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
581         exec code sequences.
582         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
583         (__new_sem_trywait): Use standard initial exec code sequences.
584         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
585         (__new_sem_wait): Use standard initial exec code sequences.
587 2007-07-31  Anton Blanchard  <anton@samba.org>
589         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
590         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
591         atomic_full_barrier.
593 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
595         * allocatestack.c (stack_cache_lock): Change type to int.
596         (get_cached_stack, allocate_stack, __deallocate_stack,
597         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
598         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
599         as second argument to lll_lock and lll_unlock macros on
600         stack_cache_lock.
601         * pthread_create.c (__find_in_stack_list): Likewise.
602         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
603         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
604         as second argument.
605         * descr.h (struct pthread): Change lock and setxid_futex field
606         type to int.
607         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
608         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
609         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
610         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
611         Likewise.
612         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
613         * pthread_cond_init.c (__pthread_cond_init): Likewise.
614         * pthreadP.h (__attr_list_lock): Change type to int.
615         * pthread_attr_init.c (__attr_list_lock): Likewise.
616         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
617         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
618         lll_{,un}lock.
619         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
620         also for lll_futex_{wake,wait}.
621         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
622         a pointer to const.
623         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
624         LLL_SHARED as second argument to lll_{,un}lock.
625         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
626         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
627         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
628         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
629         Likewise.
630         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
631         as second argument to lll_{,un}lock macros on pd->lock.
632         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
633         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
634         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
635         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
636         Likewise.
637         * sysdeps/pthread/createthread.c (do_clone, create_thread):
638         Likewise.
639         * pthread_once.c (once_lock): Change type to int.
640         (__pthread_once): Pass LLL_PRIVATE as second argument to
641         lll_{,un}lock macros on once_lock.
642         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
643         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
644         rwlock->__data.__shared as second argument to them and similarly
645         for lll_futex_w*.
646         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
647         Likewise.
648         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
649         Likewise.
650         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
651         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
652         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
653         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
654         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
655         to lll_{,un}lock macros on __sem_mappings_lock.
656         * sem_open.c (check_add_mapping): Likewise.
657         (__sem_mappings_lock): Change type to int.
658         * semaphoreP.h (__sem_mappings_lock): Likewise.
659         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
660         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
661         instead of lll_*mutex_*, pass LLL_SHARED as last
662         argument.
663         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
664         pass LLL_SHARED as last argument.
665         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
666         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
667         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
668         pass LLL_SHARED as last argument.
669         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
670         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
671         LLL_SHARED as last argument.
672         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
673         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
674         Similarly.
675         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
676         __libc_lock_lock_recursive, __libc_lock_unlock,
677         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
678         argument to lll_{,un}lock.
679         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
680         _IO_lock_unlock): Likewise.
681         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
682         compound literal.
683         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
684         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
685         __fork_lock.
686         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
687         free_mem): Likewise.
688         (__fork_lock): Change type to int.
689         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
690         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
691         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
692         lll_futex_wake.
693         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
694         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
695         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
696         New function.
697         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
698         pass it through to lll_futex_*wait, only compile in when
699         IS_IN_libpthread.
700         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
701         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
702         argument and pass it through to lll_futex_*wait.
703         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
704         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
705         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
706         inline functions to __lll_* resp. __lll_robust_*.
707         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
708         (lll_mutex_dead): Add private argument.
709         (__lll_lock_wait_private): New prototype.
710         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
711         __lll_robust_lock_timedwait): Add private argument to prototypes.
712         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
713         call __lll_lock_wait_private, otherwise pass private to
714         __lll_lock_wait.
715         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
716         __lll_robust_timedlock): Add private argument, pass it to
717         __lll_*wait functions.
718         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
719         call __lll_unlock_wake_private, otherwise pass private to
720         __lll_unlock_wake.
721         (__lll_robust_unlock): Add private argument, pass it to
722         __lll_robust_unlock_wake.
723         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
724         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
725         argument, pass it through to __lll_* inline function.
726         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
727         (lll_lock_t): Remove.
728         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
729         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
730         lll_cond_wake, lll_cond_broadcast): Remove.
731         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
732         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
733         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
734         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
735         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
736         the header from assembler.  Renamed all lll_mutex_* resp.
737         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
738         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
739         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
740         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
741         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
742         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
743         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
744         Remove prototype.
745         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
746         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
747         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
748         (lll_trylock): Likewise, use __lll_trylock_asm, pass
749         MULTIPLE_THREADS_OFFSET as another asm operand.
750         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
751         MULTIPLE_THREADS_OFFSET as last asm operand, call
752         __lll_lock_wait_private if private is constant LLL_PRIVATE,
753         otherwise pass private as another argument to __lll_lock_wait.
754         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
755         lll_timedlock, lll_robust_timedlock): Add private argument, pass
756         private as another argument to __lll_*lock_wait call.
757         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
758         MULTIPLE_THREADS_OFFSET as another asm operand, call
759         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
760         otherwise pass private as another argument to __lll_unlock_wake.
761         (lll_robust_unlock): Add private argument, pass private as another
762         argument to __lll_unlock_wake.
763         (lll_robust_dead): Add private argument, use __lll_private_flag
764         macro.
765         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
766         LLL_MUTEX_LOCK_INITIALIZER.
767         (lll_lock_t): Remove.
768         (LLL_LOCK_INITIALIZER_WAITERS): Define.
769         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
770         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
771         lll_cond_wake, lll_cond_broadcast): Remove.
772         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
773         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
774         2007-05-2{3,9} changes.
775         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
776         kernel-features.h and lowlevellock.h.
777         (LOAD_PRIVATE_FUTEX_WAIT): Define.
778         (LOAD_FUTEX_WAIT): Rewritten.
779         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
780         define.
781         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
782         (__lll_mutex_lock_wait): Rename to ...
783         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
784         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
785         (__lll_mutex_timedlock_wait): Rename to ...
786         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
787         contains private argument.  Don't compile in for libc.so.
788         (__lll_mutex_unlock_wake): Rename to ...
789         (__lll_unlock_wake): ... this.  %ecx contains private argument.
790         Don't compile in for libc.so.
791         (__lll_timedwait_tid): Use __NR_gettimeofday.
792         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
793         kernel-features.h and lowlevellock.h.
794         (LOAD_FUTEX_WAIT): Define.
795         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
796         define.
797         (__lll_robust_mutex_lock_wait): Rename to ...
798         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
799         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
800         macro.
801         (__lll_robust_mutex_timedlock_wait): Rename to ...
802         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
803         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
804         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
805         lowlevellock.h.
806         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
807         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
808         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
809         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
810         to __lll_lock_wait in %edx.
811         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
812         Include lowlevellock.h and pthread-errnos.h.
813         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
814         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
815         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
816         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
817         pass LLL_SHARED in %ecx to both __lll_lock_wait and
818         __lll_unlock_wake.
819         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
820         Include lowlevellock.h and pthread-errnos.h.
821         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
822         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
823         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
824         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
825         pass LLL_SHARED in %ecx to both __lll_lock_wait and
826         __lll_unlock_wake.
827         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
828         Include lowlevellock.h.
829         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
830         Don't define.
831         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
832         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
833         pass LLL_SHARED in %ecx to both __lll_lock_wait and
834         __lll_unlock_wake.  Use __NR_gettimeofday.
835         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
836         Include lowlevellock.h.
837         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
838         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
839         to __lll_*, pass cond_lock address in %edx rather than %ecx to
840         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
841         and __lll_unlock_wake.
842         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
843         Include lowlevellock.h.
844         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
845         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
846         MUTEX(%ebx) address in %edx rather than %ecx to
847         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
848         and __lll_unlock_wake.  Move return value from %ecx to %edx
849         register.
850         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
851         Include lowlevellock.h.
852         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
853         Don't define.
854         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
855         MUTEX(%ebp) address in %edx rather than %ecx to
856         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
857         and __lll_unlock_wake.  Move return value from %ecx to %edx
858         register.  Use __NR_gettimeofday.
859         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
860         Include lowlevellock.h.
861         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
862         Don't define.
863         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
864         MUTEX(%ebp) address in %edx rather than %ecx to
865         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
866         and __lll_unlock_wake.  Move return value from %ecx to %edx
867         register.  Use __NR_gettimeofday.
868         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
869         Include lowlevellock.h.
870         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
871         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
872         MUTEX(%edi) address in %edx rather than %ecx to
873         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
874         and __lll_unlock_wake.
875         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
876         Include lowlevellock.h.
877         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
878         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
879         MUTEX(%ebx) address in %edx rather than %ecx to
880         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
881         and __lll_unlock_wake.  Move return value from %ecx to %edx
882         register.
883         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
884         lowlevellock.h.
885         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
886         define.
887         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
888         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
889         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
890         lowlevellock.h.
891         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
892         (sem_timedwait): Use __NR_gettimeofday.
893         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
894         lowlevellock.h.
895         (LOCK): Don't define.
896         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
897         lowlevellock.h.
898         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
899         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
900         are waiters.
901         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
902         2007-05-2{3,9} changes.
903         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
904         kernel-features.h and lowlevellock.h.
905         (LOAD_PRIVATE_FUTEX_WAIT): Define.
906         (LOAD_FUTEX_WAIT): Rewritten.
907         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
908         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
909         (__lll_mutex_lock_wait): Rename to ...
910         (__lll_lock_wait): ... this.  %esi is now private argument.
911         Don't compile in for libc.so.
912         (__lll_mutex_timedlock_wait): Rename to ...
913         (__lll_timedlock_wait): ... this.  %esi contains private argument.
914         Don't compile in for libc.so.
915         (__lll_mutex_unlock_wake): Rename to ...
916         (__lll_unlock_wake): ... this.  %esi contains private argument.
917         Don't compile in for libc.so.
918         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
919         kernel-features.h and lowlevellock.h.
920         (LOAD_FUTEX_WAIT): Define.
921         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
922         (__lll_robust_mutex_lock_wait): Rename to ...
923         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
924         Use LOAD_FUTEX_WAIT macro.
925         (__lll_robust_mutex_timedlock_wait): Rename to ...
926         (__lll_robust_timedlock_wait): ... this. %esi argument contains
927         private, use LOAD_FUTEX_WAIT macro.
928         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
929         lowlevellock.h.
930         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
931         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
932         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
933         __lll_lock_wait and __lll_unlock_wake.
934         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
935         Include lowlevellock.h and pthread-errnos.h.
936         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
937         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
938         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
939         pass LLL_SHARED in %esi to both __lll_lock_wait and
940         __lll_unlock_wake.
941         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
942         Include lowlevellock.h and pthread-errnos.h.
943         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
944         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
945         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
946         pass LLL_SHARED in %esi to both __lll_lock_wait and
947         __lll_unlock_wake.
948         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
949         Include lowlevellock.h.
950         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
951         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
952         pass LLL_SHARED in %esi to both __lll_lock_wait and
953         __lll_unlock_wake.
954         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
955         Include lowlevellock.h.
956         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
957         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
958         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
959         and __lll_unlock_wake.
960         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
961         Include lowlevellock.h.
962         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
963         Don't define.
964         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
965         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
966         and __lll_unlock_wake.
967         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
968         Include lowlevellock.h.
969         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
970         Don't define.
971         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
972         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
973         and __lll_unlock_wake.
974         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
975         Include lowlevellock.h.
976         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
977         Don't define.
978         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
979         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
980         and __lll_unlock_wake.
981         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
982         Include lowlevellock.h.
983         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
984         Don't define.
985         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
986         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
987         and __lll_unlock_wake.
988         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
989         Include lowlevellock.h.
990         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
991         Don't define.
992         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
993         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
994         and __lll_unlock_wake.
995         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
996         lowlevellock.h.
997         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
998         define.
999         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1000         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1001         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1002         lowlevellock.h.
1003         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1004         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1005         lowlevellock.h.
1006         (LOCK): Don't define.
1007         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1008         lowlevellock.h.
1009         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1010         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1011         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1012         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1013         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1014         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1015         (__lll_lock_wait_private): New function.
1016         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1017         it to lll_futex_*wait.  Don't compile in for libc.so.
1018         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1019         Remove.
1020         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1021         (struct sparc_pthread_barrier): Remove.
1022         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1023         struct sparc_pthread_barrier.  Pass
1024         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1025         and lll_futex_wait macros.
1026         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1027         Remove.
1028         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1029         Include sparc pthread_barrier_wait.c instead of generic one.
1031 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1033         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1035         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1036         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1037         %ecx.
1038         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1039         (pthread_rwlock_timedwrlock): Likewise.
1040         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1041         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1043 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1045         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1047 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1049         * tst-locale2.c (useless): Add return statement.
1051 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1053         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1054         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1055         * pthread_create.c (start_thread): Likewise.
1056         * init.c (sighandler_setxid): Likewise.
1057         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1058         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1059         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1060         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1061         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1062         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1063         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1064         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1065         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1066         Likewise.
1067         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1068         Likewise.
1069         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1070         Likewise.
1071         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1072         __rtld_notify): Likewise.
1073         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1074         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1075         __pthread_once): Likewise.
1076         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1077         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1078         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1079         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1080         (lll_futex_wait): Add private argument, define as wrapper around
1081         lll_futex_timed_wait.
1082         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1083         use __lll_private_flag macro.
1084         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1085         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1086         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1087         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1088         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1089         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1090         (lll_futex_wait): Add private argument, define as wrapper around
1091         lll_futex_timed_wait.
1092         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1093         use __lll_private_flag macro.
1094         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1095         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1096         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1097         Define.
1098         (lll_futex_timed_wait, lll_futex_wake): Use it.
1099         (lll_private_futex_wait, lll_private_futex_timed_wait,
1100         lll_private_futex_wake): Removed.
1101         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1102         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1103         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1104         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1105         (lll_futex_wait): Add private argument, define as wrapper around
1106         lll_futex_timed_wait.
1107         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1108         use __lll_private_flag macro.
1109         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1110         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1111         to lll_futex_*.
1112         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1113         (lll_private_futex_wait, lll_private_futex_timed_wait,
1114         lll_private_futex_wake): Removed.
1115         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1116         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1117         (lll_private_futex_wait, lll_private_futex_timed_wait,
1118         lll_private_futex_wake): Removed.
1119         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1120         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1121         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1122         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1123         (lll_futex_wait): Add private argument, define as wrapper around
1124         lll_futex_timed_wait.
1125         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1126         use __lll_private_flag macro.
1127         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1128         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1129         to lll_futex_*.
1130         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1131         Define.
1132         (lll_futex_timed_wait, lll_futex_wake): Use it.
1133         (lll_private_futex_wait, lll_private_futex_timed_wait,
1134         lll_private_futex_wake): Removed.
1136 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1138         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1139         of the structure for sparc32.
1141 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1143         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1145 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1147         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1148         code used when private futexes are assumed.
1149         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1150         Likewise.
1152 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1154         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1155         (__lll_private_flag): Define.
1156         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1157         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1158         __lll_private_flag.
1159         (lll_private_futex_wait, lll_private_futex_timedwait,
1160         lll_private_futex_wake): Define as wrapper around non-_private
1161         macros.
1162         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1163         (__lll_private_flag): Define.
1164         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1165         (lll_private_futex_wait, lll_private_futex_timedwait,
1166         lll_private_futex_wake): Define as wrapper around non-_private
1167         macros.
1169 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1171         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1172         parameter to lll_futex_wait call.
1173         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1175         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1176         Replace lll_futex_wait with lll_private_futex_wait.
1177         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1178         Add LLL_SHARED parameter to lll_futex_wake().
1180         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1181         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1182         lll_private_futex_wake.
1183         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1184         bit from private parm before syscall.
1185         (lll_futex_timed_wait): Likewise.
1186         (lll_futex_wake): Likewise.
1187         (lll_futex_wake_unlock): Likewise.
1188         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1189         (lll_robust_mutex_unlock): Likewise.
1190         (lll_mutex_unlock_force): Likewise.
1191         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1193 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1195         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1196         compilation when unconditionally using private futexes.
1197         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1198         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1199         Likewise.
1200         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1201         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1203 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1205         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1206         Define.
1208 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1210         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1211         kernel-features.h.
1213 2007-05-16  Roland McGrath  <roland@redhat.com>
1215         * init.c (__nptl_initial_report_events): New variable.
1216         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1217         to that.
1219 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1221         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1222         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1224 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1226         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1227         implementation.
1229 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1231         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1232         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1233         * pthread_mutex_timedlock.c: Likewise.
1234         * pthread_mutex_trylock.c: Likewise.
1235         * pthread_mutex_unlock.c: Likewise.
1237 2007-06-17  Andreas Schwab  <schwab@suse.de>
1239         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1240         sections.
1242 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1244         * allocatestack.c (allocate_stack): Make code compile if
1245         __ASSUME_PRIVATE_FUTEX is set.
1247 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1249         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1250         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1251         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1252         (__pthread_rwlock_wrlock): Likewise.
1253         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1254         (pthread_rwlock_timedrdlock): Likewise.
1255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1256         (pthread_rwlock_timedwrlock): Likewise.
1257         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1258         (__pthread_rwlock_unlock): Likewise.
1260 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1262         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1263         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1264         Split __flags into __flags, __shared, __pad1 and __pad2.
1265         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1266         futexes if they are available.
1267         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1268         in libc-lowlevellock.S allow using private futexes.
1269         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1270         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1271         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1272         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1273         lll_private_futex_timed_wait and lll_private_futex_wake.
1274         (lll_robust_mutex_unlock): Fix typo.
1275         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1276         field in futex command setup.
1277         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1278         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1279         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1280         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1281         if they are available.  Remove clear_once_control.
1282         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1283         futexes if they are available.
1284         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1285         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1286         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1287         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1288         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1289         Wake only when there are waiters.
1290         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1291         support.  Indicate that there are waiters.  Remove unnecessary
1292         extra cancellation test.
1293         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1294         left-over duplication of __sem_wait_cleanup.
1296 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1298         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1299         parameter to lll_futex_wait, lll_futex_timed_wait, and
1300         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1301         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1302         lll_private_futex_wake.
1303         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1304         * allocatestack.c: Adjust use of lll_futex_* macros.
1305         * init.c: Likewise.
1306         * lowlevellock.h: Likewise.
1307         * pthread_barrier_wait.c: Likewise.
1308         * pthread_cond_broadcast.c: Likewise.
1309         * pthread_cond_destroy.c: Likewise.
1310         * pthread_cond_signal.c: Likewise.
1311         * pthread_cond_timedwait.c: Likewise.
1312         * pthread_cond_wait.c: Likewise.
1313         * pthread_create.c: Likewise.
1314         * pthread_mutex_lock.c: Likewise.
1315         * pthread_mutex_setprioceiling.c: Likewise.
1316         * pthread_mutex_timedlock.c: Likewise.
1317         * pthread_mutex_unlock.c: Likewise.
1318         * pthread_rwlock_timedrdlock.c: Likewise.
1319         * pthread_rwlock_timedwrlock.c: Likewise.
1320         * pthread_rwlock_unlock.c: Likewise.
1321         * sysdeps/alpha/tls.h: Likewise.
1322         * sysdeps/i386/tls.h: Likewise.
1323         * sysdeps/ia64/tls.h: Likewise.
1324         * sysdeps/powerpc/tls.h: Likewise.
1325         * sysdeps/pthread/aio_misc.h: Likewise.
1326         * sysdeps/pthread/gai_misc.h: Likewise.
1327         * sysdeps/s390/tls.h: Likewise.
1328         * sysdeps/sh/tls.h: Likewise.
1329         * sysdeps/sparc/tls.h: Likewise.
1330         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1331         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1332         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1333         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1334         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1335         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1336         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1337         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1338         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1339         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1340         Likewise.
1341         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1342         * sysdeps/x86_64/tls.h: Likewise.
1344 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1346         * pthread_getattr_np.c: No need to install a cancellation handler,
1347         this is no cancellation point.
1348         * pthread_getschedparam.c: Likewise.
1349         * pthread_setschedparam.c: Likewise.
1350         * pthread_setschedprio.c: Likewise.
1351         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1352         lll_unlock_wake_cb.
1353         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1354         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1355         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1356         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1357         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1358         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1359         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1360         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1361         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1362         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1363         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1364         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1366         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1367         whether there are more than one thread makes no sense here since
1368         we only call the slow path if the locks are taken.
1369         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1371         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1372         COND_NWAITERS_SHIFT.
1373         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1374         COND_CLOCK_BITS.
1375         * pthread_cond_init.c: Likewise.
1376         * pthread_cond_timedwait.c: Likewise.
1377         * pthread_cond_wait.c: Likewise.
1378         * pthread_condattr_getclock.c: Likewise.
1379         * pthread_condattr_setclock.c: Likewise.
1380         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1381         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1382         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1383         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1384         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1386 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1388         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1389         unistd.h.
1391         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1392         insn suffix.
1393         (THREAD_GSCOPE_GET_FLAG): Remove.
1394         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1395         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1396         changes.
1397         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1398         (THREAD_GSCOPE_GET_FLAG): Remove.
1399         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1400         instead of THREAD_GSCOPE_GET_FLAG.
1401         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1402         it.
1403         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1404         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1405         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1406         THREAD_GSCOPE_WAIT): Define.
1407         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1408         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1409         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1410         THREAD_GSCOPE_WAIT): Define.
1411         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1412         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1413         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1414         THREAD_GSCOPE_WAIT): Define.
1415         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1416         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1417         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1418         THREAD_GSCOPE_WAIT): Define.
1420 2007-05-24  Richard Henderson  <rth@redhat.com>
1422         * descr.h (struct pthread): Add header.gscope_flag.
1423         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1424         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1425         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1426         THREAD_GSCOPE_WAIT): Define.
1428 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1430         * init.c: Make it compile with older kernel headers.
1432         * tst-initializers1.c: Show through exit code which test failed.
1434         * pthread_rwlock_init.c: Also initialize __shared field.
1435         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1436         element in rwlock structure into four byte elements.  One of them is
1437         the new __shared element.
1438         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1439         Likewise.
1440         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1441         __shared, adjust names of other padding elements.
1442         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1443         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1444         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1445         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1446         FUTEX_PRIVATE_FLAG.
1447         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1448         futex to use private operations if possible.
1449         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1450         Likewise.
1451         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1452         Likewise.
1453         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1454         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1455         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1456         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1457         Likewise.
1458         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1459         Likewise.
1460         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1461         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1463 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1465         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1466         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1467         * pthread_rwlock_timedrdlock.c: Likewise.
1468         * pthread_rwlock_tryrdlock.c: Likewise.
1470         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1471         optimization.
1473         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1474         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1475         duplication of __sem_wait_cleanup.
1477         * allocatestack.c: Revert last change.
1478         * init.c: Likewise.
1479         * sysdeps/i386/tls.h: Likewise.
1480         * sysdeps/x86_64/tls.h: Likewise.
1481         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1482         header structure.
1483         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1485         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1486         Add private field.
1487         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1488         * pthread_barrier_init.c: Set private flag if pshared and private
1489         futexes are supported.
1490         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1491         private field in futex command setup.
1492         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1494 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1496         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1497         support.
1498         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1499         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1500         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1501         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1502         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1504         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1505         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1506         fields in the structure.
1507         (__old_sem_init): New function.
1508         * sem_open.c: Initialize all fields of the structure.
1509         * sem_getvalue.c: Adjust for renamed element.
1510         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1511         (gen-as-const-headers): Add structsem.sym.
1512         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1513         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1514         struct new_sem.  Add struct old_sem.
1515         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1516         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1517         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1518         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1519         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1520         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1521         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1522         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1523         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1524         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1525         * tst-sem10.c: New file.
1526         * tst-sem11.c: New file.
1527         * tst-sem12.c: New file.
1528         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1529         of struct sem.
1531 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1532             Jakub Jelinek  <jakub@redhat.com>
1534         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1535         Move __pthread_enable_asynccancel right before futex syscall.
1536         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1537         Likewise.
1539 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1541         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1542         THREAD_COPY_PRIVATE_FUTEX): Define.
1543         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1544         THREAD_COPY_PRIVATE_FUTEX): Define.
1545         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1546         * init.c (__pthread_initialize_minimal_internal): Use
1547         THREAD_SET_PRIVATE_FUTEX.
1549         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1550         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1551         THREAD_GSCOPE_FLAG_WAIT): Define.
1552         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1553         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1554         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1555         PTR_DEMANGLE.
1556         (THREAD_GSCOPE_GET_FLAG): Define.
1557         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1558         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1559         instead of ->header.gscope_flag directly.
1561 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1563         * init.c (__pthread_initialize_minimal_internal): Check whether
1564         private futexes are available.
1565         * allocatestack.c (allocate_stack): Copy private_futex field from
1566         current thread into the new stack.
1567         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1568         futexes if they are available.
1569         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1570         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1571         in libc-lowlevellock.S allow using private futexes.
1572         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1573         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1574         FUTEX_PRIVATE_FLAG.
1575         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1576         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1577         if they are available.
1578         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1579         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1580         * sysdeps/i386/tcb-offsets.sym: Likewise.
1581         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1582         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1584 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1586         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1587         Remove ptr_wait_lookup_done again.
1588         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1589         (__pthread_initialize_minimal_internal): Initialize
1590         _dl_wait_lookup_done pointer in _rtld_global directly.
1591         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1592         Remove code to code _dl_wait_lookup_done.
1593         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1594         encrypted for now.
1596 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1598         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1599         pthread_mutex_init failed with ENOTSUP.
1601 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1603         * allocatestack.c (__wait_lookup_done): New function.
1604         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1605         Add ptr_wait_lookup_done.
1606         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1607         * pthreadP.h: Declare __wait_lookup_done.
1608         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1609         Define macros to implement reference handling of global scope.
1610         * sysdeps/x86_64/tls.h: Likewise.
1611         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1612         Initialize GL(dl_wait_lookup_done).
1614 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1616         [BZ #4512]
1617         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1618         is detected.
1619         * pthread_mutex_timedlock.c: Likewise.
1620         * pthread_mutex_trylock.c: Likewise.
1621         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1623         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1624         * tst-robust9.c: New file.
1625         * tst-robustpi9.c: New file.
1627         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1628         unnecessary extra cancellation test.
1630 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1632         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1633         extra cancellation test.
1634         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1636 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1638         * descr.h (struct pthread): Rearrange members to fill hole in
1639         64-bit layout.
1641         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1642         (__pthread_setaffinity_new): If syscall was successful and
1643         RESET_VGETCPU_CACHE is defined, use it before returning.
1644         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1646 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1648         [BZ #4455]
1649         * tst-align2.c: Include stackinfo.h.
1650         * tst-getpid1.c: Likewise.
1652 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1654         [BZ #4455]
1655         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1656         * tst-getpid1.c (do_test): Likewise.
1658         [BZ #4456]
1659         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1660         (allocate_stack): Likewise.
1662 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1664         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1665         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1666         (__lll_robust_timedlock_wait): Likewise.
1667         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1669 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1671         [BZ #4465]
1672         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1673         * tst-cancel4.c (tf_fdatasync): New test.
1675 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1677         [BZ #4392]
1678         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1679         check mutexes like normal mutexes.
1681         [BZ #4306]
1682         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1683         Initialize the whole sigevent structure to appease valgrind.
1685 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1687         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1688         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1690 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1692         * tst-locale1.c: Avoid warnings.
1693         * tst-locale2.c: Likewise.
1695 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1697         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1698         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1700 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1702         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1703         __extern_always_inline where appropriate.
1704         * sysdeps/pthread/pthread.h: Likewise.
1706 2007-03-13  Richard Henderson  <rth@redhat.com>
1708         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1709         separate cfi regions for the two subsections.
1711 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1713         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1714         new thread, don't just decrement it.
1715         Patch by Suzuki K P <suzuki@in.ibm.com>.
1717 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1719         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1720         PTHFCT_CALL definition.
1722 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1724         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1725         available, don't use it.
1727 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1729         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1730         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1731         call into the kernel to delay.
1733 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1735         * tst-initializers1.c: We want to test the initializers as seen
1736         outside of libc, so undefined _LIBC.
1738         * pthread_join.c (cleanup): Avoid warning.
1740 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1742         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1743         (__lll_timedwait_tid): Add unwind info.
1745         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1746         function table, mangle the pointers.
1747         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1748         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1749         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1750         demangle pointers before use.
1751         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1752         demangle pointer.
1753         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1754         * sysdeps/pthread/setxid.h: Likewise.
1756 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1758         * tst-rwlock7.c: Show some more information in case of correct
1759         behavior.
1761 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1763         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1764         (lll_futex_timed_wait): Undo part of last change, don't negate
1765         return value.
1767 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1769         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1770         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1772 2006-12-28  David S. Miller  <davem@davemloft.net>
1774         * shlib-versions: Fix sparc64 linux target specification.
1776 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1778         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1779         Adjust include path for pthread_barrier_wait.c move.
1781 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1783         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1784         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1786 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1788         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1789         6 argument cancellable syscalls.
1790         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1791         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1792         6 argument cancellable syscalls.
1793         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1795 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1797         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1798         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1800 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1802         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1803         __sync_lock_release instead of __sync_lock_release_si.
1805 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1807         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1808         Define.
1809         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1810         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1811         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1812         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1813         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1814         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1815         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1816         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1817         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1818         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1819         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1821 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1823         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1824         * pthread_barrier_wait.c: ...here.
1825         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1826         * pthread_cond_broadcast.c: ...here.
1827         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1828         * pthread_cond_signal.c: ...here.
1829         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1830         * pthread_cond_timedwait.c: ...here.
1831         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1832         * pthread_cond_wait.c: ...here.
1833         * sysdeps/pthread/pthread_once.c: Move to...
1834         * pthread_once.c: ...here.
1835         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1836         * pthread_rwlock_rdlock.c: ...here.
1837         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1838         * pthread_rwlock_timedrdlock.c: ...here.
1839         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1840         * pthread_rwlock_timedwrlock.c: ...here.
1841         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1842         * pthread_rwlock_unlock.c: ...here.
1843         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1844         * pthread_rwlock_wrlock.c: ...here.
1845         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1846         * pthread_spin_destroy.c: ...here.
1847         * sysdeps/pthread/pthread_spin_init.c: Move to...
1848         * pthread_spin_init.c: ...here.
1849         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1850         * pthread_spin_unlock.c: ...here.
1851         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1852         * pthread_getcpuclockid.c: ...here.
1854         * init.c: USE_TLS support is now always enabled.
1855         * tst-tls5.h: Likewise.
1856         * sysdeps/alpha/tls.h: Likewise.
1857         * sysdeps/i386/tls.h: Likewise.
1858         * sysdeps/ia64/tls.h: Likewise.
1859         * sysdeps/powerpc/tls.h: Likewise.
1860         * sysdeps/s390/tls.h: Likewise.
1861         * sysdeps/sh/tls.h: Likewise.
1862         * sysdeps/sparc/tls.h: Likewise.
1863         * sysdeps/x86_64/tls.h: Likewise.
1865 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1867         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1868         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1869         failed.
1871         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1872         Define to THREAD_SELF->header.multiple_threads.
1873         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1874         Likewise.
1875         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1876         Likewise.
1877         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1878         (SINGLE_THREAD_P): Likewise.
1879         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1880         (SINGLE_THREAD_P): Likewise.
1881         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1882         (SINGLE_THREAD_P): Likewise.
1883         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1884         (SINGLE_THREAD_P): Likewise.
1885         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
1886         Likewise.
1887         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1888         (SINGLE_THREAD_P): Likewise.
1889         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1890         (SINGLE_THREAD_P): Likewise.
1891         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
1892         Likewise.
1894 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
1896         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
1897         by default rather than 2_3_3.
1899 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
1901         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1902         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
1903         atomic_* instead of catomic_* macros.
1905 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
1907         [BZ #3285]
1908         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
1909         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1910         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1911         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1912         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1913         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
1914         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1915         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1916         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1917         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
1918         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1919         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1920         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1922 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
1924         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
1925         cancelable syscalls with six parameters.
1927         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
1928         operations instead of atomic_*.
1930 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
1932         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
1934 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
1936         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
1937         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
1938         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
1939         New file.
1940         * pthread_attr_setstack.c: Allow overwriting the version number of the
1941         new symbol.
1942         * pthread_attr_setstacksize.c: Likewise.
1943         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
1944         it.
1945         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
1946         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
1948 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
1950         [BZ #3251]
1951         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
1952         Patch by Petr Baudis.
1954 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
1956         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
1958         * tst-cancel2.c (tf): Loop as long as something was written.
1960 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1962         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
1963         mutexes wake all mutexes.
1964         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
1965         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1966         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1968 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
1970         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
1971         to guarantee the thread is always canceled.
1973 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
1975         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
1976         Include stdlib.h.
1977         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
1978         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
1979         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1980         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1981         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1983 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
1985         [BZ #3123]
1986         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
1987         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1988         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1989         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1990         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1991         * Makefile (tests): Add tst-cond22.
1992         * tst-cond22.c: New file.
1994 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
1996         [BZ #3124]
1997         * descr.h (struct pthread): Add parent_cancelhandling.
1998         * sysdeps/pthread/createthread.c (create_thread): Pass parent
1999         cancelhandling value to child.
2000         * pthread_create.c (start_thread): If parent thread was canceled
2001         reset the SIGCANCEL mask.
2002         * Makefile (tests): Add tst-cancel25.
2003         * tst-cancel25.c: New file.
2005 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2006             Ulrich Drepper  <drepper@redhat.com>
2008         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2009         counterp if it is already zero.
2010         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2012 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2013             Roland McGrath  <roland@redhat.com>
2015         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2016         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2017         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2018         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2019         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2020         lll_robust_mutex_timedlock, lll_mutex_unlock,
2021         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2022         Add _L_*_ symbols around the subsection.
2023         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2024         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2026 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2027             Roland McGrath  <roland@redhat.com>
2029         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2030         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2031         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2032         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2033         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2034         lll_robust_mutex_timedlock, lll_mutex_unlock,
2035         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2036         Add _L_*_ symbols around the subsection.
2037         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2038         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2040 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2042         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2043         change because it can disturb too much existing code.  If real hard
2044         reader preference is needed we'll introduce another type.
2045         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2046         (pthread_rwlock_timedwrlock): Likewise.
2047         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2048         Likewise.
2050 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2052         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2053         reader preference.
2054         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2055         (pthread_rwlock_timedwrlock): Likewise.
2056         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2057         Likewise.
2059 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2061         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2062         Only define ifdef SHARED.
2064 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2066         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2067         (free_stacks): ...here.
2068         (__free_stack_cache): New function.
2069         * pthreadP.h: Declare __free_stack_cache.
2070         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2071         ptr_freeres.
2072         * init.c (pthread_functions): Initialize ptr_freeres.
2073         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2074         New freeres function.
2076 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2078         [BZ #3018]
2079         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2081 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2083         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2084         _XOPEN_REALTIME_THREADS.
2086 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2088         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2089         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2090         HAVE_CLOCK_GETTIME_VSYSCALL.
2091         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2093 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2095         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2096         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2097         * descr.h (struct priority_protection_data): New type.
2098         (struct pthread): Add tpp field.
2099         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2100         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2101         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2102         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2103         TPP mutexes.
2104         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2105         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2106         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2107         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2108         * tpp.c: New file.
2109         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2110         boosted by TPP.
2111         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2112         * pthread_mutexattr_getprioceiling.c
2113         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2114         in the SCHED_FIFO priority range.
2115         * pthread_mutexattr_setprioceiling.c
2116         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2117         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2118         if mutex is not TPP.  Ceiling is now in __data.__lock.
2119         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2120         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2121         is now in __data.__lock.  Add locking.
2122         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2123         * Makefile (libpthread-routines): Add tpp.
2124         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2125         * tst-tpp.h: New file.
2126         * tst-mutexpp1.c: New file.
2127         * tst-mutexpp6.c: New file.
2128         * tst-mutexpp10.c: New file.
2129         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2130         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2132 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2134         [BZ #2843]
2135         * pthread_join.c (pthread_join): Account for self being canceled
2136         when checking for deadlocks.
2137         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2138         (tf1): Don't print anything after pthread_join returns, this would be
2139         another cancellation point.
2140         (tf2): Likewise.
2141         * tst-join6.c: New file.
2142         * Makefile (tests): Add tst-join6.
2144 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2146         [BZ #2892]
2147         * pthread_setspecific.c (__pthread_setspecific): Check
2148         out-of-range index before checking for unused key.
2150         * sysdeps/pthread/gai_misc.h: New file.
2152 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2154         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2155         file.  Don't use sysctl.
2156         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2157         overwrite the file if this is likely not true.
2159 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2161         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2162         * Makefile (tests): Add tst-getpid3.
2163         * tst-getpid3.c: New file.
2165 2006-07-30  Roland McGrath  <roland@redhat.com>
2167         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2169         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2170         (pause_not_cancel): New macro.
2171         (nanosleep_not_cancel): New macro.
2172         (sigsuspend_not_cancel): New macro.
2173         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2174         nanosleep_not_cancel macro from <not-cancel.h>.
2175         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2176         macro from <not-cancel.h>.
2178 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2179             Jakub Jelinek  <jakub@redhat.com>
2181         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2182         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2183         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2184         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2185         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2186         * pthread_mutex_lock.c: Likewise.
2187         * pthread_mutex_timedlock.c: Likewise.
2188         * pthread_mutex_trylock.c: Likewise.
2189         * pthread_mutex_unlock.c: Likewise.
2190         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2191         all mutexes.
2192         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2193         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2194         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2195         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2196         pthread-pi-defines.sym.
2197         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2198         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2199         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2200         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2201         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2202         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2203         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2204         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2205         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2206         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2207         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2208         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2209         * tst-mutex2.c: Likewise.
2210         * tst-mutex3.c: Likewise.
2211         * tst-mutex4.c: Likewise.
2212         * tst-mutex5.c: Likewise.
2213         * tst-mutex6.c: Likewise.
2214         * tst-mutex7.c: Likewise.
2215         * tst-mutex7a.c: Likewise.
2216         * tst-mutex8.c: Likewise.
2217         * tst-mutex9.c: Likewise.
2218         * tst-robust1.c: Likewise.
2219         * tst-robust7.c: Likewise.
2220         * tst-robust8.c: Likewise.
2221         * tst-mutexpi1.c: New file.
2222         * tst-mutexpi2.c: New file.
2223         * tst-mutexpi3.c: New file.
2224         * tst-mutexpi4.c: New file.
2225         * tst-mutexpi5.c: New file.
2226         * tst-mutexpi6.c: New file.
2227         * tst-mutexpi7.c: New file.
2228         * tst-mutexpi7a.c: New file.
2229         * tst-mutexpi8.c: New file.
2230         * tst-mutexpi9.c: New file.
2231         * tst-robust1.c: New file.
2232         * tst-robust2.c: New file.
2233         * tst-robust3.c: New file.
2234         * tst-robust4.c: New file.
2235         * tst-robust5.c: New file.
2236         * tst-robust6.c: New file.
2237         * tst-robust7.c: New file.
2238         * tst-robust8.c: New file.
2239         * Makefile (tests): Add the new tests.
2241         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2242         * pthread_mutex_destroy.c: Remove unneeded label.
2244 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2246         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2247         computations to compile time.
2249 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2251         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2253 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2255         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2257 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2259         * pthread_key_create.c (__pthread_key_create): Do away with
2260         __pthread_keys_lock.
2262         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2263         (__kernel_cpumask_size): Mark as hidden.
2264         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2266         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2267         * semaphoreP.h (__sem_mappings_lock): Likewise.
2269 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2271         * pthread_atfork.c: Mark __dso_handle as hidden.
2273 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2275         [BZ #2644]
2276         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2277         the reload problem.  Change the one path in pthread_cancel_init
2278         which causes the problem.  Force gcc to reload.  Simplify callers.
2279         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2280         (_Unwind_GetBSP): Undo last patch.
2282 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2284         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2285         function pointer is reloaded after pthread_cancel_init calls.
2287         [BZ #2644]
2288         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2289         pointers are reloaded after pthread_cancel_init calls.
2291 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2293         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2294         __always_inline.
2296 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2298         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2299         Allocate new object which is passed to timer_sigev_thread so that
2300         the timer can be deleted before the new thread is scheduled.
2302 2006-04-26  Roland McGrath  <roland@redhat.com>
2304         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2306 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2308         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2309         suffix for conditional jumps.
2310         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2311         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2312         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2313         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2314         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2315         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2317         * init.c (sigcancel_handler): Compare with correct PID even if the
2318         thread is in the middle of a fork call.
2319         (sighandler_setxid): Likewise.
2320         Reported by Suzuki K P <suzuki@in.ibm.com> .
2322 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2324         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2326 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2328         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2329         fails [Coverity CID 105].
2331 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2333         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2335 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2337         [BZ #2505]
2338         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2339         Define __lll_rel_instr using lwsync.
2341 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2343         * allocatestack.c (allocate_stack): Always initialize robust_head.
2344         * descr.h: Define struct robust_list_head.
2345         (struct pthread): Use robust_list_head in robust mutex list definition.
2346         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2347         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2348         (__pthread_initialize_minimal_internal): Register robust_list with
2349         the kernel.
2350         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2351         Declare __set_robust_list_avail.
2352         * pthread_create.c (start_thread): Register robust_list of new thread.
2353         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2354         waiters.
2355         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2356         number of users, it's unreliable.
2357         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2358         set_robust_list syscall is available.
2359         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2360         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2361         Set robust_head.list_op_pending before trying to lock a robust mutex.
2362         * pthread_mutex_timedlock.c: Likewise.
2363         * pthread_mutex_trylock.c: Likewise.
2364         * pthread_mutex_unlock.c: Likewise for unlocking.
2365         * Makefile (tests): Add tst-robust8.
2366         * tst-robust8.c: New file.
2368 2006-03-08  Andreas Schwab  <schwab@suse.de>
2370         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2371         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2373 2006-03-05  Roland McGrath  <roland@redhat.com>
2375         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2376         and $config_os doesn't match *linux*.
2378 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2380         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2381         Use __syscall_error.
2382         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2383         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2384         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2385         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2386         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2387         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2389 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2391         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2393 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2395         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2396         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2397         mutex.
2398         (__lll_robust_timedlock_wait): Likewise.
2399         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2400         (__lll_robust_lock_wait): Likewise.
2401         (__lll_robust_timedlock_wait): Likewise.
2402         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2403         (__lll_robust_lock_wait): Likewise.
2404         (__lll_robust_timedlock_wait): Likewise.
2406 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2408         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2409         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2410         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2411         lll_robust_mutex_unlock): Define.
2412         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2414 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2416         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2417         instead of <clone.S>.
2419 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2421         * Makefile (libpthread-routines): Add
2422         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2423         and pthread_mutex_[sg]etprioceiling.
2424         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2425         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2426         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2427         pthread_mutex_setprioceiling.
2428         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2429         PTHREAD_PRIO_PROTECT): New enum values.
2430         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2431         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2432         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2433         prototypes.
2434         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2435         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2436         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2437         Define.
2438         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2439         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2440         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2441         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2442         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2443         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2444         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2445         protocol mutexes.
2446         * pthread_mutex_getprioceiling.c: New file.
2447         * pthread_mutex_setprioceiling.c: New file.
2448         * pthread_mutexattr_getprioceiling.c: New file.
2449         * pthread_mutexattr_setprioceiling.c: New file.
2450         * pthread_mutexattr_getprotocol.c: New file.
2451         * pthread_mutexattr_setprotocol.c: New file.
2453 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2455         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2457 2006-02-27  Roland McGrath  <roland@redhat.com>
2459         * sysdeps/pthread/Subdirs: List nptl here too.
2460         * configure (libc_add_on_canonical): New variable.
2462         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2464         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2465         self to get main source tree's file.
2466         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2467         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2468         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2469         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2470         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2471         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2472         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2473         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2474         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2475         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2476         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2477         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2478         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2480         * Makefile: Use $(sysdirs) in vpath directive.
2482         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2483         (CPPFLAGS-timer_routines.c): Likewise.
2485         * Makeconfig (includes): Variable removed.
2487 2006-02-26  Roland McGrath  <roland@redhat.com>
2489         * sysdeps/generic/pt-raise.c: Moved to ...
2490         * pt-raise.c: ... here.
2491         * sysdeps/generic/lowlevellock.h: Moved to ...
2492         * lowlevellock.h: ... here.
2494 2006-02-23  Roland McGrath  <roland@redhat.com>
2496         * descr.h (struct pthread): Add final member `end_padding'.
2497         (PTHREAD_STRUCT_END_PADDING): Use it.
2499 2006-02-20  Roland McGrath  <roland@redhat.com>
2501         * sysdeps/mips: Directory removed, saved in ports repository.
2502         * sysdeps/unix/sysv/linux/mips: Likewise.
2504 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2506         * tst-robust1.c: Add second mutex to check that the mutex list is
2507         handled correctly.
2509 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2511         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2512         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2513         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2514         lll_robust_mutex_unlock): New macros.
2515         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2516         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2517         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2518         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2519         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2521 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2523         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2524         definitions.
2525         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2527 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2529         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2530         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2531         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2532         (lll_robust_mutex_unlock): Likewise.
2534 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2536         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2537         Set robust_list.__next rather than robust_list.
2538         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2539         (__pthread_list_t): New typedef.
2540         (pthread_mutex_t): Replace __next and __prev fields with __list.
2541         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2542         (__pthread_list_t): New typedef.
2543         (pthread_mutex_t): Replace __next and __prev fields with __list.
2544         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2545         (__pthread_list_t, __pthread_slist_t): New typedefs.
2546         (pthread_mutex_t): Replace __next and __prev fields with __list.
2547         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2548         (__pthread_list_t, __pthread_slist_t): New typedefs.
2549         (pthread_mutex_t): Replace __next and __prev fields with __list.
2550         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2551         (__pthread_list_t, __pthread_slist_t): New typedefs.
2552         (pthread_mutex_t): Replace __next and __prev fields with __list.
2553         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2554         (__pthread_slist_t): New typedef.
2555         (pthread_mutex_t): Replace __next field with __list.
2557 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2559         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2560         PTHREAD_MUTEX_OWNERDEAD.
2561         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2562         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2563         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2564         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2565         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2566         to PTHREAD_MUTEX_INCONSISTENT.
2567         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2568         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2569         * pthread_mutex_trylock.c: Likewise.
2570         * pthread_mutex_timedlock.c: Likewise.
2571         * pthread_mutex_unlock.c: Likewise.
2572         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2573         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2574         lowlevelrobustlock.sym.
2575         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2576         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2577         definitions.
2578         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2579         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2580         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2581         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2582         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2584 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2586         * allocatestack.c (allocate_stack): Initialize robust_list.
2587         * init.c (__pthread_initialize_minimal_internal): Likewise.
2588         * descr.h (struct xid_command): Pretty printing.
2589         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2590         robust_list.  Adjust macros.
2591         * pthread_create.c (start_thread): Adjust robust_list handling.
2592         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2593         but the owner for all robust mutex types.
2594         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2595         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2596         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2597         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2599         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2600         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2602 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2604         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2605         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2607 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2609         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2610         Return status.
2611         (lll_futex_timed_wait): Define.
2613 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2615         * tst-cancel4.c: Test ppoll.
2617 2006-01-18  Andreas Jaeger  <aj@suse.de>
2619         [BZ #2167]
2620         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2621         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2622         by Jim Gifford <patches@jg555.com>.
2624 2006-01-13  Richard Henderson  <rth@redhat.com>
2626         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2628 2006-01-10  Roland McGrath  <roland@redhat.com>
2630         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2631         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2632         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2633         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2634         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2635         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2636         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2637         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2638         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2639         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2641 2006-01-09  Roland McGrath  <roland@redhat.com>
2643         * tst-initializers1-c89.c: New file.
2644         * tst-initializers1-c99.c: New file.
2645         * tst-initializers1-gnu89.c: New file.
2646         * tst-initializers1-gnu99.c: New file.
2647         * Makefile (tests): Add them.
2648         (CFLAGS-tst-initializers1-c89.c): New variable.
2649         (CFLAGS-tst-initializers1-c99.c): New variable.
2650         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2651         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2653         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2654         Use __extension__ on anonymous union definition.
2655         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2656         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2657         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2658         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2659         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2661 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2663         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2664         Don't give the union a name because it changes the mangled name.
2665         Instead name the struct for __data.
2666         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2667         Likewise.
2668         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2669         Likewise.
2671 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2673         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2674         stack bias to mc_ftp field.
2676 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2678         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2679         being too clever and reloading the futex value where it shouldn't.
2681 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2683         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2684         correct type.
2686 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2688         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2689         Add cfi directives.
2691 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2693         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2694         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2695         rename in tcbhead_t.
2697         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2698         Don't give the union a name because it changes the mangled name.
2699         Instead name the struct for __data.
2700         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2701         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2702         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2703         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2704         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2705         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2707 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2709         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2710         Return status.
2711         (lll_futex_timed_wait): Define.
2712         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2713         * sysdeps/pthread/aio_misc.h: New file.
2715 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2717         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2719 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2721         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2722         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2723         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2725 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2727         * tst-cancel24.cc: Use C headers instead of C++ headers.
2729 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2731         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2732         sparc-linux configured glibc.
2733         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2734         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2735         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2736         atomic_compare_and_exchange_val_24_acq instead of
2737         atomic_compare_and_exchange_val_acq.
2738         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2739         instead of atomic_exchange_rel.
2740         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2741         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2742         file.
2743         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2744         file.
2745         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2746         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2747         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2748         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2749         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2750         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2751         New file.
2752         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2753         New file.
2754         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2755         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2756         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2757         file.
2758         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2759         file.
2760         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2762 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2764         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2765         mutex initializers.
2767 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2769         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2770         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2771         THREAD_COPY_POINTER_GUARD): Define.
2772         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2773         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2775 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2777         * version.c: Update copyright year.
2779 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2781         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2782         .eh_frame section, use cfi_* directives.
2783         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2785 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2787         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2788         now.
2790 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2792         * sysdeps/pthread/sigaction.c: Removed.
2793         * sigaction.c: New file.
2794         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2796 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2798         * Makefile (tests): Add tst-signal7.
2799         * tst-signal7.c: New file.
2801 2005-12-27  Roland McGrath  <roland@redhat.com>
2803         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2804         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2805         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2806         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2807         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2808         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2809         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2810         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2811         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2812         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2813         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2815 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2817         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2818         and __prev field to pthread_mutex_t.
2819         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2820         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2821         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2822         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2823         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2824         to pthread_mutex_t.
2826 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2828         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2829         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2830         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2831         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2832         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2833         and PTHREAD_MUTEXATTR_FLAG_BITS.
2834         * descr.h (struct pthread): Add robust_list field and define
2835         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2836         * pthread_mutexattr_getrobust.c: New file.
2837         * pthread_mutexattr_setrobust.c: New file.
2838         * pthread_mutex_consistent.c: New file.
2839         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2840         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2841         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2842         Adjust pthread_mutex_t initializers.
2843         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2844         field to pthread_mutex_t.
2845         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2846         and __prev field to pthread_mutex_t.
2847         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2848         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2849         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2850         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2851         * pthread_mutexattr_gettype.c: Likewise.
2852         * pthread_mutexattr_setpshared.c: Likewise.
2853         * pthread_mutexattr_settype.c: Likewise.
2854         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2855         Initialize mutex kind according to robust flag.
2856         * pthread_mutex_lock.c: Implement local robust mutex.
2857         * pthread_mutex_timedlock.c: Likewise.
2858         * pthread_mutex_trylock.c: Likewise.
2859         * pthread_mutex_unlock.c: Likewise.
2860         * pthread_create.c (start_thread): Mark robust mutexes which remained
2861         locked as dead.
2862         * tst-robust1.c: New file.
2863         * tst-robust2.c: New file.
2864         * tst-robust3.c: New file.
2865         * tst-robust4.c: New file.
2866         * tst-robust5.c: New file.
2867         * tst-robust6.c: New file.
2868         * tst-robust7.c: New file.
2869         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
2870         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2871         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
2872         tst-robust5, tst-robust6, and tst-robust7.
2874         * tst-typesizes.c: New file.
2875         * Makefile (tests): Add tst-typesizes.
2877         * tst-once3.c: More debug output.
2879 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
2881         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
2882         missing after last change.
2884         * version.c: Update copyright year.
2886 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
2888         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
2889         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
2890         * pthread_mutex_trylock.c: Likewise.
2891         * pthread_mutex_timedlock.c: Likewise.
2892         * pthread_mutex_unlock.c: Likewise.
2894 2005-12-22  Roland McGrath  <roland@redhat.com>
2896         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
2897         so that #include_next's search location is not reset to the -I..
2898         directory where <nptl/...> can be found.
2900 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
2902         [BZ #1913]
2903         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2904         Fix unwind info.  Remove useless branch prediction prefix.
2905         * tst-cancel24.cc: New file.
2906         * Makefile: Add rules to build and run tst-cancel24.
2908 2005-12-21  Roland McGrath  <roland@redhat.com>
2910         * libc-cancellation.c: Use <> rather than "" #includes.
2911         * pt-cleanup.c: Likewise.
2912         * pthread_create.c: Likewise.
2913         * pthread_join.c: Likewise.
2914         * pthread_timedjoin.c: Likewise.
2915         * pthread_tryjoin.c: Likewise.
2916         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
2917         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2918         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2919         * unwind.c: Likewise.
2921 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2923         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
2924         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
2925         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2926         THREAD_COPY_POINTER_GUARD): Define.
2928 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
2930         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
2931         rather than one.
2932         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2933         THREAD_COPY_POINTER_GUARD): Define.
2934         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
2935         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
2936         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2937         THREAD_COPY_POINTER_GUARD): Define.
2938         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
2939         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
2940         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
2941         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
2942         Use PTR_DEMANGLE for B0 if defined.
2944 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
2946         * pthread_create.c (__pthread_create_2_1): Use
2947         THREAD_COPY_POINTER_GUARD if available.
2948         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
2949         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2950         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
2951         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
2952         * sysdeps/x86_64/tls.h: Likewise.
2954 2005-12-15  Roland McGrath  <roland@redhat.com>
2956         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
2958 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
2960         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
2961         sysdeps/generic.
2962         * errno-loc.c: New file.
2964 2005-12-12  Roland McGrath  <roland@redhat.com>
2966         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
2967         adjustments before choosing stack size.  Update minimum stack size
2968         calculation to match allocate_stack change.
2970 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
2972         * allocatestack.c (allocate_stack): Don't demand that there is an
2973         additional full page available on the stack beside guard, TLS, the
2974         minimum stack.
2976 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
2978         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2979         (__cleanup_fct_attribute): Use __regparm__ not regparm.
2981         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
2982         compiling 32-bit code we must define __cleanup_fct_attribute.
2984 005-11-24  Jakub Jelinek  <jakub@redhat.com>
2986         [BZ #1920]
2987         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
2988         __attribute__ instead of __attribute.
2989         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2990         (__cleanup_fct_attribute): Likewise.
2992 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
2994         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
2995         a write barrier before writing libgcc_s_getcfa.
2997 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
2999         * sysdeps/unix/sysv/linux/configure: Removed.
3001 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3003         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3004         optional init_array/fini_array support.
3006 2005-10-24  Roland McGrath  <roland@redhat.com>
3008         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3009         versioned_symbol use.
3011 2005-10-16  Roland McGrath  <roland@redhat.com>
3013         * init.c (__pthread_initialize_minimal_internal): Even when using a
3014         compile-time default stack size, apply the minimum that allocate_stack
3015         will require, and round up to page size.
3017 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3019         * Makefile ($(test-modules)): Remove static pattern rule.
3021 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3022             Ulrich Drepper  <drepper@redhat.com>
3024         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3025         alignment in callback function.
3026         * Makefile: Add rules to build and run tst-align3.
3027         * tst-align3.c: New file.
3029 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3031         * allocatestack.c (setxid_signal_thread): Add
3032         INTERNAL_SYSCALL_DECL (err).
3034 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3036         * allocatestack.c (setxid_signal_thread): Need to use
3037         atomic_compare_and_exchange_bool_acq.
3039 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3040             Jakub Jelinek  <jakub@redhat.com>
3042         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3043         CANCEL_RESTMASK.
3044         (struct pthread): Move specific_used field to avoid padding.
3045         Add setxid_futex field.
3046         * init.c (sighandler_setxid): Reset setxid flag and release the
3047         setxid futex.
3048         * allocatestack.c (setxid_signal_thread): New function.  Broken
3049         out of the bodies of the two loops in __nptl_setxid.  For undetached
3050         threads check whether they are exiting and if yes, don't send a signal.
3051         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3052         * pthread_create.c (start_thread): For undetached threads, check
3053         whether setxid bit is set.  If yes, wait until signal has been
3054         processed.
3056         * allocatestack.c (STACK_VARIABLES): Initialize them.
3057         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3059 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3061         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3062         waiters, awake all waiters on the associated mutex.
3064 2005-09-22  Roland McGrath  <roland@redhat.com>
3066         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3067         ../sysdeps/x86_64/hp-timing.h).
3069 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3071         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3072         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3073         (lll_futex_wake_unlock): Define.
3074         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3075         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3076         (lll_futex_wake_unlock): Define.
3077         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3078         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3079         (lll_futex_wake_unlock): Define.
3080         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3081         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3082         (lll_futex_wake_unlock): Define.
3083         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3084         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3085         (lll_futex_wake_unlock): Define.
3086         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3087         lll_futex_wake_unlock.
3088         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3089         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3090         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3091         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3092         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3093         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3095 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3097         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3098         Fix typo in register name.
3100 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3102         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3103         Use __sigfillset.  Document that sigfillset does the right thing wrt
3104         to SIGSETXID.
3106 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3108         [BZ #1102]
3109         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3110         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3111         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3112         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3113         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3114         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3115         in the structure.
3116         * Makefile (tests): Add tst-initializers1.
3117         (CFLAGS-tst-initializers1.c): Set.
3118         * tst-initializers1.c: New test.
3120 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3122         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3123         Make sure __flags are located at offset 48 from the start of the
3124         structure.
3126 2005-07-02  Roland McGrath  <roland@redhat.com>
3128         * Makeconfig: Comment fix.
3130 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3132         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3133         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3134         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3135         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3136         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3137         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3138         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3139         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3140         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3141         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3143 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3145         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3146         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3147         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3148         fields.
3149         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3150         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3151         field.  Put in sysinfo field unconditionally.
3152         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3153         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3154         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3155         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3156         fields.
3157         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3158         * pthread_create.c (__pthread_create_2_1): Use
3159         THREAD_COPY_STACK_GUARD macro.
3160         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3161         tests.
3162         * tst-stackguard1.c: New file.
3163         * tst-stackguard1-static.c: New file.
3165 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3167         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3168         Invoke CGOTSETUP and CGOTRESTORE.
3169         (CGOTSETUP, CGOTRESTORE): Define.
3171 2005-05-29  Richard Henderson  <rth@redhat.com>
3173         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3174         (tf_write, tf_writev): Use it.
3175         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3176         the system minimum.
3178 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3180         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3181         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3182         __librt_*_asynccancel@local.
3184 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3186         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3187         all occurrences of JUMPTARGET.  Instead append @local to labels.
3189 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3191         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3192         size/alignment of struct pthread rather than tcbhead_t.
3193         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3194         Likewise.
3195         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3196         Likewise.
3197         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3198         Likewise.
3200 2005-05-19  Richard Henderson  <rth@redhat.com>
3202         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3203         __sync_val_compare_and_swap, not explicit _si variant.
3204         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3206 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3208         [BZ #915]
3209         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3211 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3213         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3214         .eh_frame section, use cfi_* directives.
3216 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3218         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3219         of "" includes.
3221 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3223         [BZ #1075]
3224         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3225         aio_write blocks.
3227 2005-04-27  Roland McGrath  <roland@redhat.com>
3229         * Makefile (tests): Remove tst-clock2.
3231         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3232         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3233         translating to the kernel clockid_t for our own process/thread clock.
3235         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3237 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3239         * old_pthread_cond_init.c: Include <errno.h>.
3240         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3241         process shared or uses clock other than CLOCK_REALTIME.
3242         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3244 2005-04-13  David S. Miller  <davem@davemloft.net>
3246         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3247         * sysdeps/sparc/sparc64/clone.S: New file.
3249 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3251         [BZ #1102]
3252         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3253         __inline instead of inline.
3254         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3256 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3258         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3259         functionally equivalent, but shorter instructions.
3260         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3261         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3262         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3263         Likewise.
3264         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3265         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3266         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3267         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3268         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3269         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3270         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3271         Likewise.
3272         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3273         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3274         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3275         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3276         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3278 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3280         * sysdeps/mips/Makefile: New file.
3281         * sysdeps/mips/nptl-sysdep.S: New file.
3282         * sysdeps/mips/tcb-offsets.sym: New file.
3283         * sysdeps/mips/pthread_spin_lock.S: New file.
3284         * sysdeps/mips/pthread_spin_trylock.S: New file.
3285         * sysdeps/mips/pthreaddef.h: New file.
3286         * sysdeps/mips/tls.h: New file.
3287         * sysdeps/mips/jmpbuf-unwind.h: New file.
3288         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3289         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3290         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3291         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3292         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3293         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3294         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3295         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3296         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3297         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3299 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3301         [BZ #1112]
3302         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3303         variable to scerr.
3305 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3307         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3309 2005-02-25  Roland McGrath  <roland@redhat.com>
3311         * alloca_cutoff.c: Correct license text.
3312         * tst-unload.c: Likewise.
3313         * sysdeps/pthread/allocalim.h: Likewise.
3314         * sysdeps/pthread/pt-initfini.c: Likewise.
3315         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3316         * sysdeps/pthread/bits/sigthread.h: Likewise.
3317         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3318         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3320 2005-02-16  Roland McGrath  <roland@redhat.com>
3322         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3323         Use unsigned int * for ptr_nthreads.
3325 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3327         [BZ #721]
3328         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3329         gcc4.
3331 2005-02-07  Richard Henderson  <rth@redhat.com>
3333         [BZ #787]
3334         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3335         argument.
3337 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3339         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3340         order of arguments in invocation of atomic_add_zero.
3342 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3344         [BZ #737]
3345         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3346         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3347         at least gotntpoff relocation and addition.
3348         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3349         Likewise.
3350         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3351         Likewise.
3352         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3353         Likewise.
3355 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3357         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3358         entry for static tls deallocation fix.
3359         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3360         also contains information whether the memory pointed to is static
3361         TLS or not.
3362         * sysdeps/i386/tls.h: Likewise.
3363         * sysdeps/ia64/tls.h: Likewise.
3364         * sysdeps/powerpc/tls.h: Likewise.
3365         * sysdeps/s390/tls.h: Likewise.
3366         * sysdeps/sh/tls.h: Likewise.
3367         * sysdeps/sparc/tls.h: Likewise.
3368         * sysdeps/x86_64/tls.h: Likewise.
3370 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3372         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3374 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3376         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3377         %esp.
3378         * Makefile (tests): Add tst-align2.
3379         * tst-align2.c: New test.
3380         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3381         -mpreferred-stack-boundary=4.
3383 2004-12-18  Roland McGrath  <roland@redhat.com>
3385         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3386         New file removed withdrawn for the moment.
3388 2004-12-17  Richard Henderson  <rth@redhat.com>
3390         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3391         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3393 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3395         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3396         Increased PTHREAD_STACK_MIN.
3398         * tst-context1.c (stacks): Use bigger stack size.
3400 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3402         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3403         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3405 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3407         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3408         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3409         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3411 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3413         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3415 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3417         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3418         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3420         * tst-getpid1.c: If child crashes, report this first.  Print which
3421         signal.
3423 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3425         * init.c (__pthread_initialize_minimal_internal): Also unblock
3426         SIGSETXID.
3428 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3430         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3431         _POSIX_THREAD_CPUTIME): Define to 0.
3432         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3433         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3434         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3435         __timer_signal_thread_tclk): Remove.
3436         (init_module): Remove their initialization.
3437         (thread_cleanup): Remove their cleanup assertions.
3438         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3439         __timer_signal_thread_tclk): Remove.
3440         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3441         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3442         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3444 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3446         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3447         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3449         * Makefile (tests): Add tst-getpid2.
3450         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3451         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3452         * tst-getpid2.c: New test.
3454 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3456         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3458 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3460         * Makefile (tests): Add tst-getpid1.
3461         * tst-getpid1.c: New file.
3462         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3463         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3465 2004-12-02  Roland McGrath  <roland@redhat.com>
3467         * Makefile (libpthread-nonshared): Variable removed.
3468         ($(objpfx)libpthread_nonshared.a): Target removed.
3469         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3470         These are now handled by generic magic from
3471         libpthread-static-only-routines being set.
3473 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3475         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3476         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3477         _POSIX_THREAD_PRIO_PROTECT): Define.
3478         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3479         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3480         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3482 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3484         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3485         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3486         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3487         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3488         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3489         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3490         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3492 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3494         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3496         * Makefile (libpthread-routines): Add pthread_setschedprio.
3497         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3498         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3499         * pthread_setschedprio.c: New file.
3501 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3503         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3504         * pthread_cancel.c (pthread_create): Likewise.
3506         * Makefile (libpthread-routines): Add vars.
3507         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3508         * init.c (__default_stacksize, __is_smp): Remove.
3509         * vars.c: New file.
3510         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3511         and define a wrapper macro.
3512         (PTHREAD_STATIC_FN_REQUIRE): Define.
3513         * allocatestack.c (__find_thread_by_id): Undefine.
3514         * pthread_create (__pthread_keys): Remove.
3515         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3516         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3517         PTHREAD_STATIC_FN_REQUIRE.
3519 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3521         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3522         parameter to REGISTER macro.
3524 2004-11-17  Roland McGrath  <roland@redhat.com>
3526         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3527         Make sure SIGCANCEL is blocked as well.
3529 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3531         * sysdeps/pthread/setxid.h: New file.
3532         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3533         (struct xid_command): Add forward decl.
3534         (struct pthread_functions): Change return type of __nptl_setxid hook
3535         to int.
3536         * pthreadP.h (__nptl_setxid): Change return type to int.
3537         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3538         calling thread, return its return value and set errno on failure.
3539         * descr.h (struct xid_command): Change id type to long array.
3541         * Makefile: Add rules to build and test tst-setuid1 and
3542         tst-setuid1-static.
3543         * tst-setuid1.c: New test.
3544         * tst-setuid1-static.c: New test.
3546 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3548         * Makefile (tests): Add tst-exit3.
3549         * tst-exit3.c: New test.
3551 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3553         * Makefile (tests): Add tst-exit2.
3554         * tst-exit2.c: New file.
3556 2004-11-09  Roland McGrath  <roland@redhat.com>
3558         [BZ #530]
3559         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3560         here, before calling clone.
3561         * pthread_create.c (start_thread): Don't do it here.
3563 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3565         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3567 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3569         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3570         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3571         assembler warning.
3573 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3575         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3576         if sched_priority is not between minprio and maxprio.
3578 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3580         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3581         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3583         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3584         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3586 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3588         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3589         not-cancelable I/O functions.
3591 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3593         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3594         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3595         make sure 2 is stored in the futex and we looked at the old value.
3596         Fix a few other problems to return the correct value.
3598 2004-10-14  Richard Henderson  <rth@redhat.com>
3600         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3601         make gcc4 happy.
3603 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3605         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3606         of pthread-functions.h and pthreaddef.h.
3607         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3609         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3610         Change __data.__nwaiters from int to unsigned int.
3612         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3613         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3615         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3616         before return type.
3618         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3619         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3621 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3623         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3624         test fails, remove message queue.
3625         (tf_msgsnd): Likewise.
3627 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3629         * tst-clock1.c: Change #ifdef to #if defined.
3630         * tst-clock2.c: Likewise.
3631         * tst-cond11.c: Likewise.
3633         * sysdeps/pthread/timer_create.c (timer_create): Use
3634         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3635         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3636         THREAD_CPUTIME.
3638 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3640         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3641         _POSIX_THREAD_CPUTIME): Define to 0.
3643 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3645         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3646         and _POSIX_THREAD_CPUTIME to zero.
3647         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3648         * tst-barrier2.c: Fix testing for POSIX feature.
3649         * tst-clock1.c: Likewise.
3650         * tst-clock2.c: Likewise.
3651         * tst-cond11.c: Likewise.
3652         * tst-cond4.c: Likewise.
3653         * tst-cond6.c: Likewise.
3654         * tst-flock2.c: Likewise.
3655         * tst-mutex4.c: Likewise.
3656         * tst-mutex9.c: Likewise.
3657         * tst-rwlock12.c: Likewise.
3658         * tst-rwlock4.c: Likewise.
3659         * tst-signal1.c: Likewise.
3660         * tst-spin2.c: Likewise.
3661         * sysdeps/pthread/posix-timer.h: Likewise.
3662         * sysdeps/pthread/timer_create.c: Likewise.
3663         * sysdeps/pthread/timer_routines.c: Likewise.
3665 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3667         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3668         (__lll_mutex_timedlock_wait): Address futex correctly.
3670         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3671         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3672         make sure 2 is stored in the futex and we looked at the old value.
3673         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3674         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3675         which might very well made the code not working at all before.
3676         [BZ #417]
3678 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3680         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3681         allow SIGSETXID to be sent.
3682         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3683         for SIGSETXID to be defined.
3684         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3685         SIGSETXID cannot be blocked.
3687         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3688         Add __extension__ to long long types.
3689         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3690         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3691         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3692         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3693         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3694         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3695         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3697 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3699         * descr.h (struct pthread): Add stopped_start field.
3700         * sysdeps/pthread/createthread.c (create_thread): Set
3701         start_stopped flag in descriptor for new thread appropriately.
3702         * pthread_create.c (start_thread): Only take lock to be stopped on
3703         startup if stopped_start flag says so.
3705 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3707         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3708         is created detached and if yes, do not try to free the stack in case
3709         the thread creation failed.
3710         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3711         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3712         case there has been no error.  [BZ #405]
3714         * pthread_create.c (start_thread): Don't wait for scheduler data
3715         etc to be set at the beginning of the function.  The cancellation
3716         infrastructure must have been set up.  And enable async
3717         cancellation before potentially going to sleep.  [BZ #401]
3719 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3721         * Versions: Remove exports for pthread_set*id_np functions.
3722         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3723         for now.
3724         * Makefile: Don't build pthread_set*id code for now.
3726 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3728         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3729         internal use.
3730         * allocatestack.c (__nptl_setxid): New function.
3731         * descr.h (struct xid_command): Define type.
3732         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3733         (sighandler_setxid): New function.
3734         (__pthread_initialize_minimal): Register sighandler_setxid for
3735         SIGCANCEL.
3736         * pt-allocrtsig.c: Update comment.
3737         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3738         Declare __nptl_setxid.
3739         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3740         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3741         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3742         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3743         and pthread_setresuid_np.
3744         * pthread_setgid_np.c: New file.
3745         * pthread_setuid_np.c: New file.
3746         * pthread_setegid_np.c: New file.
3747         * pthread_seteuid_np.c: New file.
3748         * pthread_setregid_np.c: New file.
3749         * pthread_setreuid_np.c: New file.
3750         * pthread_setresgid_np.c: New file.
3751         * pthread_setresuid_np.c: New file.
3752         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3753         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3754         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3755         and pthread_setresuid_np.
3756         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3757         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3758         pthread_setregid, and pthread_setresgid.
3760 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3762         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3763         ENOMEM when out of memory.
3765 2004-09-10  Roland McGrath  <roland@redhat.com>
3767         [BZ #379]
3768         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3769         code, since we don't try to use the broken CLONE_STOPPED any more.
3770         * pthread_create.c (start_thread): Likewise.
3772 2004-09-15  Richard Henderson  <rth@redhat.com>
3774         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3776 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3778         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3779         (__libc_unwind_longjmp): Delete macro and declare as function.
3780         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3781         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3782         nptl directory.
3783         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3784         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3785         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3787 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3789         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3790         for __USE_XOPEN2K.
3791         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3792         types also for __USE_XOPEN2K.
3793         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3794         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3795         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3796         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3797         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3798         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3799         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3800         [BZ #320]
3802 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3804         * sysdeps/pthread/pthread.h
3805         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3806         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3807         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3808         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3809         [BZ #375]
3811 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3813         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3814         PSEUDO to be used with . prefix.
3816         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3817         Use atomic_increment instead of atomic_exchange_and_add.
3818         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3819         Likewise.
3820         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3821         Likewise.
3822         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3823         Likewise.
3825         * allocatestack.c (allocate_stack): Use atomic_increment_val
3826         instead of atomic_exchange_and_add.
3827         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3828         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3829         Likewise.
3830         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3831         Likewise.
3833         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3834         the initialization function might throw.
3836 2005-09-05  Richard Henderson  <rth@redhat.com>
3838         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3839         Move definition inside libpthread, libc, librt check.  Provide
3840         definition for rtld.
3842 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3844         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3845         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3846         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3847         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3848         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3849         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3850         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3851         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3852         * unwind.c: Use it.
3854         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3855         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3856         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3857         Likewise.
3858         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3859         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3860         this is the last waiter, signal pthread_cond_destroy caller and
3861         avoid using the pthread_cond_t structure after unlock.
3862         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3863         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3864         Read clock type from the least significant bits of __nwaiters instead
3865         of __clock.
3866         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3867         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
3869 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
3871         [BZ #342]
3872         * Makefile (tests): Add tst-cond20 and tst-cond21.
3873         * tst-cond20.c: New test.
3874         * tst-cond21.c: New test.
3875         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3876         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
3877         it unsigned int.
3878         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3879         Likewise.
3880         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3881         (pthread_cond_t): Likewise.
3882         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3883         Likewise.
3884         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3885         Likewise.
3886         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3887         Likewise.
3888         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
3889         (cond_nwaiters): New.
3890         (clock_bits): New.
3891         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
3892         if there are waiters not signalled yet.
3893         Wait until all already signalled waiters wake up.
3894         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
3895         __nwaiters.  If pthread_cond_destroy has been called and this is the
3896         last waiter, signal pthread_cond_destroy caller and avoid using
3897         the pthread_cond_t structure after unlock.
3898         (__pthread_cond_wait): Increment __nwaiters in the beginning,
3899         decrement it when leaving.  If pthread_cond_destroy has been called
3900         and this is the last waiter, signal pthread_cond_destroy caller.
3901         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3902         Likewise.  Read clock type from the least significant bits of
3903         __nwaiters instead of __clock.
3904         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
3905         whether clock ID can be encoded in COND_CLOCK_BITS bits.
3906         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
3907         clock type just from the last COND_CLOCK_BITS bits of value.
3908         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
3909         instead of __clock, just from second bit of condattr's value.
3911 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
3913         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
3914         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
3915         != 64.
3916         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3918 2004-08-15  Roland McGrath  <roland@frob.com>
3920         * pthread_atfork.c: Update copyright terms including special exception
3921         for these trivial files, which are statically linked into executables
3922         that use dynamic linking for the significant library code.
3924 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3926         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
3927         pthread_rwlock_rdlock.
3928         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
3929         Decrease __nr_readers_queued after reacquiring lock.
3930         * sysdeps/pthread/pthread_rwlock_timedrdlock
3931         (pthread_rwlock_timedrdlock): Likewise.
3932         Reported by Bob Cook <bobcook47@hotmail.com>.
3934 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
3936         * tst-rwlock14.c (tf): Read main thread handle from *ARG
3937         before pthread_barrier_wait.
3939 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
3941         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3942         Remove unnecessary exception handling data.
3944 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
3946         [BZ #284]
3947         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
3948         instead of clockid_t.
3950 2004-07-21  Roland McGrath  <roland@redhat.com>
3952         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
3954 2004-07-19  Roland McGrath  <roland@redhat.com>
3956         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
3958 2004-07-02  Roland McGrath  <roland@redhat.com>
3960         * configure: Don't exit.
3962 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3964         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3965         (__pthread_cond_timedwait): Check for invalid nanosecond in
3966         timeout value.
3968 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
3970         * Makefile: Add rules to build and run tst-fini1.
3971         * tst-fini1.c: New file.
3972         * tst-fini1mod.c: New file.
3974 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
3976         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
3977         if no cancellation support is needed.
3978         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3979         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3980         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3981         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3982         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3983         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3984         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3985         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3986         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3988         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
3989         only if not already defined.
3991 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
3993         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
3994         constraint "m" instead of "0" for futex.
3996         * shlib-versions: Add powerpc64-.*-linux.*.
3998 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4000         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4001         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4002         for valid tv_nsec.
4003         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4004         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4005         bits.
4007 2004-06-29  Roland McGrath  <roland@redhat.com>
4009         * Banner: NPTL no longer has its own version number.
4010         * Makefile (nptl-version): Variable removed.
4011         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4012         using $(version), the glibc version number.
4014 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4016         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4017         Fix branch offset for a PLT entry.
4018         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4019         Likewise.
4020         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4021         Likewise.
4022         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4023         Likewise.
4024         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4025         Likewise.
4027 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4029         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4030         unconditionally.
4032 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4034         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4035         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4036         instead of tv_sec.
4037         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4038         (pthread_rwlock_timedrdlock): Likewise.
4040 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4042         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4043         Set __r7 to val, not mutex.
4045 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4047         * Makefile: Add rules to build tst-rwlock14.
4048         * tst-rwlock14.c: New file.
4050 2004-06-24  Boris Hu  <boris.hu@intel.com>
4052         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4053         check.
4054         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4056 2004-06-19  Andreas Jaeger  <aj@suse.de>
4058         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4059         assembler in last patch.
4061 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4063         * sysdeps/pthread/pthread_cond_timedwait.c
4064         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4065         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4066         (__pthread_cond_timedwait): Check for invalid nanosecond in
4067         timeout value.
4068         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4069         * tst-cond19.c: New file.
4070         * Makefile: Add rules to build and run tst-cond19.
4072 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4074         * tst-context1.c (GUARD_PATTERN): Defined.
4075         (tst_context_t): Define struct containing ucontext_t & guard words.
4076         (ctx): Declare as an array of tst_context_t.
4077         (fct): Verify uc_link & guard words are still valid.
4078         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4080 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4082         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4083         Add __data.__futex field, reshuffle __data.__clock.
4084         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4085         (__pthread_cond_signal): Increment __futex at the same time as
4086         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4087         address of low 32-bits of __wakeup_seq to futex syscall.
4088         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4089         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4090         releasing internal lock to FUTEX_WAIT.
4091         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4092         (__pthread_cond_timedwait): Likewise.
4093         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4094         (FUTEX_CMP_REQUEUE): Define.
4095         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4096         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4097         Pass __futex value from before the unlock and __futex address instead
4098         of address of low 32-bits of __wakeup_seq to futex syscall.
4099         Fallback to FUTEX_WAKE all on any errors.
4101 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4103         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4104         comment typo.
4105         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4106         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4107         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4108         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4109         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4111 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4113         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4114         Add memory clobber to inline assembly.
4115         (__lll_mutex_trylock): Likewise.
4116         (__lll_mutex_cond_trylock): Likewise.
4118 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4120         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4121         Pass val argument as 6th system call argument in %r7.
4123 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4125         * Makefile (tests): Add tst-cond16.
4126         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4127         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4128         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4129         Add __data.__futex field, reshuffle __data.__clock.
4130         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4131         (__pthread_cond_signal): Increment __futex at the same time as
4132         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4133         address of low 32-bits of __wakeup_seq to futex syscall.
4134         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4135         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4136         releasing internal lock to FUTEX_WAIT.
4137         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4138         (__pthread_cond_timedwait): Likewise.
4139         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4140         (FUTEX_CMP_REQUEUE): Define.
4141         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4142         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4143         Pass __futex value from before the unlock and __futex address instead
4144         of address of low 32-bits of __wakeup_seq to futex syscall.
4145         Fallback to FUTEX_WAKE all on any errors.
4146         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4147         Define.
4148         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4149         internally.  Return non-zero if error, zero if success.
4150         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4151         Add __data.__futex field, reshuffle __data.__clock.
4152         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4153         Define.
4154         (lll_futex_requeue): Add val argument, return 1 unconditionally
4155         for the time being.
4156         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4157         Add __data.__futex field, reshuffle __data.__clock.
4158         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4159         Define.
4160         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4161         internally.  Return non-zero if error, zero if success.
4162         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4163         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4164         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4165         Define.
4166         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4167         internally.  Return non-zero if error, zero if success.
4168         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4169         Add __data.__futex field, reshuffle __data.__clock.
4170         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4171         Define.
4172         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4173         internally.  Return non-zero if error, zero if success.
4174         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4175         Add __data.__futex field, reshuffle __data.__clock.
4176         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4177         Add __data.__futex field, reshuffle __data.__clock.
4178         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4179         Increment __futex at the same time as __wakeup_seq or __total_seq.
4180         Pass address of __futex instead of address of low 32-bits of
4181         __wakeup_seq to futex syscall.
4182         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4183         Pass __futex value from before releasing internal lock
4184         to FUTEX_WAIT.
4185         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4186         Likewise.  Avoid unnecessary shadowing of variables.
4187         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4188         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4189         unlock and __futex address instead of address of low 32-bits of
4190         __wakeup_seq to futex_requeue macro, adjust for new return value
4191         meaning.
4192         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4193         (__pthread_cond_signal): Increment __futex at the same time as
4194         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4195         address of low 32-bits of __wakeup_seq to futex syscall.
4196         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4197         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4198         releasing internal lock to FUTEX_WAIT.
4199         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4200         (__pthread_cond_timedwait): Likewise.
4201         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4202         (FUTEX_CMP_REQUEUE): Define.
4203         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4204         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4205         Pass __futex value from before the unlock and __futex address instead
4206         of address of low 32-bits of __wakeup_seq to futex syscall.
4207         Fallback to FUTEX_WAKE all on any errors.
4209 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4211         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4212         Add nop to align the end of critical section.
4213         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4215 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4217         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4218         Add __broadcast_seq field.
4219         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4220         all waiters as woken with woken_seq and bump broadcast counter.
4221         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4222         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4223         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4224         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4226 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4228         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4229         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4230         Reported by Kaz Kojima.
4232 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4234         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4236 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4238         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4239         __broadcast_seq with bc_seq after acquiring internal lock instead of
4240         before it.
4242 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4244         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4245         compilation.
4246         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4247         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4248         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4249         (pthread_cond_t): Add __data.__broadcast_seq field.
4250         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4251         (FRAME_SIZE): Define.
4252         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4253         Comment typo fixes.
4254         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4255         Define.
4256         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4257         typo fixes.
4258         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4259         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4260         fixes.
4262 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4264         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4265         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4266         Add __broadcast_seq field.
4267         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4268         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4269         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4270         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4271         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4272         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4273         all waiters as woken with woken_seq and bump broadcast counter.
4274         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4275         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4276         __broadcast_seq field.
4277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4278         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4279         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4280         * pthread_cond_init.c: Initialize __broadcast_seq field.
4281         * Makefile (tests): Add tst-cond17 and tst-cond18.
4282         Add .NOTPARALLEL goal.
4283         * tst-cond16.c: New file.  From Jakub.
4284         * tst-cond17.c: New file.  From Jakub.
4285         * tst-cond18.c: New file.  From Jakub.
4287 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4289         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4290         unwind info.
4292         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4293         Parametrize frame size.  Correct some unwind info.
4294         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4296 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4298         * tst-stack3.c: Note testing functionality beyond POSIX.
4300 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4302         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4303         Change conditional from ifdef to if.
4305 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4307         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4308         SYSDEP_CANCEL_ERROR): Define.
4309         (PSEUDO): Use it.
4311 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4313         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4315 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4317         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4319 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4321         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4322         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4323         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4324         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4326 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4328         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4329         thread has all signals blocked.
4331 2004-04-18  Andreas Jaeger  <aj@suse.de>
4333         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4334         (SEM_VALUE_MAX): Add missing brace.
4336 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4338         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4339         in rt subdir.
4340         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4341         * sysdeps/pthread/tst-mqueue8x.c: New test.
4342         * tst-cancel4.c: Update comment about message queues.
4344         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4345         return it_value { 0, 0 }.
4346         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4347         like SIGEV_SIGNAL.
4348         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4349         assertion for SIGEV_NONE.
4350         (thread_attr_compare): Compare all attributes, not just a partial
4351         subset.
4353 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4355         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4357 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4359         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4360         Just use a plain number.
4361         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4362         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4363         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4364         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4365         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4366         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4367         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4369 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4371         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4372         frame info.
4373         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4375 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4377         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4378         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4379         of calling sigwaitinfo.
4381 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4383         * allocatestack.c (allocate_stack): Set reported_guardsize
4384         unconditionally.
4385         * pthread_getattr_np.c (pthread_getattr_np): Use
4386         reported_guardsize instead of guardsize.
4387         * descr.h (struct pthread): Add reported_guardsize field.
4389 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4391         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4393 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4395         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4397 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4399         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4400         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4401         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4402         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4403         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4404         Define.
4405         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4406         (_POSIX_MESSAGE_PASSING): Define.
4407         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4408         (_POSIX_MESSAGE_PASSING): Define.
4409         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4410         (_POSIX_MESSAGE_PASSING): Define.
4412 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4414         * tst-context1.c (fct): Check whether correct stack is used.
4416 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4418         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4419         matching constraints for asm mem parameters.
4421         * tst-clock2.c (tf): Don't define unless needed.
4423 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4425         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4426         $(gnulib).
4428 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4430         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4431         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4432         * pthreadP.h: Declare __nptl_deallocate_tsd.
4433         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4434         Adjust caller.
4436         * Makefile (tests): Add tst-tsd5.
4437         * tst-tsd5.c: New file.
4439 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4441         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4442         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4443         is SHLIB_COMPAT check.
4444         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4445         (__pthread_attr_getaffinity_old): Likewise.
4446         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4447         (__pthread_getaffinity_old): Likewise.
4448         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4449         (__pthread_setaffinity_old): Likewise.
4451 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4453         * allocatestack.c (_make_stacks_executable): Call
4454         _dl_make_stack_executable first.
4456 2004-03-24  Roland McGrath  <roland@redhat.com>
4458         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4459         constraint instead of "0".
4461 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4463         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4464         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4466         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4467         code to avoid warning.
4469 2004-03-24  Andreas Jaeger  <aj@suse.de>
4471         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4472         (__pthread_attr_setaffinity_old): Remove const.
4474 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4476         * sysdeps/unix/sysv/linux/smp.h: New file.
4477         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4478         * init.c: Define __is_smp.
4479         (__pthread_initialize_minimal_internal): Call is_smp_system to
4480         initialize __is_smp.
4481         * pthreadP.h: Declare __is_smp.
4482         Define MAX_ADAPTIVE_COUNT is necessary.
4483         * pthread_mutex_init.c: Add comment regarding __spins field.
4484         * pthread_mutex_lock.c: Implement adaptive mutex type.
4485         * pthread_mutex_timedlock.c: Likewise.
4486         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4487         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4488         Add __spins field.
4489         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4490         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4491         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4492         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4493         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4494         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4495         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4496         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4497         lll_mutex_cond_trylock.
4498         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4499         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4500         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4501         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4502         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4503         Define BUSY_WAIT_NOP.
4504         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4505         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4507         * tst-mutex5.c: Add support for testing adaptive mutexes.
4508         * tst-mutex7.c: Likewise.
4509         * tst-mutex5a.c: New file.
4510         * tst-mutex7a.c: New file.
4511         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4513         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4514         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4515         vgettimeofday call might destroy the content.
4517         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4518         @pause in the loop.
4520         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4521         No need to restrict type of ret.  Make it int.  Add comment.
4523         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4524         Remove unnecessary setne instruction.
4526 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4528         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4529         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4530         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4531         If realloc fails, break out of the loop.
4533 2004-03-20  Andreas Jaeger  <aj@suse.de>
4535         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4536         (__pthread_setaffinity_old): Fix interface.
4537         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4538         (__pthread_getaffinity_old): Likewise.
4540         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4541         (__pthread_setaffinity_new): Remove duplicate declaration.
4543 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4545         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4546         the return value to a safe register.
4547         (CDISABLE): Set the function argument correctly.
4549 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4551         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4552         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4553         Rewrite so that only one locked memory operation per round is needed.
4554         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4555         (pthread_barrier_wait): After wakeup, release lock only when the
4556         last thread stopped using the barrier object.
4557         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4558         (__pthread_cond_wait): Don't store mutex address if the current
4559         value is ~0l.  Add correct cleanup support and unwind info.
4560         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4561         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4562         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4563         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4564         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4565         Add correct cleanup support and unwind info.
4566         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4567         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4568         information for syscall wrappers.
4570 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4572         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4573         cpusetsize field, remove next.
4574         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4575         parameter for size of the CPU set.
4576         (pthread_setaffinity_np): Likewise.
4577         (pthread_attr_getaffinity_np): Likewise.
4578         (pthread_attr_setaffinity_np): Likewise.
4579         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4580         interface change, keep compatibility code.
4581         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4582         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4583         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4584         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4585         __pthread_getaffinity_np.
4586         * Versions: Add version for changed interfaces.
4587         * tst-attr3.c: Adjust test for interface change.
4588         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4589         increasing buffer sizes.
4590         * pthread_attr_destroy.c: Remove unused list handling.
4591         * pthread_attr_init.c: Likewise.
4593 2004-03-17  Roland McGrath  <roland@redhat.com>
4595         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4596         first argument to clock_getres so we ever enable kernel timers.
4598 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4600         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4602 2004-03-12  Richard Henderson  <rth@redhat.com>
4604         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4605         oldvalue from CENABLE to CDISABLE.
4607 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4609         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4610         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4611         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4612         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4614 2004-03-11  Richard Henderson  <rth@redhat.com>
4616         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4617         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4618         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4620 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4622         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4623         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4624         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4626 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4628         * forward.c (__pthread_cond_broadcast_2_0,
4629         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4630         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4631         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4633 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4635         * sysdeps/sh/tcb-offsets.sym: Add PID.
4636         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4637         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4639 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4641         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4642         include <sysdep-cancel.h>, vfork is no cancellation point.
4643         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4644         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4645         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4647 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4649         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4650         libc_hidden_def.
4651         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4652         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4653         Likewise.
4654         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4655         Likewise.
4656         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4657         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4658         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4659         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4660         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4662         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4663         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4664         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4665         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4666         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4667         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4669         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4670         a local register for saving old PID.  Negate PID in parent upon exit.
4672         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4673         tcb-offsets.h.
4674         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4675         before syscall, set to the old value in the parent afterwards.
4676         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4677         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4678         tcb-offsets.h.
4679         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4680         before syscall, set to the old value in the parent afterwards.
4681         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4682         * sysdeps/s390/tcb-offsets.sym: Add PID.
4684         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4685         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4686         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4687         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4688         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4689         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4691 2004-03-10  Andreas Schwab  <schwab@suse.de>
4693         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4694         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4695         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4697 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4699         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4700         * tst-cancel21.c (do_one_test): Likewise.
4701         Reported by Gordon Jin <gordon.jin@intel.com>.
4703 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4705         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4706         if non-zero and set to INT_MIN if zero.
4707         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4708         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4709         (SAVE_PID, RESTORE_PID): Define.
4710         (__vfork): Use it.
4711         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4712         Use relative path to avoid including NPTL i386/vfork.S.
4713         (SAVE_PID, RESTORE_PID): Define.
4714         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4715         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4716         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4717         tst-vfork2x.
4718         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4719         * tst-vfork1.c: New test.
4720         * tst-vfork2.c: New test.
4721         * tst-vfork1x.c: New test.
4722         * tst-vfork2x.c: New test.
4724 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4726         * sysdeps/i386/tcb-offsets.sym: Add PID.
4727         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4728         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4729         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4731 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4733         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4735 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4737         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4738         _rtld_global_ro.
4740 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4742         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4743         _rtld_global_ro.
4745         * tst-once4.c: Remove unnecessary macro definition.
4747         * tst-mutex7.c (do_test): Limit thread stack size.
4748         * tst-once2.c (do_test): Likewise.
4749         * tst-tls3.c (do_test): Likewise.
4750         * tst-tls1.c (do_test): Likewise.
4751         * tst-signal3.c (do_test): Likewise.
4752         * tst-kill6.c (do_test): Likewise.
4753         * tst-key4.c (do_test): Likewise.
4754         * tst-join4.c (do_test): Likewise.
4755         * tst-fork1.c (do_test): Likewise.
4756         * tst-context1.c (do_test): Likewise.
4757         * tst-cond2.c (do_test): Likewise.
4758         * tst-cond10.c (do_test): Likewise.
4759         * tst-clock2.c (do_test): Likewise.
4760         * tst-cancel10.c (do_test): Likewise.
4761         * tst-basic2.c (do_test): Likewise.
4762         * tst-barrier4.c (do_test): Likewise.
4764 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4766         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4768 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4770         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4771         (__pthread_cond_timedwait): Optimize wakeup test.
4772         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4773         (__pthread_cond_wait): Likewise.
4774         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4775         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4776         Likewise.
4778 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4780         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4781         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4782         the atomic instruction needed.
4783         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4784         (__lll_mutex_lock_wait): Likewise.
4786 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4788         * Makefile (tests): Add tst-cond14 and tst-cond15.
4789         * tst-cond14.c: New file.
4790         * tst-cond15.c: New file.
4792 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4794         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4795         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4796         needs to be implemented differently to be useful.
4798 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4800         * pthread_attr_setschedparam.c: Don't test priority against limits
4801         here.  Set ATTR_FLAG_SCHED_SET flag.
4802         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4803         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4804         from parent thread to child.  If attribute is used and scheduling
4805         parameters are not inherited, copy parameters from attribute or
4806         compute them.  Check priority value.
4807         * pthread_getschedparam.c: If the parameters aren't known yet get
4808         them from the kernel.
4809         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4810         ATTR_FLAG_POLICY_SET flag for thread.
4811         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4812         and ATTR_FLAG_POLICY_SET.
4814         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4816         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4817         fail if stack address hasn't been set.  Just return 0.
4819 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4821         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4822         libpthread for the files in this list.
4823         (CFLAGS-tst-unload): Removed.
4824         * tst-unload.c (do_test): Don't use complete path for
4825         LIBPHREAD_SO.
4827         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4828         tst-_res1mod2.
4830 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4832         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4833         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4834         operation per round is needed.
4835         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4836         (__lll_mutex_lock_wait): Likewise.
4838 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4840         * tst-cancel9.c (cleanup): Don't print to stderr.
4842 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4844         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4846 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4848         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4849         (__syscall_error_handler2): Call CDISABLE.
4850         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4851         (__syscall_error_handler2): Call CDISABLE.
4853         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4854         Release lock before the loop, don't reacquire it.
4856         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4858 2004-02-19  Andreas Schwab  <schwab@suse.de>
4860         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4861         Fix last change.
4863 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
4865         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4866         (pthread_barrier_wait): After wakeup, release lock only when the
4867         last thread stopped using the barrier object.
4868         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
4869         (pthread_barrier_wait): Likewise.
4870         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4871         Likewise.
4872         * Makefile (tests): Add tst-barrier4.
4873         * tst-barrier4.c: New file.
4875         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4876         (__pthread_cond_timedwait): Perform timeout test while holding
4877         internal lock to prevent wakeup race.
4878         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4879         * sysdeps/pthread/pthread_cond_timedwait.c
4880         (__pthread_cond_timedwait): Likewise.
4881         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4882         (__pthread_cond_timedwait): Likewise.
4884 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
4886         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
4887         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
4888         * Makefile (tests): Add tst-rwlock13.
4889         * tst-rwlock13.c: New test.
4891 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
4893         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4894         (__condvar_tw_cleanup): Little optimization.
4895         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4897 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
4899         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
4900         libpthread as "lib" parameter to SHLIB_COMPAT.
4901         (__novmx_siglongjmp): Fix typo in function name.
4902         (__novmx_longjmp): Fix typo in function name.
4904 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4906         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
4907         __builtin_expect.
4909         * sysdeps/generic/pt-longjmp.c: Moved to...
4910         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
4912 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
4914         * Makefile (libpthread-routines): Add pt-cleanup.
4915         * pt-longjmp.c: Removed.
4916         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
4917         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
4918         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
4919         Version longjmp, siglongjmp for GLIBC_2.3.4.
4920         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
4922 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4924         * sysdeps/pthread/pthread_cond_timedwait.c
4925         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
4926         Reuse code.  Add __builtin_expects.
4928         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4929         (__pthread_cond_timedwait): Get internal lock in case timeout has
4930         passed before the futex syscall.
4931         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4933 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
4935         * allocatestack.c: Pretty printing.
4937         * sysdeps/pthread/createthread.c (create_thread): Don't add
4938         CLONE_DETACHED bit if it is not necessary.
4940 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
4942         * pthread_getattr_np.c: Include ldsodefs.h.
4944 2004-01-16  Richard Henderson  <rth@redhat.com>
4946         * allocatestack.c: Don't declare __libc_stack_end.
4947         * init.c (__pthread_initialize_minimal_internal): Likewise.
4948         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
4950 2004-01-15  Richard Henderson  <rth@redhat.com>
4952         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
4953         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
4954         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
4955         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
4956         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
4957         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
4958         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
4959         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
4961 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
4963         * init.c (pthread_functions): Make array const.
4965 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
4967         * allocatestack.c (__make_stacks_executable): Change interface.
4968         Check parameters.  Pass parameter on to libc counterpart.
4969         * pthreadP.h: Change declaration.
4971 2004-01-13  Richard Henderson  <rth@redhat.com>
4973         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
4974         prototype form.
4975         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
4976         Likewise.
4978         * sysdeps/alpha/Makefile: New file.
4979         * sysdeps/alpha/tcb-offsets.sym: New file.
4980         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4981         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
4983         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
4984         on powerpc version.
4986 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
4988         * Makefile (tests): Add tst-backtrace1.
4989         * tst-backtrace1.c: New test.
4991 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
4993         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
4994         register as second parameter to the REGISTER macro.
4995         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
4996         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
4997         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
4998         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
4999         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5000         of thread register as second parameter to REGISTER macro in 64 case.
5002 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5004         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5005         (CFLAGS-getpid.o): Defined.
5006         (CFLAGS-getpid.os): Defined.
5008 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5010         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5011         returned for main thread does not overlap with any other VMA.
5012         Patch by Jakub Jelinek.
5014 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5016         * tst-raise1.c: Include stdio.h.
5018 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5020         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5021         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5022         If pid is 0, set it to selftid.
5023         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5024         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5025         != 0, return self->tid without doing a syscall.
5026         * descr.h (struct pthread): Move pid field after tid.
5028         * Makefile (tests): Add tst-raise1.
5029         * tst-raise1.c: New file.
5031 2003-12-23  Roland McGrath  <roland@redhat.com>
5033         * tst-oddstacklimit.c: New file.
5034         * Makefile (tests): Add it.
5035         (tst-oddstacklimit-ENV): New variable.
5037         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5038         value up to page size for __default_stacksize.
5040 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5042         * Makefile (tests): Add tst-eintr5.
5043         * tst-eintr5.c: New file.
5045         * eintr.c (eintr_source): Prevent sending signal to self.
5047         * tst-eintr2.c (tf1): Improve error message.
5049 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5051         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5052         * sysdeps/unix/sysv/linux/getpid.c: New file.
5053         * pthread_cancel.c: Add comment explaining use of PID field.
5054         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5055         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5056         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5057         temporarily to signal the field must not be relied on and updated
5058         by getpid().
5059         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5060         temporarily negative.
5061         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5063 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5065         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5066         (eintr_source): If ARG != NULL, use pthread_kill.
5067         * tst-eintr1.c: Adjust for this change.
5068         * tst-eintr2.c: Likewise.
5069         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5070         * tst-eintr3.c: New file.
5071         * tst-eintr4.c: New file.
5073 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5075         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5076         if CANCELSTATE_BITMASK is set.
5077         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5078         Likewise.
5080         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5081         (tests-reverse): Add tst-cancel23.
5082         * tst-cancel22.c: New test.
5083         * tst-cancel23.c: New test.
5085 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5087         * tst-eintr1.c: Better error messages.
5089         * Makefile (tests): Add tst-eintr2.
5090         * tst-eintr2.c: New file.
5092 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5094         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5095         (CFLAGS-tst-cancelx21.c): Set.
5096         * tst-cancel21.c: New test.
5097         * tst-cancelx21.c: New test.
5099         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5100         comparison operand.
5101         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5102         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5103         * pt-longjmp.c: Include jmpbuf-unwind.h.
5104         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5105         _JMPBUF_UNWINDS.  Adjust compared pointers.
5106         * init.c (__pthread_initialize_minimal_internal): Initialize
5107         pd->stackblock_size.
5108         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5109         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5110         * sysdeps/i386/jmpbuf-unwind.h: New file.
5111         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5112         * sysdeps/s390/jmpbuf-unwind.h: New file.
5113         * sysdeps/sh/jmpbuf-unwind.h: New file.
5114         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5115         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5116         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5117         (_JMPBUF_CFA_UNWINDS): Remove.
5118         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5120 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5122         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5123         (CFLAGS-tst-cancelx20.c): Set.
5124         * tst-cancel20.c: New test.
5125         * tst-cancelx20.c: New test.
5127 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5129         * init.c (__pthread_initialize_minimal_internal): Don't treat
5130         architectures with separate register stack special here when
5131         computing default stack size.
5133 2003-12-17  Roland McGrath  <roland@redhat.com>
5135         * Makefile (tst-cancelx7-ARGS): New variable.
5136         Reportd by Greg Schafer <gschafer@zip.com.au>.
5138 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5140         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5141         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5142         (tst-stack3-ENV): Set.
5143         ($(objpfx)tst-stack3-mem): New.
5144         * tst-stack3.c: New test.
5146 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5148         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5149         Add unwind directives.  Drop unused .regstk directive.
5150         (_fini_EPILOG_BEGINS): Add unwind directives.
5152 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5154         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5155         Assume parameter is a pointer.
5156         (lll_futex_wake): Likewise.
5157         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5158         Likewise.
5159         (lll_futex_wake): Likewise.
5160         Reported by Boris Hu.
5161         * sysdeps/unix/sysv/linux/unregister-atfork.c
5162         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5164         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5166 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5168         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5169         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5170         __rtld_lock_initialize for ld.so lock.
5171         Patch in part by Adam Li <adam.li@intel.com>.
5173 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5175         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5176         in $(gnulib).  Also, remove stale comment.
5178 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5180         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5181         advantage of new syscall stub and optimize accordingly.
5183         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5184         from SYS_futex, to match expectations of
5185         sysdep.h:DO_INLINE_SYSCALL.
5186         (lll_futex_clobbers): Remove.
5187         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5188         (lll_futex_wake): Likewise.
5189         (lll_futex_requeue): Likewise.
5190         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5191         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5192         Jelinek).
5193         (__lll_mutex_lock): Likewise.
5194         (__lll_mutex_cond_lock): Likewise.
5195         (__lll_mutex_timed_lock): Likewise.
5196         (__lll_mutex_unlock): Likewise.
5197         (__lll_mutex_unlock_force): Likewise.
5199         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5200         comes before the include of <sysdep.h>.
5201         (THREAD_SELF_SYSINFO): New macro.
5202         (THREAD_SYSINFO): Likewise.
5203         (INIT_SYSINFO): New macro.
5204         (TLS_INIT_TP): Call INIT_SYSINFO.
5206         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5208         * sysdeps/pthread/createthread.c (create_thread): Use
5209         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5210         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5211         THREAD_SELF_SYSINFO instead of open code.
5212         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5213         (THREAD_SYSINFO): Likewise.
5215         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5217         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5219 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5221         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5222         instead of .init.  Patch by David Mosberger.
5224 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5226         * sysdeps/pthread/configure.in: Remove broken declaration in C
5227         cleanup handling check.
5229 2003-11-30  Andreas Jaeger  <aj@suse.de>
5231         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5232         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5233         Likewise.
5235 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5237         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5238         * pthread_attr_destroy.c: Include shlib-compat.h.
5239         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5240         is set in iattr->flags.
5241         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5243 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5245         * Makefile (distribute): Add tst-cleanup4aux.c.
5247         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5248         include.
5250 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5252         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5253         pthread_cond_signal.
5255         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5256         store mutex address if the current value is ~0l.
5257         * sysdeps/pthread/pthread_cond_timedwait.c
5258         (__pthread_cond_timedwait): Likewise.
5259         * sysdeps/pthread/pthread_cond_broadcast.c
5260         (__pthread_cond_broadcast): Don't use requeue for pshared
5261         condvars.
5263         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5264         (__pthread_cond_wait): Don't store mutex address if the current
5265         value is ~0l.
5266         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5267         (__pthread_cond_timedwait): Likewise.
5268         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5269         (__pthread_cond_broadcast): Don't use requeue for pshared
5270         condvars.
5272         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5273         element with ~0l for pshared condvars, with NULL otherwise.
5275         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5276         (__pthread_cond_wait): Don't store mutex address if the current
5277         value is ~0l.
5278         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5279         (__pthread_cond_timedwait): Likewise.
5280         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5281         (__pthread_cond_broadcast): Don't use requeue for pshared
5282         condvars.
5284         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5285         * tst-cond12.c: New file.
5286         * tst-cond13.c: New file.
5288 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5290         * sysdeps/pthread/configure.in: Make missing forced unwind support
5291         fatal.
5293 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5295         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5297 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5299         * Makefile: Add magic to clean up correctly.
5301 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5303         * unwind.c (FRAME_LEFT): Define.
5304         (unwind_stop): Handle old style cleanups here.
5305         (__pthread_unwind): Handle old style cleanups only if
5306         !HAVE_FORCED_UNWIND.
5307         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5308         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5309         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5310         ($(objpfx)tst-cleanupx4): Likewise.
5311         * tst-cleanup4.c: New test.
5312         * tst-cleanup4aux.c: New.
5313         * tst-cleanupx4.c: New test.
5315 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5317         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5318         lll_mutex_*lock macros to skip atomic operations on some archs.
5320 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5322         * sysdeps/pthread/tst-timer.c (main): Initialize
5323         sigev2.sigev_value as well.
5325 2003-10-15  Roland McGrath  <roland@redhat.com>
5327         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5328         is missing.
5329         * sysdeps/pthread/configure: Regenerated.
5331 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5333         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5334         locking macros.  No distinction between normal and mutex locking
5335         anymore.
5336         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5337         Merge bits from lowlevelmutex.S we still need.
5338         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5339         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5340         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5341         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5342         new mutex implementation.
5343         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5344         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5345         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5346         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5347         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5348         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5349         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5350         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5351         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5352         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5353         symbol for entry point to avoid cancellation.
5355 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5357         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5358         changes.
5359         (SAVE_OLDTYPE_0): Fix a typo.
5361 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5363         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5364         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5366 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5368         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5369         correct offset.
5371 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5373         * Makefile (tests): Add tst-cancel19.
5374         * tst-cancel19.c: New test.
5376 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5378         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5379         restoring of the old cancellation type.
5381 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5383         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5385 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5387         * sysdeps/pthread/malloc-machine.h: New file
5389 2003-09-24  Roland McGrath  <roland@redhat.com>
5391         * allocatestack.c (__make_stacks_executable): Don't ignore return
5392         value from _dl_make_stack_executable.
5394 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5396         * allocatestack.c (__make_stacks_executable): Also change
5397         permission of the currently unused stacks.
5399         * allocatestack.c (change_stack_perm): Split out from
5400         __make_stacks_executable.
5401         (allocate_stack): If the required permission changed between the time
5402         we started preparing the stack and queueing it, change the permission.
5403         (__make_stacks_executable): Call change_stack_perm.
5405         * Makefile: Build tst-execstack-mod locally.
5406         * tst-execstack-mod.c: New file.
5408 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5410         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5412 2003-09-23  Roland McGrath  <roland@redhat.com>
5414         * tst-execstack.c: New file.
5415         * Makefile (tests): Add it.
5416         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5417         (LDFLAGS-tst-execstack): New variable.
5419         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5420         whether to use PROT_EXEC for stack mmap.
5421         (__make_stacks_executable): New function.
5422         * pthreadP.h: Declare it.
5423         * init.c (__pthread_initialize_minimal_internal): Set
5424         GL(dl_make_stack_executable_hook) to that.
5426 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5428         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5429         recommendation from AMD re avoidance of lock prefix.
5431 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5433         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5434         lll_futex_timed_wait instead of lll_futex_wait.
5435         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5436         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5437         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5438         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5439         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5440         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5441         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5442         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5443         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5444         Completely revamp the locking macros.  No distinction between
5445         normal and mutex locking anymore.
5446         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5447         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5448         __lll_lock_timedwait): Fix prototypes.
5449         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5450         __lll_lock_timedwait): Likewise.
5451         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5452         macros, add __builtin_expect.
5453         (lll_mutex_timedlock): Likewise.  Fix return value.
5454         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5455         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5456         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5457         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5458         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5459         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5460         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5461         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5463 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5465         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5466         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5467         operation if possible.
5469         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5470         like jumping over the lock prefix.
5472 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5474         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5475         locking macros.  No distinction between normal and mutex locking
5476         anymore.
5477         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5478         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5479         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5480         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5481         locking.  Merge bits from lowlevelmutex.S we still need.
5482         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5483         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5484         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5485         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5486         * Makefile (routines): Remove libc-lowlevelmutex.
5487         (libpthread-rountines): Remove lowlevelmutex.
5488         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5489         for new mutex implementation.
5490         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5491         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5492         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5493         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5494         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5495         Likewise.
5496         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5497         Likewise.
5498         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5499         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5500         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5501         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5502         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5503         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5504         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5505         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5506         Likewise.
5507         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5508         Likewise.
5509         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5510         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5512         Don't use requeue.
5513         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5514         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5516 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5518         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5519         in parameters of asm with output parameters.
5521         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5522         type of DECR parameter to int.
5523         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5525 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5527         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5528         guardsize for each thread.
5530 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5532         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5533         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5534         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5536         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5537         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5538         NULL.
5539         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5540         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5541         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5542         (pthread_getaffinity_np): Add hidden_def.
5544         * Makefile (tests): Add tst-attr3.
5545         * tst-attr3.c: New test.
5547         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5549 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5551         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5552         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5554 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5556         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5557         * tst-align.c: Include tst-stack-align.h.
5558         (tf, do_test): Use TEST_STACK_ALIGN macro.
5560 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5562         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5563         variable.
5565 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5567         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5568         stack-related values for the initial thread.
5570 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5572         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5574 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5576         * pthread_mutex_lock.c: Minor code rearrangements.
5578 2003-09-05  Roland McGrath  <roland@redhat.com>
5580         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5581         Instead, include ../nptl_db/db_info.c to do its magic.
5582         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5583         (__pthread_pthread_key_2ndlevel_size): Likewise.
5584         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5585         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5586         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5587         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5588         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5589         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5590         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5591         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5592         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5593         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5594         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5595         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5596         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5597         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5598         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5599         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5600         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5602 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5604         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5605         of pthread_t to be compatible with LT.
5606         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5607         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5608         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5609         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5610         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5611         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5612         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5614 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5616         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5618 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5620         * unwind-forcedunwind.c: Move to...
5621         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5622         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5623         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5624         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5625         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5626         * unwind.c: Include jmpbuf-unwind.h.
5627         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5629 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5631         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5632         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5633         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5634         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5635         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5636         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5637         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5638         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5639         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5640         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5641         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5642         function.
5643         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5644         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5645         * Makefile (tests): Add tst-stack2.
5646         * tst-stack2.c: New test.
5647         * tst-stack1.c: Include limits.h and sys/param.h.
5648         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5650         * pthread_condattr_setpshared.c: Include errno.h.
5651         (pthread_condattr_setpshared): Return EINVAL if pshared
5652         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5654         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5655         defined symbol for entry point to avoid cancellation.
5656         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5657         Likewise.
5658         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5659         Likewise.
5660         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5661         Likewise.
5662         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5663         Likewise.
5664         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5665         Likewise.
5666         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5667         __close_nocancel, __read_nocancel, __write_nocancel,
5668         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5669         libpthread.so or librt.so, define to corresponding function
5670         without _nocancel suffix.
5671         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5672         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5673         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5675         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5677 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5679         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5680         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5682         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5683         in subsections has a symbol associated with it.
5685         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5686         defined symbol for entry point to avoid cancellation.
5687         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5689 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5691         * Makefile (tests): Add tst-tls5.
5692         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5693         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5694         ($(objpfx)tst-tls5): New.
5695         ($(objpfx)tst-tls6.out): Likewise.
5696         (tests): Depend on $(objpfx)tst-tls6.out.
5697         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5698         (do_test): Check pthread_self () return value alignment.
5699         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5700         (tf): Check pthread_self () return value alignment.
5701         * tst-tls5.c: New test.
5702         * tst-tls5.h: New.
5703         * tst-tls5mod.c: New.
5704         * tst-tls5moda.c: New.
5705         * tst-tls5modb.c: New.
5706         * tst-tls5modc.c: New.
5707         * tst-tls5modd.c: New.
5708         * tst-tls5mode.c: New.
5709         * tst-tls5modf.c: New.
5710         * tst-tls6.sh: New test.
5712         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5713         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5714         * init.c (pthread_functions): Initialize them.
5715         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5716         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5717         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5718         pthread_cond_timedwait@@GLIBC_2.3.2.
5720 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5722         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5723         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5724         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5725         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5726         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5727         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5729         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5731         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5732         _POSIX_THREAD_PRIORITY_SCHEDULING.
5733         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5735 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5737         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5738         nested function, use static inline function from libio.h.
5739         Code by Richard Henderson.
5741         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5742         weak.
5744 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5746         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5747         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5748         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5749         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5750         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5751         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5752         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5753         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5754         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5755         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5756         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5757         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5758         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5759         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5760         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5761         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5762         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5763         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5764         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5765         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5766         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5767         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5768         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5769         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5770         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5771         * sysdeps/sparc/tls.h: New file.
5772         * sysdeps/sparc/tcb-offsets.sym: New file.
5773         * sysdeps/sparc/Makefile: New file.
5774         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5775         * init.c [__sparc__] (__NR_set_tid_address): Define.
5777 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5779         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5780         _IO_release_lock): Define.
5782 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5784         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5785         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5787 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5789         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5790         (__pthread_cleanup_class): Add missing return types of member
5791         functions.
5793 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5795         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5796         (lll_mutex_unlock_force): Add memory barrier between store and futex
5797         syscall.
5799 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5801         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5802         tempmsg in first loop.
5804 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5806         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5807         _POSIX_THREAD_PRIORITY_SCHEDULING.
5808         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5810 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5812         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5813         (__rtld_lock_default_lock_recursive,
5814         __rtld_lock_default_unlock_recursive): Define.
5815         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5816         __rtld_lock_unlock_recursive): Define using
5817         GL(_dl_rtld_*lock_recursive).
5818         * init.c (__pthread_initialize_minimal_internal): Initialize
5819         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5820         Lock GL(_dl_load_lock) the same number of times as
5821         GL(_dl_load_lock) using non-mt implementation was nested.
5823         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5824         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5826 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5828         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5829         PIPE_BUF.
5831 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5833         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5835 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5837         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5838         to first syscall error check.  Move syscall error check for tkill
5839         into __ASSUME_CLONE_STOPPED #ifdef.
5841 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5843         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5844         is not defined, do explicit synchronization.
5845         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5846         is not defined also unlock pd->lock for non-debugging case in case
5847         it is necessary.
5848         * pthread_create.c (start_thread): Always get and release pd->lock
5849         if __ASSUME_CLONE_STOPPED is not defined.
5850         (start_thread_debug): Removed.  Adjust users.
5851         * allocatestack.c (allocate_stack): Always initialize lock if
5852         __ASSUME_CLONE_STOPPED is not defined.
5853         * Makefile (tests): Add tst-sched1.
5854         * tst-sched1.c: New file.
5856         * sysdeps/pthread/createthread.c (do_clone): Only use
5857         sched_setschduler and pass correct parameters.
5859 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5861         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
5862         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
5863         PTHREAD_STACK_MIN in comments.
5865 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5867         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5868         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
5869         argument.
5870         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
5871         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
5872         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
5873         (__pthread_cleanup_upto): Fix prototype.
5874         (_longjmp_unwind): Adjust caller.
5875         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
5876         Change second argument to const struct pointer.
5877         * tst-sem8.c (main): Remove unused s2 and s3 variables.
5878         * tst-sem9.c (main): Likewise.
5879         * unwind.c: Include string.h for strlen prototype.
5881 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
5883         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5884         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
5885         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
5886         Define HAVE_CMOV.
5887         Patch by Nicholas Miell <nmiell@attbi.com>.
5889 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
5891         * init.c (__pthread_initialize_minimal_internal): Initialize
5892         GL(dl_init_static_tls).
5893         * pthreadP.h (__pthread_init_static_tls): New prototype.
5894         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
5895         New functions.
5896         * Makefile (tests): Add tst-tls4.
5897         (modules-names): Add tst-tls4moda and tst-tls4modb.
5898         ($(objpfx)tst-tls4): Link against libdl and libpthread.
5899         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
5900         tst-tls4modb.so.
5901         * tst-tls4.c: New file.
5902         * tst-tls4moda.c: New file.
5903         * tst-tls4modb.c: New file.
5905 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
5907         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
5908         before __timer_dealloc.
5909         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
5910         Don't call list_unlink.
5912 2003-07-29  Roland McGrath  <roland@redhat.com>
5914         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
5916 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
5918         * tst-cancel17.c (do_test): Check if aio_cancel failed.
5919         Don't reuse struct aiocb A if it failed.
5920         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
5921         not just one byte, as that does not block.
5923 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
5925         * sysdeps/pthread/unwind-resume.c: New file.
5926         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
5927         unwind-resume in csu subdir.
5928         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
5929         exceptions.
5930         (librt-sysdep_routines, librt-shared-only-routines): Add
5931         rt-unwind-resume.
5932         * sysdeps/pthread/rt-unwind-resume.c: New file.
5933         * unwind-forcedunwind.c: New file.
5934         * Makefile (libpthread-routines): Add unwind-forcedunwind.
5935         (libpthread-shared-only-routines): Likewise.
5936         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
5937         * pthreadP.h (pthread_cancel_init): New prototype.
5938         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
5940         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
5941         attr argument const struct pthread_attr *.
5943         * res.c (__res_state): Return __resp.
5944         * descr.h: Include resolv.h.
5945         (struct pthread): Add res field.
5946         * pthread_create.c: Include resolv.h.
5947         (start_thread): Initialize __resp.
5948         * Makefile (tests): Add tst-_res1.
5949         (module-names): Add tst-_res1mod1, tst-_res1mod2.
5950         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
5951         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
5952         libpthread.
5953         * tst-_res1.c: New file.
5954         * tst-_res1mod1.c: New file.
5955         * tst-_res1mod2.c: New file.
5957 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
5959         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
5961         * Makefile: Define various *-no-z-defs variables for test DSOs
5962         which has undefined symbols.
5964 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
5966         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
5967         Retry if the stwcx fails to store once_control.
5969 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
5971         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
5972         pthread_attr_setaffinity.
5973         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
5974         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
5975         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
5976         * pthread_attr_destroy.c: Free cpuset element if allocated.
5977         * pthread_create.c: Pass iattr as additional parameter to
5978         create_thread.
5979         * sysdeps/pthread/createthread.c: If attribute is provided and
5980         a new thread is created with affinity set or scheduling parameters,
5981         start thread with CLONE_STOPPED.
5982         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
5983         pthread_attr_setaffinity.
5984         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5985         cpuset element.
5987 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
5989         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
5991 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
5993         * sysdeps/pthread/configure.in: Require CFI directives also for
5994         ppc and s390.
5996 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
5998         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5999         Add cfi directives.
6001 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6003         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6004         CLEANUP_JMP_BUF.
6005         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6006         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6007         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6008         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6009         not self pointer in __writer.  Compare with TID to determine
6010         deadlocks.
6011         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6012         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6013         Likewise.
6014         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6015         Likewise.
6016         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6017         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6018         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6019         macros also when compiling librt.
6021 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6023         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6024         -fasynchronous-unwind-tables.
6025         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6026         (PSEUDO): Add cfi directives.
6027         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6028         Likewise.
6029         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6030         Likewise.
6032 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6034         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6035         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6036         * unwind.c (__pthread_unwind_next): Add hidden_def.
6037         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6038         Likewise.
6039         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6040         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6041         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6042         Likewise.
6043         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6044         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6045         Likewise.
6046         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6047         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6048         __pthread_unregister_cancel and __pthread_unwind_next.
6050 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6052         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6053         different symbol for the cancellation syscall wrapper and
6054         non-cancellation syscall wrapper.
6055         (PSEUDO_END): Define.
6057 2003-07-05  Richard Henderson  <rth@redhat.com>
6059         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6060         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6061         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6062         return actual return value from the syscall, not 0.
6064 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6066         * descr.h (struct pthread): Add pid field.
6067         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6068         (__reclaim_stacks): Likewise.
6069         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6070         also check for PID of the signal source.
6071         (__pthread_initialize_minimal_internal): Also initialize pid field
6072         of initial thread's descriptor.
6073         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6074         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6075         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6076         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6077         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6079 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6081         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6082         Fix use of parameter.
6083         (__libc_cleanup_pop): Likewise.
6085 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6087         * init.c (sigcancel_handler): Change parameters to match handler
6088         for SA_SIGACTION.  Check signal number and code to recognize
6089         invalid invocations.
6091 2003-07-03  Roland McGrath  <roland@redhat.com>
6093         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6094         Apply sizeof (struct pthread) bias to r13 value.
6096 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6098         * sysdeps/pthread/configure.in: Require CFI directives.
6100         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6101         definition.
6102         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6103         libpthread compilation.
6104         * unwind.c (__pthread_unwind): Add hidden_def.
6105         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6107 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6109         * libc-cancellation.c (__libc_cleanup_routine): Define.
6110         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6111         (__pthread_cleanup_pop): Define.
6113 2003-07-01  Richard Henderson  <rth@redhat.com>
6115         * sysdeps/alpha/elf/pt-initfini.c: New file.
6116         * sysdeps/alpha/pthread_spin_lock.S: New file.
6117         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6118         * sysdeps/alpha/pthreaddef.h: New file.
6119         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6120         * sysdeps/alpha/tls.h: New file.
6121         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6122         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6123         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6124         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6125         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6126         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6127         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6128         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6129         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6130         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6132 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6134         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6135         cleanup support and unwind info.
6137 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6139         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6140         Use correct cleanup handler registration.  Add unwind info.
6141         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6142         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6143         * tst-once3.c: Add cleanup handler and check it is called.
6144         * tst-once4.c: Likewise.
6145         * tst-oncex3.c: New file.
6146         * tst-oncex4.c: New file.
6147         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6149 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6151         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6153 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6155         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6156         (tf_msgsnd): Likewise.
6158         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6159         premature returns a bit more.
6161 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6163         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6164         definition to the front.
6166         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6167         the cleanup functions to make the names unique.  Fix dwarf opcode
6168         un unwind table.
6169         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6170         functions to make the names unique.  Fix CFA offset for two blocks.
6172 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6174         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6175         missing closing braces.
6176         Patch by Christophe Saout <christophe@saout.de>.
6178 2003-06-24  Roland McGrath  <roland@redhat.com>
6180         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6182 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6184         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6185         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6187         * pthreadP.h: Declare __find_thread_by_id.
6188         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6189         * pthread_clock_gettime.c: Allow using other thread's clock.
6190         * pthread_clock_settime.c: Likewise.
6191         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6192         * Makefile: Add rules to build and run tst-clock2.
6193         * tst-clock2.c: New file.
6195 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6197         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6198         to use exception-based cleanup handler.
6199         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6201         * tst-cond8.c (ch): Announce that we are done.
6203         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6205         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6206         Also test aio_suspend with timeout value.
6208 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6210         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6211         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6212         attribute_hidden.
6214         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6215         (__pthread_mutex_lock_internal): Likewise.
6216         (__pthread_mutex_unlock_internal): Likewise.
6217         (__pthread_mutex_unlock_usercnt): Declare.
6218         * pthread_mutex_destroy.c: Always fail if used in any way.
6219         * pthread_mutex_init.c: Update comment.
6220         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6221         * pthread_mutex_timedlock.c: Adjust __nusers.
6222         * pthread_mutex_trylock.c: Adjust __nusers.
6223         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6224         and public interfaces are wrapper with pass additional parameter.
6225         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6226         parameter zero.
6227         * tst-mutex8.c: New file.
6228         * Makefile (tests): Add tst-mutex8.
6229         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6230         __pthread_mutex_unlock_usercnt.
6231         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6232         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6233         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6234         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6235         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6236         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6237         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6238         Add __nusers.
6239         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6240         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6241         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6242         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6243         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6245         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6246         * pthread_mutex_timedlock.c: Likewise.
6247         * pthread_mutex_trylock.c: Adjust __nusers.
6248         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6249         * tst-mutex9.c: New file.
6250         * Makefile (tests): Add tst-mutex9.
6251         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6252         * sysdeps/ia64/tls.h: Likewise.
6253         * sysdeps/powerpc/tls.h: Likewise.
6254         * sysdeps/s390/tls.h: Likewise.
6255         * sysdeps/sh/tls.h: Likewise.
6256         * sysdeps/x86_64/tls.h: Likewise.
6257         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6258         Change type of __owner.
6259         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6260         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6261         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6262         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6263         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6265 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6267         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6268         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6270         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6271         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6272         instead of nr to lll_futex_wake.  Only set errno and return -1
6273         if err < 0.
6275         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6276         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6277         return actual return value from the syscall, not 0.
6279 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6281         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6282         find a random value.
6283         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6284         errno==EIDRM.
6286         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6287         compat_timer_settime.
6288         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6289         compat_timer_gettime.
6290         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6291         compat_timer_getoverrun.
6292         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6293         compat_timer_delete.
6295         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6296         error-checking mutex detect busy mutexes.
6298 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6300         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6301         Add ax to clobber list.
6302         (lll_mutex_cond_lock): Likewise.
6303         (lll_mutex_unlock): Likewise.
6304         (lll_lock): Likewise.
6305         (lll_unlock): Likewise.
6307         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6308         * tst-cancel18.c: New file.
6309         * tst-cancelx18.c: New file.
6311         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6312         and tcdrain.
6314         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6315         * tst-cancel17.c: New file.
6316         * tst-cancelx17.c: New file.
6318         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6319         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6320         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6322         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6324 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6326         * sysdeps/pthread/createthread.c (create_thread): Set
6327         header.multiple_threads unconditionally.
6328         * allocatestack.c (allocate_stack): Likewise.
6329         * descr.h (struct pthread): Add header.multiple_threads
6330         unconditionally.
6331         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6332         Define for librt.  #error if neither libpthread, libc nor librt.
6333         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6334         Likewise.
6335         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6336         CDISABLE): Likewise.
6337         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6338         CDISABLE): Likewise.
6339         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6340         CDISABLE): Likewise.
6341         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6342         CDISABLE): Likewise.  Access header.multiple_threads outside of
6343         libc and libpthread.
6344         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6345         Likewise.
6346         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6347         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6349 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6351         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6352         Also test early cancellation before the thread reaches the cancellation
6353         point.
6355         * Makefile: Compile forward.c with exceptions.
6357         * sysdeps/unix/sysv/linux/sleep.c: New file.
6359 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6361         * Makefile: Add CFLAGS definition to compile function wrappers
6362         duplicated from libc with exceptions.
6363         * tst-cancel4.c: Also check cancellation handlers.
6365         * Makefile: Add rules to build and run tst-cancel16 and
6366         tst-cancelx16.  Add missing CFLAGS definitions.
6367         * tst-cancel16.c: New file.
6368         * tst-cancelx16.c: New file.
6370 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6372         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6373         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6374         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6375         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6377         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6378         (LIBC_CANCEL_RESET): Likewise.
6379         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6380         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6381         librt-cancellation.
6382         (CFLAGS-libcrt-cancellation.c): Define.
6383         * sysdeps/pthread/librt-cancellation.c: New file.
6384         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6385         macros also when compiling librt.
6386         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6387         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6388         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6389         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6390         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6391         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6392         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6394         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6395         compat_timer_create.
6397 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6399         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6401         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6402         __register_atfork.
6403         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6404         Add libc_hidden_def.
6406 2003-06-13  Roland McGrath  <roland@redhat.com>
6408         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6409         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6411 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6413         * allocatestack.c (queue_stack): Always inline.
6414         * ptreadhP.h (__do_cancel): Likewise.
6416 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6418         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6419         a typo.
6421 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6423         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6424         (__pthread_cond_signal): Remove incorrect second addition for
6425         cond_lock!=0.
6427 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6429         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6430         (__pthread_cond_signal): Use correct futex pointer in
6431         __lll_mutex_lock_wait call.
6433         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6434         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6436 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6438         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6439         cancelable.
6440         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6441         Likewise.
6443         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6444         hand-written CFI generation code.  Since ENTRY/END also initiated
6445         CFI frames this caused two CFI sets to be generated.
6447 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6449         * cleanup_routine.c: New file.
6450         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6451         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6452         cleanup handling.
6453         * Makefile (libpthread-routines): Add cleanup_routine.
6454         Add more CFLAGS variables to compile with exceptions.  Add comments
6455         why which file needs unwind tables.
6456         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6457         tests.
6458         * tst-cancelx1.c: New file.
6459         * tst-cancelx2.c: New file.
6460         * tst-cancelx3.c: New file.
6461         * tst-cancelx4.c: New file.
6462         * tst-cancelx5.c: New file.
6463         * tst-cancelx6.c: New file.
6464         * tst-cancelx7.c: New file.
6465         * tst-cancelx8.c: New file.
6466         * tst-cancelx9.c: New file.
6467         * tst-cancelx10.c: New file.
6468         * tst-cancelx11.c: New file.
6469         * tst-cancelx12.c: New file.
6470         * tst-cancelx13.c: New file.
6471         * tst-cancelx14.c: New file.
6472         * tst-cancelx15.c: New file.
6473         * tst-cleanupx0.c: New file.
6474         * tst-cleanupx0.expect: New file.
6475         * tst-cleanupx1.c: New file.
6476         * tst-cleanupx2.c: New file.
6477         * tst-cleanupx3.c: New file.
6479         * tst-cleanup0.c: Make standard compliant.
6480         * tst-cleanup1.c: Likewise.
6482         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6483         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6484         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6485         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6486         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6487         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6488         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6489         CLEANUP_JMP_BUF.
6490         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6491         * tst-cancel12.c: New file.
6492         * tst-cancel13.c: New file.
6493         * tst-cancel14.c: New file.
6494         * tst-cancel15.c: New file.
6495         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6496         and tst-cancel15.
6498         * tst-cancel1.c: Add some comments.
6500         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6501         timeout correctly.
6503 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6505         * Makefile (CFLAGS-pthread_cancel.c): Define.
6507 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6509         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6510         Change type of __writer element to int.
6511         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6512         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6513         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6514         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6515         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6516         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6517         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6518         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6519         Compare with TID to determine deadlocks.
6520         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6521         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6522         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6523         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6524         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6525         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6526         Likewise.
6527         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6528         Likewise.
6529         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6530         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6531         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6532         Likewise.
6533         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6534         Likewise.
6535         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6536         * Makefile (tests): Add tst-rwlock12.
6537         * tst-rwlock12.c: New file.
6539 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6541         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6542         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6543         Remove bogus hidden_proto.
6544         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6545         Likewise.
6546         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6547         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6548         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6549         ___lll_mutex_timedlock): Likewise.
6551 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6554         (__pthread_cond_signal): Add some code to eventually handle
6555         cond_lock!=0.
6557 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6559         * Makefile (tests): Add tst-exec4.
6560         (tst-exec4-ARGS): Define.
6561         * tst-exec4.c: New file.
6563 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6565         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6566         Also fail if tv_nsec < 0.
6567         (__lll_timedwait_tid): Likewise.
6568         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6569         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6570         Likewise.
6571         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6572         Likewise.
6573         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6574         Likewise.
6575         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6576         Likewise.
6577         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6578         Likewise.
6579         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6580         Likewise.
6582         * Makefile (tests): Add tst-sem8 and tst-sem9.
6583         * tst-sem8.c: New file.
6584         * tst-sem9.c: New file.
6585         * sem_open.c: Fix creation of in_use record if the file exists but
6586         no internal record.
6588         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6589         definitions.
6591         * sysdeps/pthread/timer_create.c (timer_create): In case
6592         evp==NULL, assign timer ID to sival_ptr.
6594         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6595         struct pthread_unwind_buf *.
6596         (struct pthread): Likewise for cleanup_jmp_buf element.
6598         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6599         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6600         * unwind.c (__pthread_unwind_next): Likewise.
6602 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6604         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6605         (lll_futex_timed_wait): Use int for futex value parameter.
6606         (lll_futex_wake): Likewise.
6607         (lll_futex_requeue): Likewise.
6609         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6610         Replace one memory operation with one register operation.
6612         * tst-join4.c (do_test): Fix error message.
6614         * tst-rwlock6.c (do_test): Use correct format specifier.
6616         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6617         (__lll_mutex_lock_wait): Replace one memory operation with one
6618         register operation.
6619         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6620         (__lll_mutex_lock_wait): Likewise.
6622         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6623         (__lll_mutex_cond_lock): Add one to value parameter of
6624         __lll_lock_wait to reflect reality in the futex syscall.
6625         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6626         (lll_mutex_cond_lock): Likewise.
6628 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6630         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6631         New function.
6632         (lll_mutex_cond_lock): Define.
6634 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6636         * Makefile (tests): Add tst-signal6.
6637         * tst-signal6.c: New file.
6639         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6640         (__lll_mutex_unlock_force): New function
6641         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6643         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6644         (__lll_mutex_unlock_force): New function.
6645         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6647         * tst-rwlock7.c (do_test): Use correct format specifier.
6649         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6650         Find break parameter in correct asm argument.
6652 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6654         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6655         Remove out4.
6656         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6657         error occured.
6658         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6659         Add __mutex.
6660         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6661         lll_futex_requeue, lll_mutex_unlock_force): Define.
6663 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6665         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6666         (pthread_cond_t): Add __mutex.
6667         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6668         lll_futex_requeue, lll_mutex_unlock_force): Define.
6670 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6672         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6673         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6674         Add __mutex field.
6675         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6676         Define.
6677         (lll_futex_wait, lll_futex_wake): Define.
6678         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6679         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6680         FUTEX_REQUEUE instead of FUTEX_WAIT.
6681         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6682         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6683         mutex which was used in condvar structure.  Call
6684         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6685         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6687         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6688         include tcb-offsets.h.  Read wakeup value in locked region.
6689         Use the value of gbr register as THREAD_ID.
6690         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6691         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6692         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6694         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6695         macros.
6697 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6699         * sysdeps/pthread/pthread_cond_broadcast.c
6700         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6702 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6704         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6705         typo in register name.
6706         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6707         correctly.  Actually use requeue.  Little optimization.
6708         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6709         mutex address early.  Handle cancellation state as 32-bit value.
6710         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6711         Remove unnecessary label.
6713 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6715         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6716         instead of FUTEX_WAIT.
6717         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6718         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6719         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6720         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6721         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6722         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6723         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6724         of __pthread_mutex_lock_internal.
6725         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6726         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6727         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6728         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6729         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6730         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6731         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6732         Add pthread_mutex_cond_lock.
6733         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6734         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6735         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6736         lll_mutex_cond_lock.
6737         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6738         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6739         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6740         Add __mutex field.
6741         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6742         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6744         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6745         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6747         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6748         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6749         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6750         macro don't define aliases.
6752         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6753         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6754         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6755         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6756         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6757         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6758         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6759         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6760         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6762 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6764         * sem_open.c: Fix one endless loop.  Implement correct semantics
6765         wrt opening the same semaphore more then once.
6766         * sem_close.c: Adjust for sem_open change.
6767         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6768         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6769         * Makefile (tests): Add tst-sem7.
6770         * tst-sem7.c: New file.
6772 2003-05-16  Roland McGrath  <roland@redhat.com>
6774         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6775         uninitialized variable braino.
6777 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6779         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6780         test for syscall availability.
6782         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6783         __no_posix_timers to -1 if the syscalls don't exist.
6785         * pthread_join.c (pthread_join): Set tid field of the joined
6786         thread to -1.  This isn't necessary but helps to recognize some
6787         error conditions with almost no cost.
6789         * allocatestack.c (FREE_P): Also negative values indicate an
6790         unused stack.
6792         * unwind.c: Include <unistd.h>.
6794 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6796         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6798 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6800         * Makefile (crti-objs, crtn-objs): New variables.
6801         (omit-deps, extra-objs): Add crtn.
6802         ($(objpfx)libpthread.so): Depend on both crti and crtn
6803         and links to them in multidir.
6804         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6806 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6808         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6809         (lll_mutex_unlock): Use atomic_exchange_rel.
6811 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6813         * cond-perf.c (cons): Add missing locking around setting of alldone.
6815 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6817         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6818         related macros.
6819         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6821 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6823         * tst-sem6.c: New file.
6824         * Makefile (tests): Add tst-sem6.
6826         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6827         Use atomic_exchange_rel instead of atomic_exchange.
6828         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6829         Likewise.
6831         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6832         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6833         vsyscall is possible.
6835         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6836         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6837         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6838         pthread_setaffinity_np.
6839         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6840         and pthread_setaffinity_np.
6841         * Makefile (libpthread-routines): Add pthread_getaffinity and
6842         pthread_setaffinity.
6844         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6845         use it in case mmap to allocate the stack fails.
6846         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6847         ARCH_MAP_FLAGS here.
6848         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6849         ARCH_RETRY_MMAP.
6851 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6853         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6854         handler implementation.  It is now lockless in fork().
6855         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6856         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6857         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6858         declare the __fork_*_lists.
6859         (struct fork_handler): Include pointers to all three functions.
6860         Add next, refcntr and need_signal elements.
6861         (__fork_handlers): New declaration.
6862         (__register_atfork_malloc): Remove declaration.
6863         (HAVE_register_atfork_malloc): Remove definition.
6864         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
6865         __pthread_child_handler variable.
6866         (__libc_pthread_init): Use __register_atfork instead of explicitly
6867         adding to the list.
6868         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
6869         and lll_futex_wake.
6870         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6872         * unwind.c (unwind_cleanup): Print error message and then abort.  This
6873         function must never be reached.
6875         * cond-perf.c: New file.
6877 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
6879         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
6881 2003-05-04  Roland McGrath  <roland@redhat.com>
6883         * Makefile ($(objpfx)../libc.so): New target.
6885 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
6887         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6888         (pthread_condattr_t): Size is only an int, don't use long for
6889         alignment.
6890         (pthread_mutexattr_t): Likewise.
6891         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6892         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6893         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6895 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
6897         * sysdeps/i386/tls.h: Define THREAD_ID.
6898         * sysdeps/ia64/tls.h: Likewise.
6899         * sysdeps/powerpc/tls.h: Likewise.
6900         * sysdeps/s390/tls.h: Likewise.
6901         * sysdeps/sh/tls.h: Likewise.
6902         * sysdeps/x86_64/tls.h: Likewise.
6903         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
6904         record ownership.
6905         * pthread_mutex_timedlock.c: Likewise.
6906         * pthread_mutex_trylock.c: Likewise.
6907         * pthread_mutex_unlock.c: Likewise.
6908         * pthread_rwlock_trywrlock.c: Likewise.
6909         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
6910         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6911         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6912         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6914         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
6915         flag.
6917 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
6919         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6920         (__SIZEOF_PTHREAD_COND_T): Define to 48.
6921         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
6922         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6923         Make __align long long instead of long.
6924         (pthread_rwlock_t): Formatting.
6925         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
6926         (pthread_rwlock_t): Formatting.
6927         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6928         (pthread_cond_t): Make __align long long instead of long.
6929         (pthread_rwlock_t): Move __flags field to the same position as in
6930         linuxthreads.
6932 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
6934         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
6935         * tst-rwlock7.c (do_test): Likewise.
6937 2003-04-26  Roland McGrath  <roland@redhat.com>
6939         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
6941 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
6943         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
6944         sizeof (struct pthread).
6945         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
6946         1 struct pthread.
6947         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
6948         to 0.
6949         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
6950         struct pthread.
6951         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
6952         to 32-bit bytes.
6953         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
6954         tcbp.
6955         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
6956         unneccessarily.
6957         (NO_TLS_OFFSET): Define.
6958         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
6959         add TLS_TCB_SIZE unnecessarily.
6961 2003-04-22  Roland McGrath  <roland@redhat.com>
6963         * Makeconfig (shared-thread-library): Reverse link order to work
6964         around linker bug.
6966 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
6968         * semaphore.h: Fix typo in comment.
6970 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
6972         * sysdeps/pthread/sigfillset.c: New file.
6974         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
6975         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
6976         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
6977         * sysdeps/pthread/sigaction.c: Likewise.
6978         * sysdeps/pthread/sigprocmask.c: New file.
6979         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
6980         __SIGRTMIN+1.
6981         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
6982         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
6983         in this case.
6985 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
6987         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6988         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
6990         * sysdeps/unix/sysv/linux/unregister-atfork.c
6991         (__unregister_atfork): Don't free memory not allocated dynamically.
6993         * semaphore.h: Remove __THROW marker from cancellation points.
6994         * nptl/sysdeps/pthread/pthread.h: Likewise.
6996 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
6998         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
6999         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7000         __THROW.
7002 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7004         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7006 2003-04-15  Roland McGrath  <roland@redhat.com>
7008         * forward.c (__pthread_unwind): Tweak to avoid warning.
7010 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7012         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7014 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7016         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7017         overflow CFA advance instructions.
7018         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7020 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7022         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7023         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7024         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7025         defined.
7027         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7028         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7029         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7030         DW_CFA_advance_loc for .Laddl-.Lsubl.
7032 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7034         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7035         position-independent unwind data for static libraries.
7036         Add missing unwind info.  Add comments.
7038         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7039         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7040         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7041         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7043 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7045         * Makefile: Make sure all cancellation points are compiled with
7046         exception and asynchronous unwind tables.
7048         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7049         which mishandles loading of global object addresses in PIC.
7050         (THREAD_SETMEM_NC): Likewise.
7052 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7054         * pthread.h: Define new data structure for cleanup buffer.  Declare
7055         new cleanup handler interfaces.
7056         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7057         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7058         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7059         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7060         it.  Declare old cleanup handler installation functions.
7061         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7062         handling.
7063         * cleanup_defer.c: Likewise.
7064         * cleanup_compat.c: New file.  Old cleanup code.
7065         * cleanup_def_compat.c: New file.  Old cleanup code.
7066         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7067         if own thread descriptor.
7068         * unwind.c: New file.
7069         * forward.c: Add __pthread_unwind.
7070         * init.c (pthread_functions): Add __pthread_unwind.
7071         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7072         Add ptr___pthread_unwind.
7073         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7074         and unwind function.
7075         * Makefile (libpthread-routines): Add cleanup_compat,
7076         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7077         table generation if necessary.
7078         * version.c: Record whether unwind support is compiled in.
7079         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7080         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7081         handler interfaces.
7082         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7083         complication to generate unwind information for syscall wrappers.
7084         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7085         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7086         __cleanup_fct_attribute.
7088         * Makefile: Add rules to build and run tst-cleanup0.
7089         * tst-cleanup0.c: New file.
7090         * tst-cleanup0.expect: New file.
7092         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7093         caller.  Optimize to avoid often unecessary local variable.
7095 2003-04-11  Roland McGrath  <roland@redhat.com>
7097         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7098         sets variable `multidir'; include that.
7099         (generated): Add it.
7100         ($(objpfx)$(multidir)/crti.o): New target.
7101         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7103 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7105         * tst-attr2.c (do_test): Add cast to avoid warning.
7106         * tst-mutex4.c (do_test): Likewise.
7108 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7110         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7111         in child.
7113 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7115         * Makefile (tests): Add tst-detach1.
7116         * tst-detach1.c: New file.
7118 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7120         * sysdeps/pthread/pthread.h: Remove duplicate
7121         pthread_cleanup_{push,pop} definitions.
7123         * tst-barrier2.c: Eliminate warnings.
7124         * tst-cancel4.c: Likewise.
7125         * tst-cond4.c: Likewise.
7126         * tst-cond6.c: Likewise.
7127         * tst-detach1.c: Likewise.
7128         * tst-rwlock4.c: Likewise.
7129         * tst-rwlock6.c: Likewise.
7130         * tst-rwlock7.c: Likewise.
7131         * tst-sem3.c: Likewise.
7132         * tst-spin2.c: Likewise.
7133         * tst-umask1.c: Likewise.
7135 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7137         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7139 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7141         * descr.h (struct pthread): Move cancelhandling member to the front.
7143 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7145         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7146         malloc_parent, and malloc_child statically.
7147         (__register_atfork_malloc): New function.
7148         (free_mem): Don't free any of the malloc_* variables on the list.
7149         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7150         Define HAVE_register_atfork_malloc.
7152 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7154         * sysdeps/pthread/createthread.c (create_thread): Add some more
7155         comments explaining when to set multiple_threads and when not.
7157         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7158         THREAD_ATOMIC_BIT_SET if not already defined.
7159         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7160         THREAD_ATOMIC_BIT_SET:
7161         * sysdeps/x86_64/tls.h: Likewise.
7162         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7163         THREAD_ATOMIC_CMPXCHG_VAL.
7164         (_pthread_cleanup_pop_restore): Likewise.
7165         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7166         (__pthread_enable_asynccancel_2): Likewise.
7167         (__pthread_disable_asynccancel): Likewise.
7168         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7169         (__libc_disable_asynccancel): Likewise.
7170         * init.c (sigcancel_handler): Likewise.
7171         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7172         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7174 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7176         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7177         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7178         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7179         * Makefile (tests): Add tst-cancel11.
7180         * tst-cancel11.c: New file.
7182 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7184         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7185         round, not the first.  Use specific_used flag instead of local
7186         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7187         (__free_tcb): Don't call deallocate_tsd here.
7188         (start_thread): Call deallocate_tsd here.
7189         * pthread_setspecific.c: Set specific_used flag really only when
7190         needed.
7191         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7192         * tst-tsd3.c: New file.
7193         * tst-tsd4.c: New file.
7195 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7197         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7198         Use atomic_exchange_and_add instead of __lll_add.
7199         (__lll_mutex_timedlock): Likewise.
7200         Patch by Ian Wienand.
7202 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7204         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7205         (SINGLE_THREAD_P): Fix typo.
7206         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7208 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7210         * Makefile (tests): Add tst-align.
7211         * tst-align.c: New file.
7212         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7214         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7215         function correctly.
7217         * tst-tsd2.c: Add casts to avoid warnings.
7219 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7221         * descr.h (struct pthread): Move most often used elements to the front.
7223 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7225         * Makefile (libpthread-routines): Add pthread_atfork.
7226         (libpthread-static-only-routines): Add pthread_atfork.
7228 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7230         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7231         of TLS_DTV_AT_TP.
7232         (INSTALL_DTV): Add parens.
7233         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7234         Use passed descr instead of THREAD_SELF.
7235         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7236         (__lll_mutex_timedlock_wait): Correct expected value after
7237         spurious wakeup.
7238         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7239         Release lock before waking up the waiters.
7240         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7241         criteria.  Reorderstruct passed to cleanup handler.  Fix
7242         handling of cancellation and failung pthread_mutex_unlock call.
7243         Use __pthread_enable_asynccancel_2 instead of
7244         __pthread_enable_asynccancel.
7245         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7246         Return result of lock re-get if it fails.
7247         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7248         for __pthread_cleanup_push.
7249         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7250         completely broken rwlock implementation.
7251         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7252         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7253         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7254         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7256         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7257         versioned_symbol macro.
7258         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7259         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7261 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7263         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7264         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7265         and __helper_tid.
7266         (struct timer): Remove th and bar field.
7267         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7268         debugging code.  Create only one helper thread.
7269         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7270         helper thread.
7271         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7272         Renamed.  Define statically.  Use thread info from siginfo.
7273         (__helper_once): New variable.
7274         (__helper_tid): New variable.
7275         (__reset_helper_control): New function.
7276         (__start_helper_thread): New function.
7278         * pthread_create.c (start_thread): Don't use setjmp inside
7279         __builtin_expect to work around gcc bug.
7281         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7282         timer_delete syscall fails, but not with ENOSYS, set
7283         __no_posix_timers.
7285         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7286         (timer_settime): Fix typo.
7287         * sysdeps/unix/sysv/linux/timer_getoverr.c
7288         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7290 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7292         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7293         offset of cleanupbuf.__prev.
7295 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7297         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7298         of included file.
7300 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7302         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7303         NULL provide default definition to syscall.
7305 2003-03-25  Roland McGrath  <roland@redhat.com>
7307         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7308         (timer_id2ptr): Fix typo.
7310 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7312         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7313         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7314         * sysdeps/ia64/pthreaddef.h: Likewise.
7315         * sysdeps/powerpc/pthreaddef.h: Likewise.
7316         * sysdeps/s390/pthreaddef.h: Likewise.
7317         * sysdeps/sh/pthreaddef.h: Likewise.
7318         * sysdeps/x86_64/pthreaddef.h: Likewise.
7319         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7320         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7321         being changed.
7322         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7323         SIGTIMER is not unblocked.
7324         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7325         RT signal taken.
7326         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7327         be send.
7328         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7329         pass pointer through as ID.
7330         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7331         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7332         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7333         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7334         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7335         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7336         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7337         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7338         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7339         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7340         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7341         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7342         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7343         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7344         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7345         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7346         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7347         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7348         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7349         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7350         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7351         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7352         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7353         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7354         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7355         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7356         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7357         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7358         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7359         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7360         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7361         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7362         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7364         * pthreadP.h: Remove FRAME_LEFT definition.
7365         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7366         already left frame.  Programs which have this problem are not POSIX
7367         compliant.
7368         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7370 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7372         * sysdeps/pthread/tst-timer.c: Check return values of the
7373         functions we test.
7375 2003-03-23  Roland McGrath  <roland@redhat.com>
7377         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7378         * tst-tls3mod.c: Likewise.
7379         * tst-tls1.c: Likewise.
7380         * tst-tls2.c: Likewise.
7382         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7383         undefined behavior.
7385         * tst-join5.c (tf1, tf2): Add a cast.
7387         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7389         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7390         Don't test anything.
7391         * tst-cond4.c: Likewise.
7392         * tst-cond6.c: Likewise.
7393         * tst-flock2.c: Likewise.
7394         * tst-mutex4.c: Likewise.
7395         * tst-rwlock4.c: Likewise.
7396         * tst-signal1.c: Likewise.
7397         * tst-spin2.c: Likewise.
7398         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7400         * tst-mutex4.c: Use test-skeleton.c.
7401         * tst-spin2.c: Likewise.
7402         * tst-sysconf.c: Likewise.
7403         * tst-barrier2.c: Likewise.
7404         * tst-cond4.c: Likewise.
7405         * tst-cond6.c: Likewise.
7406         * tst-rwlock4.c: Likewise.
7407         * tst-unload.c: Likewise.
7408         * tst-flock2.c (do_test): Use return instead of exit.
7410 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7412         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7414 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7416         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7417         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7418         instead of __lll_compare_and_swap.
7419         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7420         Likewise.
7421         Removed definition if __lll_compare_and_swap.
7423         * cancellation.c: Adjust for new form of compare&exchange macros.
7424         * cleanup_defer.c: Likewise.
7425         * init.c: Likewise.
7426         * libc-cancellation.c: Likewise.
7427         * old_pthread_cond_broadcast.c: Likewise.
7428         * old_pthread_cond_signal.c: Likewise.
7429         * old_pthread_cond_timedwait.c: Likewise.
7430         * old_pthread_cond_wait.c: Likewise.
7431         * pthread_cancel.c: Likewise.
7432         * pthread_create.c: Likewise.
7433         * pthread_detach.c: Likewise.
7434         * pthread_join.c: Likewise.
7435         * pthread_key_delete.c: Likewise.
7436         * pthread_setcancelstate.c: Likewise.
7437         * pthread_setcanceltype.c: Likewise.
7438         * pthread_timedjoin.c: Likewise.
7439         * pthread_tryjoin.c: Likewise.
7440         * sysdeps/pthread/createthread.c: Likewise.
7442 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7444         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7445         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7446         definitions.  Replace uses with calls to atomic_* functions.
7447         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7448         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7449         __lll_test_and_set calls with atomic_exchange_and_add and
7450         atomic_exchange calls respectively.
7451         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7452         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7453         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7454         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7455         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7456         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7457         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7459         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7460         returns the old value.
7462 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7464         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7465         int for variable OLDVAL and correct inline assembler contraint.
7466         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7467         type int for variable OLD.
7469         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7470         only for s390-32.
7471         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7472         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7473         instead of multiple_threads field in the TCB.
7475 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7477         * sysdeps/i386/i686/bits/atomic.h: Removed.
7478         * sysdeps/i386/i586/bits/atomic.h: Removed.
7479         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7480         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7481         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7482         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7483         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7484         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7485         * atomic.h: Removed.  Moved to glibc.
7487         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7488         support for clock selection.
7490         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7491         signalling waiters.
7493 2003-03-18  Roland McGrath  <roland@redhat.com>
7495         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7496         Add __lll_rel_instr first.  Add memory clobber.
7497         (lll_mutex_unlock): Use __lll_test_and_set.
7498         From Paul Mackerras <paulus@samba.org>.
7500         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7501         unconditionally.
7502         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7503         (SINGLE_THREAD_P):  Add `header.' prefix.
7504         From Paul Mackerras <paulus@samba.org>.
7506         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7507         pthread_timedjoin_np to ...
7508         (libpthread: GLIBC_2.3.3): ... here.
7509         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7511         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7512         Avoid shadowing VAL variable.
7514         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7515         New macro.
7517 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7519         * Makefile (tests): Add tst-cond11.
7520         * tst-cond11.c: New file.
7522         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7523         struct passed to cleanup handler to eliminate one more
7524         instruction.
7525         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7527         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7528         (pthrad_cond_t): Replace __unused field with __clock.
7530         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7531         waken all waiters in cleanup handler.
7532         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7533         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7535         * pthread_condattr_getclock.c: New file.
7536         * pthread_condattr_setclock.c: New file.
7537         * sysdeps/pthread/pthread.h: Declare these new functions.
7538         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7539         * Makefile (libpthread-routines): Add the new functions.
7540         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7541         Renamed field to value.  Document use of the bits.
7542         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7543         change.
7544         * pthread_condattr_setpshared.c: Likewise.
7545         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7546         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7547         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7548         Add __clock field.
7549         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7550         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7551         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7552         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7554         Implement clock selection.
7555         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7556         * pthread-errnos.sym: Add ENOSYS.
7557         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7558         _POSIX_CLOCK_SELECTION.
7559         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7561         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7562         invalid .size directive.
7564 2003-03-17  Roland McGrath  <roland@redhat.com>
7566         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7567         Formatting tweaks.
7569 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7571         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7572         Use __lll_add instead of spelling it out.  Use protected symbol names.
7573         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7574         Use __lll_add.
7575         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7576         Renamed from lll_compare_and_swap.  Use new name where necessary.
7577         (__lll_add): Defined.
7578         (__lll_dec_if_positive): Defined.
7579         (__lll_test_and_set): Defined.
7580         * sysdeps/ia64/pthread_spin_init.c: Removed.
7581         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7582         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7583         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7584         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7585         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7586         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7587         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7588         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7589         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7590         __sync_lock_release_si.
7591         Patch by Jakub Jelinek.
7593         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7594         Fix timeout handling.
7595         (__lll_timedwait_tid): Likewise.
7596         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7597         Patch by Jakub Jelinek.
7599         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7601 2003-03-17  Roland McGrath  <roland@redhat.com>
7603         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7604         * sysdeps/pthread/pthread_spin_init.c: New file.
7605         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7606         * sysdeps/powerpc/Makefile: New file.
7607         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7608         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7609         * sysdeps/powerpc/pthreaddef.h: New file.
7610         * sysdeps/powerpc/tcb-offsets.sym: New file.
7611         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7612         * sysdeps/powerpc/tls.h: New file.
7613         * sysdeps/powerpc/bits/atomic.h: New file.
7614         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7615         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7616         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7618         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7619         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7620         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7621         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7622         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7623         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7624         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7625         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7626         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7627         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7628         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7629         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7630         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7631         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7632         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7634         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7635         not gettimeofday.
7636         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7637         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7638         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7639         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7640         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7642 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7644         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7645         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7646         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7647         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7648         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7650 2003-03-16  Roland McGrath  <roland@redhat.com>
7652         * tst-fork4.c: Include <string.h>.
7653         * tst-signal2.c: Likewise.
7654         * tst-mutex5.c (do_test): exit -> return.
7655         * tst-mutex2.c: Include <stdlib.h>.
7657 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7659         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7660         (__lll_mutex_timedlock_wait): Correct expected value after
7661         spurious wakeup.  Otherwise we would never wait again.
7663         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7664         zone versus inline asm stupidity.  Use correct instructions.
7666         * tst-rwlock6.c: Add some more status output.
7668 2003-03-15  Roland McGrath  <roland@redhat.com>
7670         * sysdeps/pthread/configure.in: New file.
7671         * sysdeps/pthread/configure: New file (generated).
7673 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7675         * allocatestack.c (allocate_stack): Store the exact stack size of
7676         user allocated stacks.
7678 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7680         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7681         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7682         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7683         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7684         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7685         Use `header.' prefix.
7686         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7688 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7690         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7691         __builtin_frame_address, use stack pointer.
7693         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7694         instead of __builtin_frame_pointer.
7696 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7698         * tst-basic1.c (do_test): Add cast to avoid warning.
7699         * tst-basic2.c (do_test): Likewise.
7701         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7702         amount of stack correction.
7704         * tst-fork4.c: Use test-skeleton.c.
7706 2003-03-14  Roland McGrath  <roland@redhat.com>
7708         * init.c: Fix typo "#eli" for "#else".
7710 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7712         * allocatestack.c (__stack_user): Use hidden_data_def.
7713         * pthread_create.c (__pthread_keys): Likewise.
7715         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7717 2003-03-14  Roland McGrath  <roland@redhat.com>
7719         * tst-fork4.c: New file.
7720         * Makefile (tests): Add it.
7722         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7723         we always define the padding space.
7724         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7725         stopped supporting its own extensions fully.
7726         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7727         struct also called `header', so `header.multiple_threads' is the field
7728         name to use on all machines.
7729         * allocatestack.c (allocate_stack): Use `header.' prefix.
7730         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7731         * pthread_create.c (__pthread_create_2_1): Likewise.
7732         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7733         (THREAD_SELF): Likewise.
7734         * sysdeps/x86_64/tls.h: Likewise.
7735         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7736         (SINGLE_THREAD_P): Likewise.
7737         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7738         (SINGLE_THREAD_P): Likewise.
7739         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7740         (SINGLE_THREAD_P): Likewise.
7742         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7743         value directly.
7745 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7747         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7748         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7750         * pthread_create.c (start_thread): setjmp is expected to return 0.
7752         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7753         (THREAD_GETMEM_NC): Likewise.
7755 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7757         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7758         and the size of the stack which must be allocated is a multiple,
7759         allocate one more page.
7760         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7761         MULTI_PAGE_ALIASING.
7763 2003-03-13  Roland McGrath  <roland@redhat.com>
7765         * pthread_create.c (start_thread): Set EXITING_BIT after the
7766         event-reporting (and destructors), not before.
7768 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7770         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7771         lll_futex_wake): Declare register variables as long int instead of
7772         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7773         Make syscall arguments clobbered by the syscall.
7774         (lll_futex_wait): Define using lll_futex_timed_wait.
7776         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7777         to void *.
7779         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7780         PPID if [! NDEBUG].
7782         * allocatestack.c (nptl_ncreated): Only declare if
7783         COLORING_INCREMENT != 0.
7785         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7786         (__libc_enable_asynccancel_2): Remove prototype.
7788         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7789         ctid to match kernel.
7791 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7793         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7794         libc_multiple_threads.
7795         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7796         __libc_multiple_threads to...
7797         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7799         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7800         versioning.
7801         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7802         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7804         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7805         (__pthread_once_internal): Define.
7807         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7808         macros instead of .symver directly.
7809         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7810         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7812         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7813         * sysdeps/x86_64/tcb-offsets.sym: New file.
7814         * sysdeps/x86_64/Makefile: New file.
7816         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7817         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7818         to access own pthread_t in TCB.
7819         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7820         Likewise.
7821         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7822         Likewise.
7823         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7825 2003-03-12  Roland McGrath  <roland@redhat.com>
7827         * pthread-errnos.sym: New file.
7828         * Makefile (gen-as-const-headers): New variable, list that file.
7829         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7830         header <pthread-errnos.h> instead of defining errno values here.
7831         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7832         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7833         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7834         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7835         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7836         Likewise.
7837         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7838         Likewise.
7839         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7840         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7841         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7842         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7843         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7844         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7845         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7846         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7847         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7848         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7849         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7850         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7851         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7852         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7853         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7854         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7855         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7856         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7857         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7858         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7859         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7860         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7861         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
7862         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
7863         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
7864         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7865         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7867         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
7868         CLONE_CHILD_SETTID worked.
7870 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7872         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
7873         file.
7874         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
7875         file.
7877         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7878         (pthread_cond_t): Add padding.
7880         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
7881         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
7882         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
7884         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
7885         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
7886         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
7887         (__pthread_rwlock_timedrdlock): Likewise.
7888         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
7889         (__pthread_rwlock_wrlock): Likewise.
7890         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
7891         (__pthread_rwlock_rdlock): Likewise.
7893         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
7895         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
7896         result of lock re-get if it fails.
7898 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7900         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
7901         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7902         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7903         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7904         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7905         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7906         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7907         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7908         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7909         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7911         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
7912         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
7914         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
7915         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
7916         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
7917         (create_thread): Likewise.
7918         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
7919         * init.c (__pthread_initialize_minimal_internal): Initialize
7920         __libc_multiple_threads_ptr if necessary.
7921         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
7922         __pthread_multiple_threads and __libc_multiple_threads_ptr.
7923         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
7924         __libc_multiple_threads.
7925         (__libc_pthread_init): Return pointer to __libc_pthread_init if
7926         necessary.
7928         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
7929         (THREAD_SETMEM_NC): Likewise.
7931         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
7932         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
7933         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
7934         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
7936         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
7937         Eliminate one entire instruction.
7939         * cancellation.c (__pthread_enable_asynccancel_2): New function.
7940         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
7941         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7942         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
7943         instead of __pthread_enable_asynccancel.
7944         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7945         (__pthread_cond_wait): Likewise.
7946         * sysdeps/pthread/pthread_cond_timedwait.c
7947         (__pthread_cond_timedwait): Likewise.
7948         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
7950         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7951         (__condvar_cleanup): Wake up all waiters in case we got signaled
7952         after being woken up but before disabling asynchronous
7953         cancellation.
7954         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
7955         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
7956         (__condvar_cleanup): Likewise.
7958         * init.c (__NR_set_tid_address): If already defined, don't redefine.
7959         Make it an error if architecture has no #if case.  Add x86-64.
7961         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
7962         pt-initfini.s generation.
7964         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
7965         (TLS_INIT_TP): Fix typo.
7967 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7969         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
7970         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
7972         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
7973         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7974         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
7975         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
7976         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
7977         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7978         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7979         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7981 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7983         * sysdeps/pthread/pthread_cond_timedwait.c
7984         (__pthread_cond_timedwait): Return the result of the final
7985         locking.  If it succeeds, the regular function return value.
7987         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
7988         Return result of the final locking.
7989         * version.c (__nptl_main): Work around problems with the strange
7990         INTERNAL_SYSCALL macro on ppc32.
7991         * init.c (__pthread_initialize_minimal_internal): Unblock
7992         SIGCANCEL in case the parent blocked it.
7993         Reported by Paul Mackerras <paulus@samba.org>.
7995         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
7996         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
7997         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
7999 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8001         * sysdeps/pthread/pthread_cond_timedwait.c
8002         (__pthread_cond_timedwait): Unlock and fail if
8003         __pthread_mutex_unlock_internal failed.
8005         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8006         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8007         Use ARCH_CLONE.
8008         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8009         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8010         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8011         ALLOCATE_STACK): New macros.
8012         (TLS_TPADJ): New macro.
8013         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8014         (allocate_stack): Handle TLS_DTV_AT_TP and
8015         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8016         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8017         Don't set PD->self.
8018         * init.c [__ia64__] (__NR_set_tid_address): Define.
8020         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8021         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8022         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8023         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8024         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8025         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8026         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8027         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8028         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8029         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8030         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8031         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8032         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8033         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8034         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8035         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8036         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8037         * sysdeps/ia64/bits/atomic.h: New file.
8038         * sysdeps/ia64/Makefile: New file.
8039         * sysdeps/ia64/pthread_spin_init.c: New file.
8040         * sysdeps/ia64/pthread_spin_lock.c: New file.
8041         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8042         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8043         * sysdeps/ia64/pthreaddef.h: New file.
8044         * sysdeps/ia64/tcb-offsets.sym: New file.
8045         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8046         * sysdeps/ia64/tls.h: New file.
8048         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8049         to syscall instead of no arguments.
8051 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8053         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8054         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8055         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8056         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8058         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8059         unused code.
8061         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8063         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8064         lowlevelbarrier.sym.
8065         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8066         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8067         Include lowlevelbarrier.h and don't define offsets locally.
8068         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8070         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8071         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8072         (__lll_mutex_timedlock_wait): Likewise.
8073         (lll_mutex_lock): Adjust asm for that.
8074         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8075         (lll_lock): Adjust asm for operand order change.
8076         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8077         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8079         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8080         Reverse order of parameters.
8081         (__lll_timedwait_tid): Remove regparms attribute.
8082         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8083         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8085         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8086         (__lll_timedwait_tid): Remove one unnecessary instruction.
8088         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8089         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8090         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8091         lowlevelmutex.S.
8093         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8094         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8095         for NOT_IN_libc.
8096         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8097         lowlevellock.S.
8099         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8100         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8101         for libc.so.
8102         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8103         define LOCK here (if UP is not defined).  The actual code is in
8104         lowlevelmutex.S.
8106         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8107         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8108         __lll_timedwait_tid for libc.so.
8109         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8110         define LOCK here (if UP is not defined).  The actual code is in
8111         lowlevellock.S.
8113         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8114         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8115         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8116         instead of lowlevelsem.h.
8117         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8118         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8119         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8121         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8122         lowlevelrwlock.sym.
8123         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8124         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8125         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8127         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8128         register loading.
8129         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8130         last changed.  D'oh.
8132         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8134         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8135         of __libc_locking_needed.
8136         (lll_trylock): Initialize %eax to zero.
8138         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8139         pthread_cond_t definition.
8141 2003-03-10  Roland McGrath  <roland@redhat.com>
8143         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8144         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8145         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8146         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8147         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8149         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8150         Instead of setting PD->multiple_threads, set globals
8151         __pthread_multiple_threads and __libc_multiple_threads.
8152         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8153         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8154         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8156         * descr.h (struct pthread): Conditionalize first member on
8157         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8158         containing an anonymous tcbhead_t.  Move `list' member out.
8159         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8160         * allocatestack.c: Remove use of `header.data.' prefix.
8161         * pthread_create.c: Likewise.
8162         * init.c (__pthread_initialize_minimal_internal): Likewise.
8163         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8164         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8165         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8166         * sysdeps/x86_64/tls.h: Likewise.
8167         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8168         (SINGLE_THREAD_P): Likewise.
8169         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8170         (SINGLE_THREAD_P): Likewise.
8171         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8172         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8174 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8176         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8178         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8179         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8181         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8182         leftovers from the ia32 code.
8184         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8185         memory load.
8186         (clear_once_control): Don't load %esi.
8188         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8189         handling.
8191         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8193         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8194         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8196         * Makefile (tests): Add tst-cond10.
8197         * tst-cond10.c: New file.
8199 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8201         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8202         * tst-signal3.c (do_test): Likewise.
8203         * tst-sem5.c (do_test): Likewise.
8204         * tst-kill6.c (do_test): Likewise.
8205         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8207         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8208         of inc/dec.
8209         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8210         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8211         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8212         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8213         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8214         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8215         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8216         Likewise.
8217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8218         Likewise.
8219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8221         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8222         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8223         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8224         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8225         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8226         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8228         * allocatestack.c (allocate_stack): If mprotect() fails free the
8229         TLS memory.
8231 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8233         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8235         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8236         lll_wake_tid.  This was used only to work around kernel limits in
8237         the early days.
8238         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8239         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8240         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8241         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8243         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8244         (__pthread_initialize_minimal_internal): Change initialization of
8245         __static_tls_align_m1 appropriately.
8246         * pthreadP.h (__static_tls_align_m1): Renamed from
8247         __static_tls_align.
8248         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8249         instead of __static_tls_align-1.
8251 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8253         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8255         * pthread_create.c: Define __pthread_keys using nocommon
8256         attribute, not by placing it explicitly in bss.
8257         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8259         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8260         Use it in mmap call to allocate stacks.
8262         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8264         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8265         result of the thread function.
8267 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8269         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8270         version is just fine.
8272         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8273         (__pthread_child_handler): Renamed from pthread_child_handler,
8274         exported, and marked hidden.  Change all users.
8275         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8276         free __pthread_child_handler from child list.
8278 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8280         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8282         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8283         Fix handling of cancellation and failing pthread_mutex_unlock call.
8284         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8285         (__pthread_cond_wait): Likewise.
8287         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8288         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8289         lll_futex_timed_wait call.
8290         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8291         (pthread_rwlock_timedwrlock): Likewise.
8293         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8294         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8295         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8297         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8298         check of lll_futex_wake return value.
8300 2003-03-03  Roland McGrath  <roland@redhat.com>
8302         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8304         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8305         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8306         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8308 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8310         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8311         error for CPU clocks.
8313         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8314         _POSIX_MONOTONIC_CLOCK.
8315         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8317         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8318         recent kernels.
8320 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8322         * descr.h (struct pthread): Move cleanup field to the front.
8324 2003-03-01  Roland McGrath  <roland@redhat.com>
8326         * sem_open.c (sem_open): Braino fix.
8328 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8330         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8331         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8332         __pthread_cleanup_pop functionality.
8333         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8335         * descr.h (struct pthread): Move tid field to the front now that
8336         it is often used.
8338         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8339         (__lll_mutex_timedlock_wait): Remove.
8340         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8341         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8342         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8343         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8344         (lll_unlock_wake_cb): Don't save and restore %esi.
8345         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8346         %esi.
8347         (__lll_timedwait_tid): Add alignment.
8348         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8349         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8350         %esi.
8351         (__lll_timedwait_tid): Removed.
8352         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8353         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8354         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8355         (pthread_barrier_wait): Don't save, load, and restore %esi for
8356         last thread.
8357         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8358         (__pthread_cond_signal): Don't save, load, and restore %esi.
8359         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8360         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8361         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8362         Don't save, load, and restore %esi.
8364 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8366         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8367         Release lock before waking up the waiters.
8369         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8371         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8372         (reader_thread): Likewise.
8374         * sysdeps/pthread/pthread_rwlock_unlock.c
8375         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8376         to wake up readers if there are none.
8378         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8379         Release internal lock before wake threads.
8381 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8383         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8384         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8385         predefined.
8386         * tst-rwlock9.c: Likewise.
8387         * tst-rwlock10.c: New file.
8388         * tst-rwlock11.c: New file.
8390         * Makefile (tests): Add tst-dlsym1.
8391         * tst-dlsym1.c: New file.
8393         * init.c (__pthread_initialize_minimal_internal): Set
8394         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8395         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8397 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8399         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8401         * tst-cond2.c: Fix sychronization with child.
8403         * tst-rwlock8.c (reader_thread): Remove unused variable.
8405         * Makefile: Add rules to build and run tst-tls3.
8406         * tst-tls3.c: New file.
8407         * tst-tls3mod.c: New file.
8409         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8410         * tst-rwlock8.c: New file.
8411         * tst-rwlock9.c: New file.
8412         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8413         complete broken rwlock implementation.
8414         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8415         Likewise.
8416         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8417         Likewise.
8418         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8419         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8420         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8421         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8422         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8423         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8424         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8426 2003-02-23  Roland McGrath  <roland@redhat.com>
8428         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8430 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8432         * Makefile (tests): Add tst-context1.
8433         * tst-context1.c: New file.
8435         * Makefile (tests): Add tst-tls1 and tst-tls2.
8436         * tst-tls1.c: New file.
8437         * tst-tls2.c: New file.
8439         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8440         for failed cmpxchg.
8442         * pthread_create.c (start_thread): Set EXITING_BIT early.
8444         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8445         (THREAD_GETMEM_NC): Likewise.
8447 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8449         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8450         off 3 more bytes by using offset-less instructions when possible.
8452         * Makefile: Add dependency for $(objpfx)version.d.
8454         * eintr.c (eintr_source): Add unnecessary return but the compiler
8455         insists.
8457         * tst-kill3.c: Include <unistd.h>.
8459 2003-02-21  Roland McGrath  <roland@redhat.com>
8461         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8463 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8465         * Makefile (tests): Add tst-eintr1.
8466         (distribute): Add eintr.c.
8467         * tst-eintr1.c: New file.
8468         * eintr.c: New file.
8470         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8472         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8473         Disallow sending SIGCANCEL.
8475         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8476         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8477         * tst-kill1.c: New file.
8478         * tst-kill2.c: New file.
8479         * tst-kill3.c: New file.
8480         * tst-kill5.c: New file.
8481         * tst-kill6.c: New file.
8482         * tst-basic7.c: Renamed to...
8483         * tst-kill4.c: ...this.
8485 2003-02-21  Roland McGrath  <roland@redhat.com>
8487         * Makefile (install-lib-ldscripts): New variable.
8489 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8491         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8492         * pthread_cancel.c: Use INVALID_TD_P.
8493         * pthread_detach.c: Likewise.
8494         * pthread_getschedparam.c: Likewise.
8495         * pthread_setschedparam.c: Likewise.
8496         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8497         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8498         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8499         * pthread_timedjoin.c: Likewise.
8501         * tst-basic7.c: Include <signal.h>.
8503         * pthread_join.c (pthread_join): Limited checking for invalid
8504         descriptors.
8505         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8507 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8509         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8510         beginning of the loop.  Clear the entire first block of TSD.
8511         * Makefile (tests): Add tst-key4.
8512         * tst-key4.c: New file.
8514 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8516         * Makefile (tests): Add tst-basic7.
8517         * tst-basic7.c: New file.
8519         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8520         Add some more __builtin_expect.
8522         * pthreadP.h: Define dummy version of DEBUGGING_P.
8524 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8526         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8527         _POSIX_THREAD_PRIORITY_SCHEDULING.
8528         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8529         _XOPEN_REALTIME_THREADS.
8530         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8532         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8533         kernel returns EINVAL for PID <= 0, work around it.
8535         * Makefile (tests): Add tst-signal5.
8536         * tst-signal5.c: New file.
8538         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8539         and LOGIN_NAME_MAX.
8541         * tst-cancel1.c (tf): Block all signals.
8543         * Makefile (tests): Add tst-basic6.
8544         * tst-basic6.c: New file.
8546         * tst-basic1.c: Add test for process ID.
8548         * Makefile (tests): Add tst-cancel10.
8549         * tst-cancel10.c: New file.
8551         * Makefile (tests): Add tst-signal4.
8552         * tst-signal4.c: New file.
8554         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8555         __sigismember instead of sigismember.  Add __builtin_expect.
8557 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8559         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8560         pthread_setcancelstate, and pthread_rwlock_setpshared.
8562         * tst-cancel7.c (do_test): Make sure the pid file exists before
8563         canceling the thread.
8565         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8566         pthread_rwlock_timedrdlock tests.
8567         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8568         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8569         Check for invalid tv_nsec field.
8570         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8571         Likewise.
8573         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8574         recursive mutex of overflow.
8576         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8578         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8579         going into an endless loop.
8580         * Makefile (tests): Add tst-cancel9.
8581         * tst-cancel9.c: New file.
8583         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8585 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8587         * tst-mutex5.c (do_test): Add more timedlock tests.
8589         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8590         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8592         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8593         use INLINE_SYSCALL.  Error number is returned, not -1.
8595         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8596         and __deallocate_stack with internal_function.
8597         * pthread_create.c: Adjust definitions appropriately.
8598         * allocatestack.c: Likewise.
8600         * pthread_join.c: Add one more __builtin_expect.
8601         * pthread_timedjoin.c: Likewise.
8603         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8604         not data of sequence number does not match.
8605         Add one __builtin_expect.
8607         * Makefile (tests): Add tst-clock1.
8608         * tst-clock1.c: New file.
8610         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8611         negative arguments.
8612         * Makefile (tests): Add tst-basic5.
8613         * tst-basic5.c: New file.
8615 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8617         * Makefile (tests): Add tst-basic4.
8618         * tst-basic4.c: New file.
8620         * pthreadP.h: Add declaraction for __nptl_nthreads.
8621         * pthread_create.c: Define __nptl_nthreads
8622         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8623         after thread is done.  If then zero, call exit(0).
8624         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8625         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8626         * init.c (pthread_functions): Initialize ptr_nthreads.
8627         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8628         (__reclaim_stacks): Decrement __nptl_nthreads.
8629         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8630         Define.
8631         * Makefile (tests): Add tst-basic3.
8632         * tst-basic3.c: New file.
8634         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8635         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8636         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8637         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8638         if asynchronous canceling is enabled.
8639         * pthread_join.c (pthread_join): When recognizing circular joins,
8640         take into account the other thread might be already canceled.
8641         * Makefile (tests): Add tst-join5.
8642         * tst-join5.c: New file.
8644         * Makefile (tests): Add tst-join4.
8645         * tst-join4.c: New file.
8647 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8649         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8651 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8653         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8654         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8655         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8656         warning.
8657         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8658         to avoid warning.
8659         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8660         error if lll_futex_wake failed.
8662 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8664         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8665         handling of cancellation and failung pthread_mutex_unlock call.
8666         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8667         * Makefile (tests): Add tst-cond8 and tst-cond9.
8668         * tst-cond8.c: New file.
8669         * tst-cond9.c: New file.
8671         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8673         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8674         non-standard initializers with __USE_GNU.
8676         * Makefile (tests): Add tst-cleanup3.
8677         * tst-cleanup3.c: New file.
8679 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8681         * Makefile (tests): Add tst-attr1 and tst-attr2.
8682         * tst-attr1.c: New file.
8683         * tst-attr2.c: New file.
8685         * Makefile: Add rules to build and run tst-atfork2 test.
8686         * tst-atfork2.c: New file.
8687         * tst-atfork2mod.c: New file.
8689         * sysdeps/unix/sysv/linux/unregister-atfork.c
8690         (__unregister_atfork): Free the memory allocated for the handlers
8691         after removing them from the lists.
8693         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8694         cleanup function.
8696         * tst-atfork1.c (do_test): Wait for the child we forked.
8697         Report error in child.
8699         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8701         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8703 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8705         * Makefile (tests): Add tst-cancel8.
8706         * tst-cancel8.c: New file.
8708         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8709         clearing of control variable.
8710         * Makefile (tests): Add tst-once3 and tst-once4.
8711         * tst-once3.c: New file.
8712         * tst-once4.c: New file.
8714 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8716         * sysdeps/sh/Makefile: New file.
8717         * sysdeps/sh/bits/atomic.h: New file.
8718         * sysdeps/sh/pthread_spin_init.c: New file.
8719         * sysdeps/sh/pthread_spin_lock.c: New file.
8720         * sysdeps/sh/pthread_spin_trylock.S: New file.
8721         * sysdeps/sh/pthread_spin_unlock.S: New file.
8722         * sysdeps/sh/pthreaddef.h: New file.
8723         * sysdeps/sh/tcb-offsets.sym: New file.
8724         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8725         * sysdeps/sh/tls.h: New file.
8726         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8727         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8728         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8729         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8730         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8731         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8732         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8733         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8734         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8735         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8736         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8737         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8738         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8739         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8740         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8741         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8742         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8743         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8744         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8745         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8746         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8747         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8748         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8749         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8750         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8751         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8752         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8753         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8754         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8755         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8757 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8759         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8760         according to POSIX.
8762         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8764 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8766         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8767         (TLS_GET_FS): New #define.
8768         (TLS_SET_FS): New #define.
8769         Correct value of __NR_set_thread_area.
8771         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8773 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8775         * Makefile (tests): Add tst-popen1.
8776         * tst-popen1.c: New file.
8778         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8779         but inactive generalization.
8780         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8781         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8782         Minor optimization, remove one instruction.
8783         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8785 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8787         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8789 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8791         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8792         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8793         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8794         * sysdeps/pthread/pthread_cond_signal.c: New file.
8795         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8796         * sysdeps/pthread/pthread_cond_wait.c: New file.
8797         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8798         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8799         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8800         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8801         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8802         * sysdeps/s390/Makefile: New file.
8803         * sysdeps/s390/bits/atomic.h: New file.
8804         * sysdeps/s390/pthread_spin_init.c: New file.
8805         * sysdeps/s390/pthread_spin_lock.c: New file.
8806         * sysdeps/s390/pthread_spin_trylock.c: New file.
8807         * sysdeps/s390/pthread_spin_unlock.c: New file.
8808         * sysdeps/s390/pthreaddef.h: New file.
8809         * sysdeps/s390/tcb-offsets.sym: New file.
8810         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8811         * sysdeps/s390/tls.h: New file.
8812         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8813         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8814         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8815         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8816         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8817         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8818         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8819         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8820         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8821         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8822         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8823         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8824         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8825         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8826         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8827         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8828         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8829         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8830         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8831         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8832         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8833         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8834         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8836 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8838         * atomic.h: Add a couple more default implementations.
8839         (atomic_compare_and_exchange_acq): Use
8840         __arch_compare_and_exchange_32_acq in return value definition.  It
8841         always exists.
8842         (atomic_bit_set): Renamed from atomic_set_bit.
8843         Add missing atomic_ prefixes.
8845         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8846         thread library is available, use correct value to mark initialized
8847         once variable.
8849 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8851         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8852         __sysconf to determine pagesize.
8854         * pthread_create.c: Include <atomic.h>.
8855         * allocatestack.c (allocate_stack): Implement coloring of the
8856         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8857         size minus one.  Adjust users.
8858         * sysdeps/i386/i686/Makefile: New file.
8860 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
8862         * allocatestack.c: Improve comment throughout the file.
8864         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8865         (__lll_lock_wait): Add branch prediction.
8866         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8867         (__lll_lock_wait): Likewise.
8868         (lll_unlock_wake_cb): Removed.
8870 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
8872         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
8873         _POSIX_THREAD_PRIORITY_SCHEDULING.
8875 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
8877         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8878         Fix return type of ptr___pthread_getspecific.
8880 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
8882         * Makefile (tests): Add tst-umask1.
8883         (tst-umask1-ARGS): Define.
8884         * tst-umask1.c: New file.
8886 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
8888         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
8889         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
8890         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
8891         pthread_rwlock_unlock.
8892         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
8893         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
8894         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
8895         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
8896         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8897         New file.
8898         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
8899         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8900         New file.
8901         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
8902         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
8903         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
8904         New file.
8905         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
8906         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
8907         New file.
8908         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
8909         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
8910         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
8911         New file.
8912         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
8913         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
8914         New file.
8915         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
8917         * Makefile (libpthread-routines): Remove lowlevelcond and
8918         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
8919         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
8920         and pthread_cond_broadcast.
8921         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
8922         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
8923         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
8924         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
8925         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
8926         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
8927         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
8928         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
8929         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
8930         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
8931         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
8932         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
8933         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
8934         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
8935         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
8936         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
8937         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
8938         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
8939         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
8940         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
8941         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
8942         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
8943         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
8944         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
8945         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
8946         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
8947         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
8948         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
8949         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
8950         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
8951         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
8953         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
8954         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
8955         of the code is moved to ...
8956         * sysdeps/pthread/createthread.c: ...here.  New file.
8958 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
8960         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
8961         (__new_sem_post): Clear %eax before returning.
8962         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
8964         * Makefile (tests): Add tst-cleanup2.
8965         * tst-cleanup2.c: New file.
8967         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
8968         Interpret first parameter correctly.
8970 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
8972         * Makefile (headers): Add bits/semaphore.h.
8974 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
8976         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
8977         if not SHARED.
8979 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
8981         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
8982         must be used and mapping failed.
8983         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
8985         * Makefile (CFLAGS-pthread_self.os): Define this, not
8986         CFLAGS-pthread_self.c.
8988 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8990         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
8991         lll_unlock_wake_cb.
8993         * Makefile (libpthread-routines): Add version.  Add rules to build
8994         version.os and banner.h.
8995         * version.c: New file.
8997 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
8999         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9000         the alias unconditional.
9001         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9003 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9005         * Makefile (CFLAGS-pthread_self.c): New definition.
9007 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9009         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9010         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9011         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9012         * init.c (__pthread_initialize_minimal_internal): Likewise.
9014 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9016         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9018         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9019         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9020         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9021         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9022         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9023         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9025 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9027         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9028         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9029         * tst-cancel-wrappers.sh: Remove all exceptions.
9031 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9033         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9034         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9036         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9037         Use __libc_pthread_functions array if SHARED.
9039         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9040         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9042         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9043         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9044         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9045         __libc_ptf_call instead of __libc_maybe_call.
9046         (PTF): New #define.
9047         (__libc_cleanup_region_start): Wrap function name with PTF call.
9048         (__libc_cleanup_region_end): Likewise.
9049         (__libc_cleanup_end): Likewise.
9051         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9052         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9053         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9054         * pthreadP.h: Add prototypes.
9056         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9057         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9058         __pthread_rwlock_unlock aliases.
9059         * pthreadP.h: Add prototypes for new aliases.
9061         * pthreadP.h (struct pthead_functions): Moved to...
9062         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9063         * init.c (pthread_functions): Add initializers for new elements.
9065         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9066         __pthread_cleanup_pop_restore aliases.
9067         * pthreadP.h: Add prototypes.
9069         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9070         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9071         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9072         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9073         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9074         * pthreadP.h: Adjust prototypes and callers.
9076 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9078         * Makefile (tests): Add tst-cancel7.
9079         (tst-cancel7-ARGS): New variable.
9080         * tst-cancel7.c: New file.
9082         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9083         around gcc defficiencies.
9084         * old_pthread_cond_signal.c: Likewise.
9085         * old_pthread_cond_timedwait.c: Likewise.
9086         * old_pthread_cond_wait.c: Likewise.
9088         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9090 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9092         * Makefile (tests): Add tst-cond7.
9093         * tst-cond7.c: New file.
9095         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9096         (condvar_cleanup): Get condvar address from the right place.
9098         * atomic.h: Correct definitions of atomic_full_barrier,
9099         atomic_read_barrier, atomic_write_barrier.
9101         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9102         race-free.
9103         * old_pthread_cond_signal.c: Likewise.
9104         * old_pthread_cond_timedwait.c: Likewise.
9105         * old_pthread_cond_wait.c: Likewise.
9107 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9109         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9111 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9113         * pthreadP.h (pthread_cond_2_0_t): New type.
9114         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9115         Use new type for the 2.0 condvar function prototypes.
9116         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9117         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9118         parameter.
9119         * old_pthread_cond_destroy.c: Likewise.
9120         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9121         * old_pthread_cond_signal.c: Likewise.
9122         * old_pthread_cond_timedwait.c: Likewise.
9123         * old_pthread_cond_wait.c: Likewise.
9125         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9126         (__pthread_cond_wait): Don't save cancellation mode and seq value
9127         in same location.
9129         * herrno.c (__h_errno_location): Don't define as weak.
9131 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9133         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9134         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9135         and pthread_cond_wait.
9136         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9137         Renamed to...
9138         (__pthread_cond_broadcast_2_0): ... this.
9139         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9140         Renamed to...
9141         (__pthread_cond_destroy_2_0): ... this.
9142         * old_pthread_cond_init.c (__old_pthread_cond_init):
9143         Renamed to...
9144         (__pthread_cond_init_2_0): ... this.
9145         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9146         Renamed to...
9147         (__pthread_cond_signal_2_0): ... this.
9148         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9149         Renamed to...
9150         (__pthread_cond_wait_2_0): ... this.
9151         * pthread_cond_destroy.c: Include shlib-compat.h.
9152         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9153         * pthread_cond_init.c: Include shlib-compat.h.
9154         (pthread_cond_init): Change strong_alias into versioned_symbol.
9155         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9156         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9157         fields.
9158         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9159         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9160         __pthread_cond_wait_2_0): New prototypes.
9161         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9162         __old_pthread_cond_init, __old_pthread_cond_signal,
9163         __old_pthread_cond_wait): Removed.
9164         * init.c: Include shlib-compat.h.
9165         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9166         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9167         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9168         ptr___pthread_cond_*_2_0 fields.
9169         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9170         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9172         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9173         LIBC_SIGACTION was not yet defined.
9174         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9175         [!defined LIBC_SIGACTION] (__sigaction): New function and
9176         libc_hidden_weak.
9177         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9178         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9180 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9182         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9184 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9186         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9187         New, larger type definition.
9188         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9189         implementation.
9190         * Versions [libpthread]: Add definitions for new pthread_cond_*
9191         interfaces for version GLIBC_2.3.2.
9192         * pthread_cond_init.c: Update initialization for new type definition.
9193         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9194         pthread_cond_timedwait, pthread_cond_signal, and
9195         pthread_cond_broadcast.  Add old_pthread_cond_init,
9196         old_pthread_cond_destroy, old_pthread_cond_wait,
9197         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9198         old_pthread_cond_broadcast.
9199         * old_pthread_cond_broadcast.c: New file.
9200         * old_pthread_cond_destroy.c: New file.
9201         * old_pthread_cond_init.c: New file.
9202         * old_pthread_cond_signal.c: New file.
9203         * old_pthread_cond_timedwait.c: New file.
9204         * old_pthread_cond_wait.c: New file.
9205         * pthreadP.h: Add prototypes for the compatibility interfaces.
9207         * pthread_cond_destroy.c: Don't include <errno.h>.
9209 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9211         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9212         unnecessary zero offset when addressing MUTEX.
9214 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9216         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9217         __register_atfork.
9218         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9219         for __register_atfork.
9221 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9223         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9224         instead of ASSEMBLER test macro.
9226         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9227         __libc_current_sigrtmax): Add libc_hidden_def.
9229         * sysdeps/pthread/list.h: Remove assert.h include.
9231 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9233         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9234         __pthread_initialize_minimal_internal not
9235         __pthread_initialize_minimal.
9237 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9239         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9240         __pthread_initialize_minimal as hidden.
9242         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9243         constructor.
9245 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9247         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9248         $(common-objpfx)format.lds, include that into the output script.
9249         Fix comment.
9250         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9252 2002-12-28  Andreas Jaeger  <aj@suse.de>
9254         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9255         nsec resolution changes.
9256         (xstat64_conv): Likewise.
9257         (xstat32_conv): Likewise.
9258         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9259         struct kernel_stat.
9260         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9261         structs stat and stat64.
9262         * time/time.h (__timespec_defined): Define for __USE_MISC.
9263         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9265 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9267         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9268         argument.
9269         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9270         (pthread_exit): Use strong_alias to avoid warnings.
9271         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9272         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9273         ptr___pthread_attr_init_2_*.
9274         * init.c (pthread_functions): Adjust.
9276 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9278         * forward.c: Make all functions available by default again.  It
9279         caused too much trouble.
9281         * pt-siglongjmp.c: Removed.
9283 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9285         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9286         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9287         * sysdeps/i386/Makefile: New file.
9288         * sysdeps/i386/tcb-offsets.sym: New file.
9289         * sysdeps/pthread/tcb-offsets.h: New file.
9290         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9291         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9293         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9294         __register_atfork...
9295         (GLIBC_2.3.2): ...here.
9297 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9299         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9300         pthread_attr_setstackaddr with __attribute_deprecated__.
9302 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9304         * pt-system.c (system): Remove cancellation handling.
9305         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9306         cancellation routines.
9308 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9310         * descr.h: Include <dl-sysdep.h>.
9311         (struct pthread): Move header.data.list to the back of the struct.
9312         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9313         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9314         (SYSINFO_OFFSEET): Likewise.
9316 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9318         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9319         Define.
9320         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9321         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9322         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9323         (USE_DL_SYSINFO): Undef.
9325 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9327         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9328         $(common-objpfx)libc.so.
9329         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9330         it is bigger than pipe buffer size even on arches with bigger
9331         page size.
9332         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9334 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9336         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9337         correct errno access for case that USE___THREAD is not defined.
9339 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9341         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9342         Patch by Marijn Ros <marijn@mad.scientist.com>.
9344 2002-12-22  Roland McGrath  <roland@redhat.com>
9346         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9348 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9350         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9352 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9354         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9355         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9356         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9358         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9359         of int $0x80.
9360         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9361         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9362         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9363         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9364         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9365         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9366         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9367         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9369         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9370         sysenter.
9371         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9373         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9375         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9376         in new TCB.
9377         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9378         that sysinfo is properly initialized.
9379         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9380         to 1 only for ld.so.
9382         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9383         RTLD_CORRECT_DYNAMIC_WEAK.
9385 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9387         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9388         Use return 0 as 6th argument to FORWARD4.
9389         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9391 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9393         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9394         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9395         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9396         (INIT_SYSINFO): New #define.
9397         (TLS_TP_INIT): Use INIT_SYSINFO.
9398         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9399         At test to make sure SYSINFO_OFFSET value is correct.
9400         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9402 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9404         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9405         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9406         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9407         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9408         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9409         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9410         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9412 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9414         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9415         macro instead of using int $0x80 directly.
9417         * sysdeps/pthread/bits/stdio-lock.h: New file.
9418         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9419         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9420         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9421         * Makefile (routines): Add libc-lowlevelmutex.
9423         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9424         __i686.get_pc_thunk.dx.
9426 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9428         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9429         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9430         ($(objpfx)tst-cancel-wrappers.out): New rule.
9431         * tst-cancel-wrappers.sh: New test.
9432         * tst-locale1.c: Include signal.h.
9433         (uselocale): Test static linking of __libc_current_sigrt*.
9435 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9437         * Makefile (tests): Add tst-cancel6.
9438         * tst-cancel6.c: New file
9440 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9442         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9443         Define meaningfully for assembler as well.
9444         * pthreadP.h (struct pthread_functions): Remove
9445         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9446         and ptr_pthread_attr_init_2_1 fields.
9447         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9448         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9449         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9450         (FORWARD3): Define using FORWARD4.
9451         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9452         versions.
9453         * pt-system.c: Remove duplicate stdlib.h include.
9455 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9457         * sem_init.c: Define sem_init@GLIBC_2.0.
9458         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9459         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9461         * flockfile.c: Moved to...
9462         * sysdeps/pthread/flockfile.c: ...here.  New file.
9463         * funlockfile.c: Moved to...
9464         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9465         * ftrylockfile.c: Moved to...
9466         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9468 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9470         * libc-cancellation.c: Guard both function with
9471         #if !defined NOT_IN_libc.
9472         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9473         automatically provided pthread wrappers.
9474         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9475         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9476         nor in libpthread.
9477         * pt-open.c: Removed.
9478         * pt-fcntl.c: Removed.
9479         * pt-fsync.c: Removed.
9480         * pt-lseek.c: Removed.
9481         * pt-msgrcv.c: Removed.
9482         * pt-msgsnd.c: Removed.
9483         * pt-msync.c: Removed.
9484         * pt-nanosleep.c: Removed.
9485         * pt-open64.c: Removed.
9486         * pt-pause.c: Removed.
9487         * pt-pread.c: Removed.
9488         * pt-pread64.c: Removed.
9489         * pt-pwrite.c: Removed.
9490         * pt-pwrite64.c: Removed.
9491         * pt-read.c: Removed.
9492         * pt-recv.c: Removed.
9493         * pt-recvfrom.c: Removed.
9494         * pt-recvmsg.c: Removed.
9495         * pt-send.c: Removed.
9496         * pt-sendto.c: Removed.
9497         * pt-sigtimedwait.c: Removed.
9498         * pt-sigwait.c: Removed.
9499         * pt-wait.c: Removed.
9500         * pt-waitpid.c: Removed.
9501         * pt-write.c: Removed.
9502         * pt-accept.c: Removed.
9503         * pt-close.c: Removed.
9504         * pt-connect.c: Removed.
9505         * pt-lseek64.c: Removed.
9506         * pt-sendmsg.c: Removed.
9507         * pt-tcdrain.c: Removed.
9509 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9511         * init.c (__pthread_initialize_minimal_internal): Renamed from
9512         __pthread_initialize_minimal.  Make old name an alias.  This
9513         converts a normal relocation into a relative relocation.
9515         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9517         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9518         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9519         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9520         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9521         pt-sigwaitinfo, pt-waitid, and pt-writev.
9522         * pt-creat.c: Removed.
9523         * pt-poll.c: Removed.
9524         * pt-pselect.c: Removed.
9525         * pt-readv.c: Removed.
9526         * pt-select.c: Removed.
9527         * pt-sigpause.c: Removed.
9528         * pt-sigsuspend.c: Removed.
9529         * pt-sigwaitinfo.c: Removed.
9530         * pt-waitid.c: Removed.
9531         * pt-writev.c: Removed.
9533         * init.c (pthread_functions): New variable.
9534         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9535         (or NULL) to __libc_pthread_init.
9536         * forward.c: Rewrite to use __libc:pthread_functions array to get
9537         function addresses.
9538         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9539         prototype.
9540         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9541         Take new parameter.  Copy content of variable pointed to by it
9542         to __libc_pthread_init.
9544         * pthreadP.h (struct pthread_functions): New type.
9545         (__libc_pthread_init): Declare.
9547         * pthread_attr_destroy.c: Add namespace protected alias.
9548         * pthread_attr_getdetachstate.c: Likewise.
9549         * pthread_attr_getinheritsched.c: Likewise.
9550         * pthread_attr_getschedparam.c: Likewise.
9551         * pthread_attr_getschedpolicy.c: Likewise.
9552         * pthread_attr_getscope.c: Likewise.
9553         * pthread_attr_setdetachstate.c: Likewise.
9554         * pthread_attr_setinheritsched.c: Likewise.
9555         * pthread_attr_setschedparam.c: Likewise.
9556         * pthread_attr_setschedpolicy.c: Likewise.
9557         * pthread_attr_setscope.c: Likewise.
9558         * pthread_cond_broadcast.c: Likewise.
9559         * pthread_cond_destroy.c: Likewise.
9560         * pthread_cond_init.c: Likewise.
9561         * pthread_cond_signal.c: Likewise.
9562         * pthread_cond_wait.c: Likewise.
9563         * pthread_condattr_destroy.c: Likewise.
9564         * pthread_condattr_init.c: Likewise.
9565         * pthread_equal.c: Likewise.
9566         * pthread_exit.c: Likewise.
9567         * pthread_getschedparam.c: Likewise.
9568         * pthread_self.c: Likewise.
9569         * pthread_setcancelstate.c: Likewise.
9570         * pthread_setschedparam.c: Likewise.
9571         * pthread_mutex_destroy.c: Likewise.
9572         * pthread_mutex_init.c: Likewise.
9573         * pthreadP.h: Add prototypes for the aliases.
9575         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9576         multiple_threads member in correct TCB to 1.
9578         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9579         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9580         member of thread decriptor, otherwise return unconditionally 1.
9582 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9584         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9585         regular Linux version.  Remove file.
9586         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9587         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9588         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9589         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9590         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9591         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9592         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9593         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9594         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9595         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9596         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9597         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9598         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9599         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9600         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9601         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9602         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9603         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9604         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9605         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9606         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9607         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9608         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9609         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9610         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9611         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9612         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9613         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9614         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9615         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9617 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9619         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9620         * sysdeps/unix/sysv/linux/open.c: Removed.
9621         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9622         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9623         * sysdeps/unix/sysv/linux/msync.c: Removed.
9624         * sysdeps/unix/sysv/linux/read.c: Removed.
9625         * sysdeps/unix/sysv/linux/close.c: Removed.
9626         * sysdeps/unix/sysv/linux/creat.c: Removed.
9627         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9628         * sysdeps/unix/sysv/linux/pause.c: Removed.
9629         * sysdeps/unix/sysv/linux/select.c: Removed.
9630         * sysdeps/unix/sysv/linux/write.c: Removed.
9632 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9634         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9635         element in TCB to see whether locking is needed.
9637         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9638         MULTIPLE_THREADS_OFFSET value is correct.
9640         * sysdeps/unix/sysv/linux/close.c: New file.
9641         * sysdeps/unix/sysv/linux/connect.S: New file.
9642         * sysdeps/unix/sysv/linux/creat.c: New file.
9643         * sysdeps/unix/sysv/linux/fsync.c: New file.
9644         * sysdeps/unix/sysv/linux/llseek.c: New file.
9645         * sysdeps/unix/sysv/linux/lseek.c: New file.
9646         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9647         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9648         * sysdeps/unix/sysv/linux/msync.c: New file.
9649         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9650         * sysdeps/unix/sysv/linux/open.c: New file.
9651         * sysdeps/unix/sysv/linux/open64.c: New file.
9652         * sysdeps/unix/sysv/linux/pause.c: New file.
9653         * sysdeps/unix/sysv/linux/poll.c: New file.
9654         * sysdeps/unix/sysv/linux/pread.c: New file.
9655         * sysdeps/unix/sysv/linux/pread64.c: New file.
9656         * sysdeps/unix/sysv/linux/pselect.c: New file.
9657         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9658         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9659         * sysdeps/unix/sysv/linux/readv.c: New file.
9660         * sysdeps/unix/sysv/linux/recv.S: New file.
9661         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9662         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9663         * sysdeps/unix/sysv/linux/select.c: New file.
9664         * sysdeps/unix/sysv/linux/send.S: New file.
9665         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9666         * sysdeps/unix/sysv/linux/sendto.S: New file.
9667         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9668         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9669         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9670         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9671         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9672         * sysdeps/unix/sysv/linux/system.c: New file.
9673         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9674         * sysdeps/unix/sysv/linux/wait.c: New file.
9675         * sysdeps/unix/sysv/linux/waitid.c: New file.
9676         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9677         * sysdeps/unix/sysv/linux/writev.c: New file.
9678         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9680         * pt-readv.c: Fix comment.
9682 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9684         * tst-cleanup1.c: Include stdlib.h.
9686         * tst-cancel5.c: New test.
9687         * Makefile (tests): Add tst-cancel5.
9688         (tst-cancel5): Link against libc.so libpthread.so in that order.
9690 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9692         * forward.c (test_loaded): Prevent recursive calls.
9694         * Makefile (routines): Add libc-cancellation.
9695         * libc-cancellation.c: New file.
9696         * descr.h (struct pthread): Add multiple_threads field.
9697         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9698         new thread descriptor to 1.
9699         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9700         Initialize multiple_thread field after successful thread creation.
9701         * cancellation.c (__do_cancel): Move to pthreadP.h.
9702         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9703         (__pthread_disable_asynccancel): Add internal_function attribute.
9704         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9705         * pthread_setcancelstate.c: Likewise.
9706         * pthread_setcanceltype.c: Likewise.
9707         * pthread_exit.c: Likewise.
9708         * pthreadP.h (CANCELLATION_P): Likewise.
9709         (__do_cancel): Define as static inline.
9710         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9711         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9712         declarations.
9713         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9714         fields.  Define MULTIPLE_THREADS_OFFSET.
9715         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9716         declaration.
9717         * sysdeps/unix/sysv/linux/accept.S: New file.
9718         * sysdeps/unix/sysv/linux/read.c: New file.
9719         * sysdeps/unix/sysv/linux/write.c: New file.
9720         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9721         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9722         initialization of __libc_locking_needed.
9723         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9724         __libc_locking_needed, use multiple_threads field in TCB.
9725         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9727 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9729         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9730         version.
9731         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9733         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9734         access to __libc_locking_needed for PIC.
9736 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9738         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9739         declare for libc.so.
9740         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9741         expression.
9742         (__libc_lock_lock): Put into statement expression.
9743         (__libc_lock_unlock): Remove trailing semicolon.
9744         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9746 2002-12-12  Roland McGrath  <roland@redhat.com>
9748         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9749         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9751 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9753         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9754         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9755         Initialize __libc_locking_needed.
9756         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9757         instead of __register_pthread_fork_handler.
9758         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9759         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9760         fork-gen with libc_pthread_init.
9761         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9762         of __register_pthread_fork_handler.
9763         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9764         of __register_pthread_fork_handler.
9765         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9766         __libc_locking_needed to determine whether lock prefix can be avoided.
9767         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9769 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9771         * Makefile (tests): Add tst-cleanup1.
9772         * tst-cleanup1.c: New file.
9773         * cancellation.c (__cleanup_thread): Removed.
9774         (__do_cancel): Remove call to __cleanup_thread.
9775         * pthreadP.h: Remove __cleanup_thread prorotype.
9777         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9778         Remember function and argument even if cancellation handler
9779         function is not available.
9780         (__libc_cleanup_region_end): Execute registered function directly if
9781         pthread functions are not available.
9782         (__libc_cleanup_end): Likewise.
9784         * init.c (__pthread_initialize_minimal): Fix initialization in
9785         static lib by preventing gcc from being too clever.
9787 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9789         * init.c (__pthread_initialize_minimal): Remove unneccesary
9790         sigaddset call.
9792         * Makefile (tests): We can run tst-locale2 now.
9794 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9796         * Versions: Remove duplicated sigwait entry.
9798 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9800         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9801         inside libpthread.
9803         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9805         * pthreadP.h: Declare __pthread_enable_asynccancel and
9806         __pthread_disable_asynccancel.
9807         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9808         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9809         * cancellation.c (__pthread_enable_asynccancel): New function.
9810         (__pthread_disable_asynccancel): New function.
9811         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9812         * pt-close.c: Likewise.
9813         * pt-connect.c: Likewise.
9814         * pt-creat.c: Likewise.
9815         * pt-fcntl.c: Likewise.
9816         * pt-fsync.c: Likewise.
9817         * pt-lseek.c: Likewise.
9818         * pt-lseek64.c: Likewise.
9819         * pt-msgrcv.c: Likewise.
9820         * pt-msgsnd.c: Likewise.
9821         * pt-msync.c: Likewise.
9822         * pt-nanosleep.c: Likewise.
9823         * pt-open.c: Likewise.
9824         * pt-open64.c: Likewise.
9825         * pt-pause.c: Likewise.
9826         * pt-poll.c: Likewise.
9827         * pt-pread.c: Likewise.
9828         * pt-pread64.c: Likewise.
9829         * pt-pselect.c: Likewise.
9830         * pt-pwrite.c: Likewise.
9831         * pt-pwrite64.c: Likewise.
9832         * pt-read.c: Likewise.
9833         * pt-readv.c: Likewise.
9834         * pt-recv.c: Likewise.
9835         * pt-recvfrom.c: Likewise.
9836         * pt-recvmsg.c: Likewise.
9837         * pt-select.c: Likewise.
9838         * pt-send.c: Likewise.
9839         * pt-sendmsg.c: Likewise.
9840         * pt-sendto.c: Likewise.
9841         * pt-sigpause.c: Likewise.
9842         * pt-sigsuspend.c: Likewise.
9843         * pt-sigtimedwait.c: Likewise.
9844         * pt-sigwait.c: Likewise.
9845         * pt-sigwaitinfo.c: Likewise.
9846         * pt-system.c: Likewise.
9847         * pt-tcdrain.c: Likewise.
9848         * pt-wait.c: Likewise.
9849         * pt-waitid.c: Likewise.
9850         * pt-waitpid.c: Likewise.
9851         * pt-write.c: Likewise.
9852         * pt-writev.c: Likewise.
9853         * pthread_join.c: Likewise.
9854         * pthread_timedjoin.c: Likewise.
9856         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9857         (__xpg_sigpause): New function.
9858         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9860 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
9862         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
9864         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
9865         _GI_pthread_cleanup_pop to pthreadP.h.
9867         * ftrylockfile.c: Use _IO_lock_trylock instead of
9868         pthread_mutex_trylock.
9870         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
9871         (CANCEL_RESET): Likewise.
9872         (__pthread_setcanceltype_): Declare.
9873         (__pthread_mutex_lock_internal): Declare.
9874         (__pthread_mutex_unlock_internal): Declare.
9875         (__pthread_once_internal): Declare.
9876         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
9877         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
9879         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
9880         and pthread_mutex_unlock.
9881         * pthread_cond_wait.c: Likewise.
9882         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
9883         * pthread_mutex_unlock.c: Likewise.
9885         * pthread_setcanceltype.c: Add additional alias
9886         __pthread_setcanceltype.
9888         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
9889         * sem_open.c (sem_open): Likewise.
9890         Use __libc_open, __libc_write, and __libc_close instead of
9891         open, write, and close respectively.
9893         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
9894         Rewrite as statement expression since it must return a value.
9896         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
9897         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
9898         __pthread_kill.
9900         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
9901         alias __pthread_once_internal.
9903         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
9905 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
9907         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
9908         * tst-stdio1.c: New file.
9909         * tst-stdio2.c: New file.
9911         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
9913         * Makefile (tests): Comment out tst-locale2 for now.
9914         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
9916         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
9917         -D_IO_MTSAFE_IO.
9918         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
9919         Use _IO_lock_init instead of explicit assignment.
9921         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
9922         Define __libc_lock_* and __libc_lock_recursive macros with
9923         lowlevellock macros, not pthread mutexes.
9925         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
9926         of pthread_mutex_lock.
9927         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
9928         instead of pthread_mutex_unlock.
9930 2002-12-06  Roland McGrath  <roland@redhat.com>
9932         * allocatestack.c (__stack_user): Use uninitialized defn.
9933         * init.c (__pthread_initialize_minimal): Initialize it here.
9935 2002-12-05  Roland McGrath  <roland@redhat.com>
9937         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
9938         string.
9939         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
9941         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
9942         missing & here too.
9944 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
9946         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9947         lowlevellock.
9948         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
9949         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
9950         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
9951         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
9952         for __libc_lock_* macros.
9953         * Makefile (routines): Add libc-lowlevellock.
9955 2002-10-09  Roland McGrath  <roland@redhat.com>
9957         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
9958         Under [__PIC__], call the function via the pointer fetched for
9959         comparison rather than a call by name that uses the PLT.
9960         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
9961         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
9962         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
9963         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
9964         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
9966 2002-12-04  Roland McGrath  <roland@redhat.com>
9968         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
9970         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
9971         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
9973         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
9975 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9977         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
9978         a completely opaque, non-integer type.
9979         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9981 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
9983         * sysdeps/i386/tls.h: Include stdlib.h.
9984         * sysdeps/x86_64/tls.h: Likewise.
9986 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9988         * Makefile (tests): Add tst-locale2.
9989         (tests-static): Likewise.
9990         * tst-locale2.c: New file.
9992         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
9993         volatile and add memory clobbers to lock operations.
9995 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
9997         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
9998         * sysdeps/i386/i486/bits/atomic.h: New file.
9999         * sysdeps/i386/i586/bits/atomic.h: New file.
10000         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10001         include i486 version.
10002         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10003         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10004         Patch by Marijn Ros <marijn@mad.scientist.com>.
10006         * allocatestack.c (get_cached_stack): Don't crash if we first
10007         found a stack with a larger size then needed.
10008         Reported by Hui Huang <hui.huang@sun.com>.
10010         * Makefile (tests): Add tst-sysconf.
10011         * tst-sysconf.c: New file.
10013         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10014         PTHREAD_THREADS_MAX.
10016 2002-12-02  Roland McGrath  <roland@redhat.com>
10018         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10019         Declare using hidden_proto instead of attribute_hidden, so there are
10020         non-.hidden static symbols for gdb to find.
10021         (__pthread_keys): Likewise.
10022         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10023         * allocatestack.c (__stack_user): Likewise.
10024         * pthread_create.c (__pthread_keys): Likewise.
10025         (__nptl_threads_events, __nptl_last_event): Make these static instead
10026         of hidden.
10027         * pthread_key_create.c (__pthread_pthread_keys_max,
10028         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10030 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10032         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10033         statically.
10034         * tst-locale1.c: New file.
10036         * pthread_cond_timedwait.c: Include <stdlib.h>.
10038         * Makefile (tests): Add tst-fork2 and tst-fork3.
10039         * tst-fork2.c: New file.
10040         * tst-fork3.c: New file.
10042 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10044         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10046         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10047         require it to 200112L.
10049         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10050         instruction only if HAVE_CMOV is defined.
10051         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10053         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10055         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10057         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10059         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10061 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10063         * sysdeps/x86_64/bits/atomic.h: New file.
10065         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10066         16-bit operations.
10068         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10069         possible since gettid cannot fail.
10071         * sysdeps/x86_64/pthreaddef.h: New file.
10073         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10075         * sysdeps/x86_64/pthread_spin_init.c: New file.
10076         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10077         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10078         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10080         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10081         Add missing lock prefix.  Minute optimization.
10083         * tst-spin2.c (main): Also check successful trylock call.
10085         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10086         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10088         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10089         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10091         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10092         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10093         value in case of an error.  Add support for INTERNAL_SYSCALL.
10095         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10096         value in case of an error.
10098         * sysdeps/x86_64/tls.h: New file.
10100 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10102         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10103         takes the array member name and the index as parameters.
10104         (THREAD_SETMEM_NC): Likewise.
10105         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10106         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10107         interfaces.
10109         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10110         to decide which code to use.
10111         (THREAD_SETMEM_NC): Likewise.
10113         * allocatestack.c (queue_stack): Don't remove stack from list here.
10114         Do it in the caller.  Correct condition to prematurely terminate
10115         loop to free stacks.
10116         (__deallocate_stack): Remove stack from list here.
10118 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10120         * Makefile (tests): Add tst-stack1.
10121         * tst-stack1.c: New file.
10123         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10124         provided stack.
10126         * pthread_attr_getstack.c: Return bottom of the thread area.
10128 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10130         * Makefile (libpthread-routines): Add pt-allocrtsig and
10131         pthread_kill_other_threads.
10132         * pt-allocrtsig.c: New file.
10133         * pthread_kill_other_threads.c: New file.
10134         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10135         all three functions.
10136         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10137         allocrtsig.
10138         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10139         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10140         and __libc_allocate_rtsig_private.
10141         * Versions (libpthread): Export pthread_kill_other_threads_np,
10142         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10144 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10146         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10147         the end of the stack.  Adjust computations.
10148         When mprotect call fails dequeue stack and free it.
10149         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10150         attribute.
10151         * pthread_getattr_np.c: Likewise.
10153         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10154         surprises.
10156 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10158         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10159         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10161 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10163         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10164         * pthread_setspecific.c: Likewise.
10166 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10168         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10169         definitions.  Get them from the official place.
10170         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10172         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10173         Use new CLONE_ flags in clone() calls.
10175         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10176         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10178         * Versions: Add pthread_* functions for libc.
10179         * forward.c: New file.
10181         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10182         errno-loc.
10183         * herrno.c: New file.
10184         * res.c: New file.
10186         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10187         sem_trywait, and sem_timedwait.  Add herrno and res.
10188         * sem_init.c: Don't initialize lock and waiters members.
10189         * sem_open.c: Likewise.
10190         * sem_post.c: Removed.
10191         * sem_wait.c: Removed.
10192         * sem_trywait.c: Removed.
10193         * sem_timedwait.c: Removed.
10194         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10195         Includes full implementations of sem_post, sem_wait, sem_trywait,
10196         and sem_timedwait.
10197         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10198         for new implementation.
10199         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10200         and waiters fields.
10202         * tst-sem3.c: Improve error message.
10203         * tst-signal3.c: Likewise.
10205         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10206         to tell the kernel about the termination futex and to initialize tid
10207         member.  Don't initialize main_thread.
10208         * descr.h (struct pthread): Remove main_thread member.
10209         * cancelllation.c (__do_cancel): Remove code handling main thread.
10210         The main thread is not special anymore.
10212         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10213         size of the stacks to stack_cache_actsize.
10215         * pt-readv.c: Add missing "defined".
10216         * pt-sigwait.c: Likewise.
10217         * pt-writev.c: Likewise.
10219 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10221         * Versions: Export __connect from libpthread.
10222         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10224         * Makefile (libpthread-routines): Add pt-raise.
10225         * sysdeps/unix/sysv/linux/raise.c: New file.
10226         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10227         * sysdeps/generic/pt-raise.c: New file.
10229         * pthread_cond_init.c: Initialize all data elements of the condvar
10230         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10232         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10233         * pthread_create.c: Likewise.
10235         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10236         * tst-key1.c: New file.
10237         * tst-key2.c: New file.
10238         * tst-key3.c: New file.
10240         * Versions: Export pthread_detach for version GLIBC_2.0.
10241         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10243 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10245         * pthread_key_create.c: Terminate search after an unused key was found.
10246         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10248         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10249         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10251 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10253         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10254         dynamic lookup for errno in PIC.
10256         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10257         release the stack lock as soon as possible.
10258         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10259         the static TLS block.
10260         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10262         * cancellation.c: Renamed from cancelation.c.
10263         * Makefile: Adjust accordingly.
10264         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10265         * cleanup_defer.c: Use CANCELLATION_P.
10266         * pthread_testcancel.c: Likewise.
10267         * descr.h: Fix spelling in comments.
10268         * init.c: Likewise.
10269         * pthread_getattr_np.c: Likewise.
10270         * pthread_getschedparam.c: Likewise.
10271         * pthread_setschedparam.c: Likewise.
10272         * Versions: Likewise.
10274         * pt-pselect.c: New file.
10275         * Makefile (libpthread-routines): Add pt-pselect.
10276         * Versions: Add pselect.
10278         * tst-cancel4.c: New file.
10279         * Makefile (tests): Add tst-cancel4.
10281 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10283         * pthread_mutex_lock.c: Always record lock ownership.
10284         * pthread_mutex_timedlock.c: Likewise.
10285         * pthread_mutex_trylock.c: Likewise.
10287         * pt-readv.c: New file.
10288         * pt-writev.c: New file.
10289         * pt-creat.c: New file.
10290         * pt-msgrcv.c: New file.
10291         * pt-msgsnd.c: New file.
10292         * pt-poll.c: New file.
10293         * pt-select.c: New file.
10294         * pt-sigpause.c: New file.
10295         * pt-sigsuspend.c: New file.
10296         * pt-sigwait.c: New file.
10297         * pt-sigwaitinfo.c: New file.
10298         * pt-waitid.c: New file.
10299         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10300         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10301         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10302         * Versions: Add all the new functions.
10304         * tst-exit1.c: New file.
10305         * Makefile (tests): Add tst-exit1.
10307         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10309 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10311         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10313         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10314         call.  pthread_join is an official cancellation point.
10315         * pthread_timedjoin.c: Likewise.
10317         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10318         and the condvar's mutex are retrieved.
10319         * pthread_cond_timedwait.c: Likewise.
10320         Reported by dice@saros.East.Sun.COM.
10322 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10324         * pthreadP.h: Cut out all type definitions and move them...
10325         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10326         * pthreadP.h: Include <internaltypes.h>.
10328         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10329         performance tweaks.
10331         * sem_trywait.c: Shuffle #includes around to get right order.
10332         * sem_timedwait.c: Likewise.
10333         * sem_post.c: Likewise.
10334         * sem_wait.c: Likewise.
10336         * nptl 0.3 released.
10338         * Makefile (tests): Add tst-signal3.
10339         * tst-signal3.c: New file.
10341 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10343         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10344         the asms modify the sem object.
10345         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10347         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10348         the actual members.
10349         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10350         * semaphoreP.h: Include pthreadP.h.
10351         * sem_getvalue.c: Adjust to sem_t change.
10352         * sem_init.c: Likewise.
10353         * sem_open.c: Likewise.
10354         * sem_post.c: Likewise.
10355         * sem_timedwait.c: Likewise.
10356         * sem_trywait.c: Likewise.
10357         * sem_wait.c: Likewise.
10359 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10361         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10362         * tst-basic2.c: New file.
10363         * tst-exec1.c: New file.
10364         * tst-exec2.c: New file.
10365         * tst-exec3.c: New file.
10367         * tst-fork1.c: Remove extra */.
10369         * nptl 0.2 released.  The API for IA-32 is complete.