* sysdeps/x86_64/memset.S: Jump from bzero to memset using
[glibc/pb-stable.git] / nptl / ChangeLog
blob85edbbe11dc5c0264936083f63b69d19706dba6a
1 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
3         * init.c (__pthread_initialize_minimal): Initialize word to appease
4         valgrind.
6 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
8         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
9         libc.so just clear NAME.
10         (__libc_rwlock_fini): Nop inside of libc.so.
11         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
12         all zeros.
14 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
16         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
17         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
18         unlocking failed.
19         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
21 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
23         [BZ #4938]
24         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
25         reclaimed stack if necessary.
26         * Makefile (tests): Add tst-tsd6.
27         * tst-tsd6.c: New file.
29 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
31         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
32         Add private argument.
34 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
36         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
37         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
39 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
41         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
42         (__lll_robust_timedlock): Pass private as last argument to
43         __lll_robust_timedlock_wait.
44         (__lll_unlock): Fix a pasto.
46 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
48         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
49         sparc_old_sem): New structs.
50         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
51         (__sem_wait_cleanup): New function.
52         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
53         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
54         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
55         lll_futex_wait.
56         (__old_sem_wait): New function.
57         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
58         nptl/sysdeps/unix/sysv/linux/sparc version.
59         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
60         Likewise.
61         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
62         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
63         (__new_sem_trywait): Use sparc_old_sem structure.
64         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
65         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
66         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
67         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
68         lll_futex_timed_wait.
69         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
70         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
71         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
72         lll_futex_wake.
73         (__old_sem_post): New function.
74         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
75         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
76         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
77         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
78         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
79         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
81 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
83         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
84         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
85         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
86         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
87         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
88         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
89         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
90         Use FUTEX_WAKE_OP.
91         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
92         kernel-features.h and tcb-offsets.h.
93         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
94         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
95         process private.
96         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
97         tcb-offsets.h.
98         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
99         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
100         process private.
101         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
102         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
103         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
104         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
105         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
106         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
107         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
109 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
111         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
112         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
113         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
114         lll_futex_timed_wait.
116         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
117         __lll_robust_unlock): Rewrite as macros instead of inline functions.
118         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
119         __lll_robust_unlock, __lll_wait_tid): Likewise.
121 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
123         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
124         Fix a pasto.
125         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
126         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
127         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
128         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
130         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
131         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
132         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
133         kernel-features.h.
134         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
135         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
136         process private.  Switch DW_CFA_advance_loc1 and some
137         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
139         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
140         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
141         process private.  Switch DW_CFA_advance_loc{1,2} and some
142         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
143         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
144         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
145         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
146         Likewise.
147         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
148         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
149         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
150         Likewise.
151         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
152         (__pthread_cond_broadcast): Compare %r8 instead of
153         dep_mutex-cond_*(%rdi) with $-1.
154         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
155         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
156         of oring.
158 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
160         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
162 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
164         * allocatestack.c: Include kernel-features.h.
165         * pthread_create.c: Likewise.
166         * pthread_mutex_init.c: Likewise.
167         * init.c: Likewise.
168         * pthread_cond_timedwait.c: Likewise.
169         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
170         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
171         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
172         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
173         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
174         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
175         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
176         Likewise.
177         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
178         Likewise.
179         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
180         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
181         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
182         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
184 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
186         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
187         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
188         byte elements.  One of them is the new __shared element.
189         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
190         adjust names of other padding elements.
191         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
192         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
193         byte elements.  One of them is the new __shared element.
194         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
195         adjust names of other padding elements.
196         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
197         Renamed __pad1 element to __shared, adjust names of other padding
198         elements.
199         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
200         (pthread_rwlock_t): Likewise.
201         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
202         typo.
204 2007-08-09  Anton Blanchard  <anton@samba.org>
206         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
208 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
210         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
211         <kernel-features.h>.
212         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
214 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
216         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
217         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
218         dealing with robust mutexes.
219         * pthread_mutex_timedlock.c: Likewise.
220         * pthread_mutex_trylock.c: Likewise.
221         * pthread_mutex_unlock.c: Likewise.
222         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
224 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
226         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
227         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
228         (PTHREAD_MUTEX_PSHARED): Define.
229         * pthread_mutex_init.c (__pthread_mutex_init): Set
230         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
231         mutexes.
232         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
233         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
234         as second argument to lll_lock.
235         (LLL_MUTEX_TRYLOCK): Take mutex as argument
236         instead of its __data.__lock field.
237         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
238         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
239         to lll_robust_lock.
240         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
241         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
242         instead of mutex->__data.__kind directly, pass
243         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
244         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
245         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
246         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
247         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
248         to lll_timedlock, lll_robust_timedlock, lll_unlock and
249         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
250         of mutex->__data.__kind directly.
251         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
252         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
253         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
254         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
255         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
256         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
257         and lll_futex_wake.
258         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
259         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
260         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
261         directly.
262         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
263         Take mutex as argument instead of its __data.__lock field, pass
264         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
265         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
266         __data.__lock field.
267         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
268         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
269         to lll_robust_cond_lock.
270         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
271         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
272         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
273         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
274         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
275         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
276         lll_futex_wait.
277         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
278         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
279         lll_futex_wake.
280         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
281         pshared variable, pass it to lll_lock, lll_unlock,
282         lll_futex_timedwait and lll_futex_wake.
283         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
284         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
285         and lll_futex_wake.
286         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
287         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
288         macro.
289         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
290         lll_futex_wake_unlock): Likewise.
291         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
292         Likewise.
293         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
294         lll_futex_wake_unlock): Likewise.
295         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
296         Likewise.
297         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
298         lll_futex_wake_unlock): Likewise.
299         (lll_futex_wake): Fix a typo.
300         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
301         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
302         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
303         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
304         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
305         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
306         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
307         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
308         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
309         (__pthread_cond_timedwait): Likewise.
310         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
311         (__condvar_cleanup, __pthread_cond_wait): Likewise.
313 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
315         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
316         Don't use CGOTSETUP and CGOTRESTORE macros.
317         (CGOTSETUP, CGOTRESTORE): Remove.
318         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
319         @local symbol.
321 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
323         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
324         definitions for private futexes.
325         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
326         kernel-features.h and lowlevellock.h.  Use private futexes if
327         they are available.
328         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
329         (__lll_mutex_lock_wait): Rename to
330         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
331         (__lll_mutex_timedlock_wait): Rename to ...
332         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
333         Don't compile in for libc.so.
334         (__lll_mutex_unlock_wake): Rename to ...
335         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
336         (__lll_timedwait_tid): Use __NR_gettimeofday.
337         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
338         the header from assembler.  Renamed all lll_mutex_* resp.
339         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
340         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
341         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
342         Define.
343         (__lll_lock_wait_private): Add prototype.
344         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
345         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
346         __lll_unlock_wake): Likewise.
347         (lll_lock): Add private argument.  Call __lll_lock_wait_private
348         if private is constant LLL_PRIVATE.
349         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
350         lll_timedlock, lll_robust_timedlock): Add private argument.
351         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
352         if private is constant LLL_PRIVATE.
353         (lll_robust_unlock, lll_robust_dead): Add private argument.
354         (lll_lock_t): Remove.
355         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
356         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
357         lll_cond_wake, lll_cond_broadcast): Remove.
358         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
359         kernel-features.h and lowlevellock.h.
360         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
361         (LOAD_FUTEX_WAIT): Define.
362         (__lll_robust_mutex_lock_wait): Rename to ...
363         (__lll_robust_lock_wait): ... this.  Add private argument.
364         Use LOAD_FUTEX_WAIT macro.
365         (__lll_robust_mutex_timedlock_wait): Rename to ...
366         (__lll_robust_timedlock_wait): ... this.    Add private argument.
367         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
368         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
369         lowlevellock.h.
370         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
371         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
372         __lll_mutex_{lock,unlock}_*.
373         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
374         lowlevellock.h and pthread-errnos.h.
375         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
376         FUTEX_CMP_REQUEUE, EINVAL): Remove.
377         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
378         __lll_mutex_{lock,unlock}_*.
379         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
380         lowlevellock.h and pthread-errnos.h.
381         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
382         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
383         __lll_mutex_{lock,unlock}_*.
384         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
385         lowlevellock.h.
386         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
387         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
388         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
389         (__condvar_tw_cleanup): Likewise.
390         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
391         lowlevellock.h.
392         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
393         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
394         __lll_mutex_{lock,unlock}_*.
395         ( __condvar_w_cleanup): Likewise.
396         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
397         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
398         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
399         lowlevellock.h.
400         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
401         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
402         __lll_mutex_{lock,unlock}_*.
403         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
404         lowlevellock.h.
405         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
406         FUTEX_PRIVATE_FLAG): Remove.
407         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
408         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
409         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
410         lowlevellock.h.
411         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
412         FUTEX_PRIVATE_FLAG): Remove.
413         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
414         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
415         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
416         lowlevellock.h.
417         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
418         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
419         __lll_mutex_{lock,unlock}_*.
420         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
421         lowlevellock.h.
422         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
423         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
424         __lll_mutex_{lock,unlock}_*.
425         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
426         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
427         (__new_sem_post): Use standard initial exec code sequences.
428         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
429         lowlevellock.h.
430         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
431         FUTEX_PRIVATE_FLAG): Remove.
432         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
433         exec code sequences.
434         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
435         (__new_sem_trywait): Use standard initial exec code sequences.
436         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
437         (__new_sem_wait): Use standard initial exec code sequences.
439 2007-07-31  Anton Blanchard  <anton@samba.org>
441         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
442         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
443         atomic_full_barrier.
445 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
447         * allocatestack.c (stack_cache_lock): Change type to int.
448         (get_cached_stack, allocate_stack, __deallocate_stack,
449         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
450         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
451         as second argument to lll_lock and lll_unlock macros on
452         stack_cache_lock.
453         * pthread_create.c (__find_in_stack_list): Likewise.
454         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
455         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
456         as second argument.
457         * descr.h (struct pthread): Change lock and setxid_futex field
458         type to int.
459         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
460         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
461         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
462         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
463         Likewise.
464         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
465         * pthread_cond_init.c (__pthread_cond_init): Likewise.
466         * pthreadP.h (__attr_list_lock): Change type to int.
467         * pthread_attr_init.c (__attr_list_lock): Likewise.
468         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
469         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
470         lll_{,un}lock.
471         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
472         also for lll_futex_{wake,wait}.
473         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
474         a pointer to const.
475         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
476         LLL_SHARED as second argument to lll_{,un}lock.
477         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
478         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
479         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
480         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
481         Likewise.
482         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
483         as second argument to lll_{,un}lock macros on pd->lock.
484         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
485         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
486         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
487         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
488         Likewise.
489         * sysdeps/pthread/createthread.c (do_clone, create_thread):
490         Likewise.
491         * pthread_once.c (once_lock): Change type to int.
492         (__pthread_once): Pass LLL_PRIVATE as second argument to
493         lll_{,un}lock macros on once_lock.
494         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
495         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
496         rwlock->__data.__shared as second argument to them and similarly
497         for lll_futex_w*.
498         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
499         Likewise.
500         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
501         Likewise.
502         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
503         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
504         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
505         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
506         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
507         to lll_{,un}lock macros on __sem_mappings_lock.
508         * sem_open.c (check_add_mapping): Likewise.
509         (__sem_mappings_lock): Change type to int.
510         * semaphoreP.h (__sem_mappings_lock): Likewise.
511         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
512         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
513         instead of lll_*mutex_*, pass LLL_SHARED as last
514         argument.
515         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
516         pass LLL_SHARED as last argument.
517         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
518         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
519         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
520         pass LLL_SHARED as last argument.
521         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
522         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
523         LLL_SHARED as last argument.
524         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
525         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
526         Similarly.
527         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
528         __libc_lock_lock_recursive, __libc_lock_unlock,
529         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
530         argument to lll_{,un}lock.
531         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
532         _IO_lock_unlock): Likewise.
533         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
534         compound literal.
535         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
536         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
537         __fork_lock.
538         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
539         free_mem): Likewise.
540         (__fork_lock): Change type to int.
541         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
542         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
543         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
544         lll_futex_wake.
545         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
546         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
547         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
548         New function.
549         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
550         pass it through to lll_futex_*wait, only compile in when
551         IS_IN_libpthread.
552         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
553         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
554         argument and pass it through to lll_futex_*wait.
555         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
556         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
557         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
558         inline functions to __lll_* resp. __lll_robust_*.
559         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
560         (lll_mutex_dead): Add private argument.
561         (__lll_lock_wait_private): New prototype.
562         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
563         __lll_robust_lock_timedwait): Add private argument to prototypes.
564         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
565         call __lll_lock_wait_private, otherwise pass private to
566         __lll_lock_wait.
567         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
568         __lll_robust_timedlock): Add private argument, pass it to
569         __lll_*wait functions.
570         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
571         call __lll_unlock_wake_private, otherwise pass private to
572         __lll_unlock_wake.
573         (__lll_robust_unlock): Add private argument, pass it to
574         __lll_robust_unlock_wake.
575         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
576         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
577         argument, pass it through to __lll_* inline function.
578         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
579         (lll_lock_t): Remove.
580         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
581         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
582         lll_cond_wake, lll_cond_broadcast): Remove.
583         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
584         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
585         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
586         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
587         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
588         the header from assembler.  Renamed all lll_mutex_* resp.
589         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
590         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
591         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
592         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
593         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
594         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
595         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
596         Remove prototype.
597         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
598         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
599         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
600         (lll_trylock): Likewise, use __lll_trylock_asm, pass
601         MULTIPLE_THREADS_OFFSET as another asm operand.
602         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
603         MULTIPLE_THREADS_OFFSET as last asm operand, call
604         __lll_lock_wait_private if private is constant LLL_PRIVATE,
605         otherwise pass private as another argument to __lll_lock_wait.
606         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
607         lll_timedlock, lll_robust_timedlock): Add private argument, pass
608         private as another argument to __lll_*lock_wait call.
609         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
610         MULTIPLE_THREADS_OFFSET as another asm operand, call
611         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
612         otherwise pass private as another argument to __lll_unlock_wake.
613         (lll_robust_unlock): Add private argument, pass private as another
614         argument to __lll_unlock_wake.
615         (lll_robust_dead): Add private argument, use __lll_private_flag
616         macro.
617         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
618         LLL_MUTEX_LOCK_INITIALIZER.
619         (lll_lock_t): Remove.
620         (LLL_LOCK_INITIALIZER_WAITERS): Define.
621         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
622         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
623         lll_cond_wake, lll_cond_broadcast): Remove.
624         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
625         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
626         2007-05-2{3,9} changes.
627         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
628         kernel-features.h and lowlevellock.h.
629         (LOAD_PRIVATE_FUTEX_WAIT): Define.
630         (LOAD_FUTEX_WAIT): Rewritten.
631         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
632         define.
633         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
634         (__lll_mutex_lock_wait): Rename to ...
635         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
636         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
637         (__lll_mutex_timedlock_wait): Rename to ...
638         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
639         contains private argument.  Don't compile in for libc.so.
640         (__lll_mutex_unlock_wake): Rename to ...
641         (__lll_unlock_wake): ... this.  %ecx contains private argument.
642         Don't compile in for libc.so.
643         (__lll_timedwait_tid): Use __NR_gettimeofday.
644         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
645         kernel-features.h and lowlevellock.h.
646         (LOAD_FUTEX_WAIT): Define.
647         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
648         define.
649         (__lll_robust_mutex_lock_wait): Rename to ...
650         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
651         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
652         macro.
653         (__lll_robust_mutex_timedlock_wait): Rename to ...
654         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
655         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
656         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
657         lowlevellock.h.
658         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
659         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
660         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
661         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
662         to __lll_lock_wait in %edx.
663         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
664         Include lowlevellock.h and pthread-errnos.h.
665         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
666         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
667         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
668         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
669         pass LLL_SHARED in %ecx to both __lll_lock_wait and
670         __lll_unlock_wake.
671         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
672         Include lowlevellock.h and pthread-errnos.h.
673         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
674         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
675         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
676         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
677         pass LLL_SHARED in %ecx to both __lll_lock_wait and
678         __lll_unlock_wake.
679         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
680         Include lowlevellock.h.
681         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
682         Don't define.
683         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
684         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
685         pass LLL_SHARED in %ecx to both __lll_lock_wait and
686         __lll_unlock_wake.  Use __NR_gettimeofday.
687         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
688         Include lowlevellock.h.
689         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
690         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
691         to __lll_*, pass cond_lock address in %edx rather than %ecx to
692         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
693         and __lll_unlock_wake.
694         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
695         Include lowlevellock.h.
696         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
697         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
698         MUTEX(%ebx) address in %edx rather than %ecx to
699         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
700         and __lll_unlock_wake.  Move return value from %ecx to %edx
701         register.
702         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
703         Include lowlevellock.h.
704         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
705         Don't define.
706         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
707         MUTEX(%ebp) address in %edx rather than %ecx to
708         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
709         and __lll_unlock_wake.  Move return value from %ecx to %edx
710         register.  Use __NR_gettimeofday.
711         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
712         Include lowlevellock.h.
713         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
714         Don't define.
715         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
716         MUTEX(%ebp) address in %edx rather than %ecx to
717         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
718         and __lll_unlock_wake.  Move return value from %ecx to %edx
719         register.  Use __NR_gettimeofday.
720         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
721         Include lowlevellock.h.
722         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
723         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
724         MUTEX(%edi) address in %edx rather than %ecx to
725         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
726         and __lll_unlock_wake.
727         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
728         Include lowlevellock.h.
729         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
730         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
731         MUTEX(%ebx) address in %edx rather than %ecx to
732         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
733         and __lll_unlock_wake.  Move return value from %ecx to %edx
734         register.
735         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
736         lowlevellock.h.
737         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
738         define.
739         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
740         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
741         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
742         lowlevellock.h.
743         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
744         (sem_timedwait): Use __NR_gettimeofday.
745         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
746         lowlevellock.h.
747         (LOCK): Don't define.
748         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
749         lowlevellock.h.
750         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
751         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
752         are waiters.
753         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
754         2007-05-2{3,9} changes.
755         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
756         kernel-features.h and lowlevellock.h.
757         (LOAD_PRIVATE_FUTEX_WAIT): Define.
758         (LOAD_FUTEX_WAIT): Rewritten.
759         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
760         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
761         (__lll_mutex_lock_wait): Rename to ...
762         (__lll_lock_wait): ... this.  %esi is now private argument.
763         Don't compile in for libc.so.
764         (__lll_mutex_timedlock_wait): Rename to ...
765         (__lll_timedlock_wait): ... this.  %esi contains private argument.
766         Don't compile in for libc.so.
767         (__lll_mutex_unlock_wake): Rename to ...
768         (__lll_unlock_wake): ... this.  %esi contains private argument.
769         Don't compile in for libc.so.
770         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
771         kernel-features.h and lowlevellock.h.
772         (LOAD_FUTEX_WAIT): Define.
773         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
774         (__lll_robust_mutex_lock_wait): Rename to ...
775         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
776         Use LOAD_FUTEX_WAIT macro.
777         (__lll_robust_mutex_timedlock_wait): Rename to ...
778         (__lll_robust_timedlock_wait): ... this. %esi argument contains
779         private, use LOAD_FUTEX_WAIT macro.
780         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
781         lowlevellock.h.
782         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
783         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
784         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
785         __lll_lock_wait and __lll_unlock_wake.
786         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
787         Include lowlevellock.h and pthread-errnos.h.
788         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
789         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
790         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
791         pass LLL_SHARED in %esi to both __lll_lock_wait and
792         __lll_unlock_wake.
793         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
794         Include lowlevellock.h and pthread-errnos.h.
795         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
796         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
797         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
798         pass LLL_SHARED in %esi to both __lll_lock_wait and
799         __lll_unlock_wake.
800         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
801         Include lowlevellock.h.
802         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
803         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
804         pass LLL_SHARED in %esi to both __lll_lock_wait and
805         __lll_unlock_wake.
806         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
807         Include lowlevellock.h.
808         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
809         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
810         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
811         and __lll_unlock_wake.
812         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
813         Include lowlevellock.h.
814         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
815         Don't define.
816         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
817         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
818         and __lll_unlock_wake.
819         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
820         Include lowlevellock.h.
821         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
822         Don't define.
823         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
824         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
825         and __lll_unlock_wake.
826         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
827         Include lowlevellock.h.
828         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
829         Don't define.
830         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
831         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
832         and __lll_unlock_wake.
833         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
834         Include lowlevellock.h.
835         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
836         Don't define.
837         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
838         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
839         and __lll_unlock_wake.
840         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
841         Include lowlevellock.h.
842         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
843         Don't define.
844         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
845         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
846         and __lll_unlock_wake.
847         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
848         lowlevellock.h.
849         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
850         define.
851         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
852         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
853         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
854         lowlevellock.h.
855         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
856         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
857         lowlevellock.h.
858         (LOCK): Don't define.
859         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
860         lowlevellock.h.
861         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
862         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
863         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
864         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
865         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
866         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
867         (__lll_lock_wait_private): New function.
868         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
869         it to lll_futex_*wait.  Don't compile in for libc.so.
870         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
871         Remove.
872         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
873         (struct sparc_pthread_barrier): Remove.
874         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
875         struct sparc_pthread_barrier.  Pass
876         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
877         and lll_futex_wait macros.
878         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
879         Remove.
880         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
881         Include sparc pthread_barrier_wait.c instead of generic one.
883 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
885         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
887         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
888         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
889         %ecx.
890         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
891         (pthread_rwlock_timedwrlock): Likewise.
892         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
893         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
895 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
897         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
899 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
901         * tst-locale2.c (useless): Add return statement.
903 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
905         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
906         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
907         * pthread_create.c (start_thread): Likewise.
908         * init.c (sighandler_setxid): Likewise.
909         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
910         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
911         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
912         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
913         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
914         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
915         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
916         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
917         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
918         Likewise.
919         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
920         Likewise.
921         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
922         Likewise.
923         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
924         __rtld_notify): Likewise.
925         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
926         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
927         __pthread_once): Likewise.
928         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
929         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
930         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
931         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
932         (lll_futex_wait): Add private argument, define as wrapper around
933         lll_futex_timed_wait.
934         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
935         use __lll_private_flag macro.
936         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
937         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
938         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
939         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
940         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
941         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
942         (lll_futex_wait): Add private argument, define as wrapper around
943         lll_futex_timed_wait.
944         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
945         use __lll_private_flag macro.
946         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
947         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
948         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
949         Define.
950         (lll_futex_timed_wait, lll_futex_wake): Use it.
951         (lll_private_futex_wait, lll_private_futex_timed_wait,
952         lll_private_futex_wake): Removed.
953         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
954         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
955         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
956         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
957         (lll_futex_wait): Add private argument, define as wrapper around
958         lll_futex_timed_wait.
959         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
960         use __lll_private_flag macro.
961         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
962         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
963         to lll_futex_*.
964         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
965         (lll_private_futex_wait, lll_private_futex_timed_wait,
966         lll_private_futex_wake): Removed.
967         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
968         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
969         (lll_private_futex_wait, lll_private_futex_timed_wait,
970         lll_private_futex_wake): Removed.
971         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
972         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
973         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
974         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
975         (lll_futex_wait): Add private argument, define as wrapper around
976         lll_futex_timed_wait.
977         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
978         use __lll_private_flag macro.
979         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
980         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
981         to lll_futex_*.
982         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
983         Define.
984         (lll_futex_timed_wait, lll_futex_wake): Use it.
985         (lll_private_futex_wait, lll_private_futex_timed_wait,
986         lll_private_futex_wake): Removed.
988 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
990         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
991         of the structure for sparc32.
993 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
995         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
997 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
999         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1000         code used when private futexes are assumed.
1001         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1002         Likewise.
1004 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1006         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1007         (__lll_private_flag): Define.
1008         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1009         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1010         __lll_private_flag.
1011         (lll_private_futex_wait, lll_private_futex_timedwait,
1012         lll_private_futex_wake): Define as wrapper around non-_private
1013         macros.
1014         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1015         (__lll_private_flag): Define.
1016         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1017         (lll_private_futex_wait, lll_private_futex_timedwait,
1018         lll_private_futex_wake): Define as wrapper around non-_private
1019         macros.
1021 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1023         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1024         parameter to lll_futex_wait call.
1025         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1027         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1028         Replace lll_futex_wait with lll_private_futex_wait.
1029         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1030         Add LLL_SHARED parameter to lll_futex_wake().
1032         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1033         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1034         lll_private_futex_wake.
1035         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1036         bit from private parm before syscall.
1037         (lll_futex_timed_wait): Likewise.
1038         (lll_futex_wake): Likewise.
1039         (lll_futex_wake_unlock): Likewise.
1040         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1041         (lll_robust_mutex_unlock): Likewise.
1042         (lll_mutex_unlock_force): Likewise.
1043         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1045 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1047         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1048         compilation when unconditionally using private futexes.
1049         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1050         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1051         Likewise.
1052         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1053         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1055 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1057         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1058         Define.
1060 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1062         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1063         kernel-features.h.
1065 2007-05-16  Roland McGrath  <roland@redhat.com>
1067         * init.c (__nptl_initial_report_events): New variable.
1068         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1069         to that.
1071 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1073         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1074         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1076 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1078         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1079         implementation.
1081 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1083         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1084         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1085         * pthread_mutex_timedlock.c: Likewise.
1086         * pthread_mutex_trylock.c: Likewise.
1087         * pthread_mutex_unlock.c: Likewise.
1089 2007-06-17  Andreas Schwab  <schwab@suse.de>
1091         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1092         sections.
1094 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1096         * allocatestack.c (allocate_stack): Make code compile if
1097         __ASSUME_PRIVATE_FUTEX is set.
1099 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1101         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1102         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1103         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1104         (__pthread_rwlock_wrlock): Likewise.
1105         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1106         (pthread_rwlock_timedrdlock): Likewise.
1107         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1108         (pthread_rwlock_timedwrlock): Likewise.
1109         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1110         (__pthread_rwlock_unlock): Likewise.
1112 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1114         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1115         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1116         Split __flags into __flags, __shared, __pad1 and __pad2.
1117         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1118         futexes if they are available.
1119         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1120         in libc-lowlevellock.S allow using private futexes.
1121         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1122         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1123         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1124         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1125         lll_private_futex_timed_wait and lll_private_futex_wake.
1126         (lll_robust_mutex_unlock): Fix typo.
1127         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1128         field in futex command setup.
1129         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1130         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1131         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1132         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1133         if they are available.  Remove clear_once_control.
1134         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1135         futexes if they are available.
1136         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1137         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1138         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1139         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1140         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1141         Wake only when there are waiters.
1142         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1143         support.  Indicate that there are waiters.  Remove unnecessary
1144         extra cancellation test.
1145         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1146         left-over duplication of __sem_wait_cleanup.
1148 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1150         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1151         parameter to lll_futex_wait, lll_futex_timed_wait, and
1152         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1153         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1154         lll_private_futex_wake.
1155         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1156         * allocatestack.c: Adjust use of lll_futex_* macros.
1157         * init.c: Likewise.
1158         * lowlevellock.h: Likewise.
1159         * pthread_barrier_wait.c: Likewise.
1160         * pthread_cond_broadcast.c: Likewise.
1161         * pthread_cond_destroy.c: Likewise.
1162         * pthread_cond_signal.c: Likewise.
1163         * pthread_cond_timedwait.c: Likewise.
1164         * pthread_cond_wait.c: Likewise.
1165         * pthread_create.c: Likewise.
1166         * pthread_mutex_lock.c: Likewise.
1167         * pthread_mutex_setprioceiling.c: Likewise.
1168         * pthread_mutex_timedlock.c: Likewise.
1169         * pthread_mutex_unlock.c: Likewise.
1170         * pthread_rwlock_timedrdlock.c: Likewise.
1171         * pthread_rwlock_timedwrlock.c: Likewise.
1172         * pthread_rwlock_unlock.c: Likewise.
1173         * sysdeps/alpha/tls.h: Likewise.
1174         * sysdeps/i386/tls.h: Likewise.
1175         * sysdeps/ia64/tls.h: Likewise.
1176         * sysdeps/powerpc/tls.h: Likewise.
1177         * sysdeps/pthread/aio_misc.h: Likewise.
1178         * sysdeps/pthread/gai_misc.h: Likewise.
1179         * sysdeps/s390/tls.h: Likewise.
1180         * sysdeps/sh/tls.h: Likewise.
1181         * sysdeps/sparc/tls.h: Likewise.
1182         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1183         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1184         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1185         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1186         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1187         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1188         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1189         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1190         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1191         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1192         Likewise.
1193         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1194         * sysdeps/x86_64/tls.h: Likewise.
1196 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1198         * pthread_getattr_np.c: No need to install a cancellation handler,
1199         this is no cancellation point.
1200         * pthread_getschedparam.c: Likewise.
1201         * pthread_setschedparam.c: Likewise.
1202         * pthread_setschedprio.c: Likewise.
1203         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1204         lll_unlock_wake_cb.
1205         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1206         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1207         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1208         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1209         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1210         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1211         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1212         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1213         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1214         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1215         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1216         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1218         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1219         whether there are more than one thread makes no sense here since
1220         we only call the slow path if the locks are taken.
1221         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1223         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1224         COND_NWAITERS_SHIFT.
1225         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1226         COND_CLOCK_BITS.
1227         * pthread_cond_init.c: Likewise.
1228         * pthread_cond_timedwait.c: Likewise.
1229         * pthread_cond_wait.c: Likewise.
1230         * pthread_condattr_getclock.c: Likewise.
1231         * pthread_condattr_setclock.c: Likewise.
1232         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1233         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1234         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1235         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1236         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1238 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1240         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1241         unistd.h.
1243         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1244         insn suffix.
1245         (THREAD_GSCOPE_GET_FLAG): Remove.
1246         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1247         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1248         changes.
1249         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1250         (THREAD_GSCOPE_GET_FLAG): Remove.
1251         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1252         instead of THREAD_GSCOPE_GET_FLAG.
1253         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1254         it.
1255         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1256         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1257         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1258         THREAD_GSCOPE_WAIT): Define.
1259         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1260         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1261         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1262         THREAD_GSCOPE_WAIT): Define.
1263         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1264         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1265         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1266         THREAD_GSCOPE_WAIT): Define.
1267         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1268         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1269         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1270         THREAD_GSCOPE_WAIT): Define.
1272 2007-05-24  Richard Henderson  <rth@redhat.com>
1274         * descr.h (struct pthread): Add header.gscope_flag.
1275         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1276         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1277         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1278         THREAD_GSCOPE_WAIT): Define.
1280 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1282         * init.c: Make it compile with older kernel headers.
1284         * tst-initializers1.c: Show through exit code which test failed.
1286         * pthread_rwlock_init.c: Also initialize __shared field.
1287         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1288         element in rwlock structure into four byte elements.  One of them is
1289         the new __shared element.
1290         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1291         Likewise.
1292         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1293         __shared, adjust names of other padding elements.
1294         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1295         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1296         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1297         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1298         FUTEX_PRIVATE_FLAG.
1299         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1300         futex to use private operations if possible.
1301         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1302         Likewise.
1303         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1304         Likewise.
1305         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1306         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1307         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1308         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1309         Likewise.
1310         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1311         Likewise.
1312         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1313         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1315 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1317         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1318         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1319         * pthread_rwlock_timedrdlock.c: Likewise.
1320         * pthread_rwlock_tryrdlock.c: Likewise.
1322         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1323         optimization.
1325         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1326         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1327         duplication of __sem_wait_cleanup.
1329         * allocatestack.c: Revert last change.
1330         * init.c: Likewise.
1331         * sysdeps/i386/tls.h: Likewise.
1332         * sysdeps/x86_64/tls.h: Likewise.
1333         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1334         header structure.
1335         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1337         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1338         Add private field.
1339         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1340         * pthread_barrier_init.c: Set private flag if pshared and private
1341         futexes are supported.
1342         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1343         private field in futex command setup.
1344         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1346 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1348         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1349         support.
1350         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1351         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1352         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1353         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1354         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1356         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1357         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1358         fields in the structure.
1359         (__old_sem_init): New function.
1360         * sem_open.c: Initialize all fields of the structure.
1361         * sem_getvalue.c: Adjust for renamed element.
1362         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1363         (gen-as-const-headers): Add structsem.sym.
1364         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1365         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1366         struct new_sem.  Add struct old_sem.
1367         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1368         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1369         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1370         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1371         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1372         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1373         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1374         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1375         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1376         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1377         * tst-sem10.c: New file.
1378         * tst-sem11.c: New file.
1379         * tst-sem12.c: New file.
1380         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1381         of struct sem.
1383 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1384             Jakub Jelinek  <jakub@redhat.com>
1386         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1387         Move __pthread_enable_asynccancel right before futex syscall.
1388         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1389         Likewise.
1391 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1393         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1394         THREAD_COPY_PRIVATE_FUTEX): Define.
1395         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1396         THREAD_COPY_PRIVATE_FUTEX): Define.
1397         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1398         * init.c (__pthread_initialize_minimal_internal): Use
1399         THREAD_SET_PRIVATE_FUTEX.
1401         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1402         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1403         THREAD_GSCOPE_FLAG_WAIT): Define.
1404         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1405         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1406         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1407         PTR_DEMANGLE.
1408         (THREAD_GSCOPE_GET_FLAG): Define.
1409         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1410         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1411         instead of ->header.gscope_flag directly.
1413 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1415         * init.c (__pthread_initialize_minimal_internal): Check whether
1416         private futexes are available.
1417         * allocatestack.c (allocate_stack): Copy private_futex field from
1418         current thread into the new stack.
1419         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1420         futexes if they are available.
1421         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1422         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1423         in libc-lowlevellock.S allow using private futexes.
1424         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1425         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1426         FUTEX_PRIVATE_FLAG.
1427         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1428         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1429         if they are available.
1430         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1431         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1432         * sysdeps/i386/tcb-offsets.sym: Likewise.
1433         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1434         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1436 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1438         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1439         Remove ptr_wait_lookup_done again.
1440         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1441         (__pthread_initialize_minimal_internal): Initialize
1442         _dl_wait_lookup_done pointer in _rtld_global directly.
1443         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1444         Remove code to code _dl_wait_lookup_done.
1445         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1446         encrypted for now.
1448 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1450         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1451         pthread_mutex_init failed with ENOTSUP.
1453 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1455         * allocatestack.c (__wait_lookup_done): New function.
1456         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1457         Add ptr_wait_lookup_done.
1458         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1459         * pthreadP.h: Declare __wait_lookup_done.
1460         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1461         Define macros to implement reference handling of global scope.
1462         * sysdeps/x86_64/tls.h: Likewise.
1463         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1464         Initialize GL(dl_wait_lookup_done).
1466 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1468         [BZ #4512]
1469         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1470         is detected.
1471         * pthread_mutex_timedlock.c: Likewise.
1472         * pthread_mutex_trylock.c: Likewise.
1473         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1475         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1476         * tst-robust9.c: New file.
1477         * tst-robustpi9.c: New file.
1479         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1480         unnecessary extra cancellation test.
1482 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1484         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1485         extra cancellation test.
1486         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1488 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1490         * descr.h (struct pthread): Rearrange members to fill hole in
1491         64-bit layout.
1493         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1494         (__pthread_setaffinity_new): If syscall was successful and
1495         RESET_VGETCPU_CACHE is defined, use it before returning.
1496         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1498 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1500         [BZ #4455]
1501         * tst-align2.c: Include stackinfo.h.
1502         * tst-getpid1.c: Likewise.
1504 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1506         [BZ #4455]
1507         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1508         * tst-getpid1.c (do_test): Likewise.
1510         [BZ #4456]
1511         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1512         (allocate_stack): Likewise.
1514 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1516         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1517         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1518         (__lll_robust_timedlock_wait): Likewise.
1519         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1521 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1523         [BZ #4465]
1524         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1525         * tst-cancel4.c (tf_fdatasync): New test.
1527 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1529         [BZ #4392]
1530         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1531         check mutexes like normal mutexes.
1533         [BZ #4306]
1534         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1535         Initialize the whole sigevent structure to appease valgrind.
1537 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1539         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1540         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1542 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1544         * tst-locale1.c: Avoid warnings.
1545         * tst-locale2.c: Likewise.
1547 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1549         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1550         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1552 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1554         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1555         __extern_always_inline where appropriate.
1556         * sysdeps/pthread/pthread.h: Likewise.
1558 2007-03-13  Richard Henderson  <rth@redhat.com>
1560         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1561         separate cfi regions for the two subsections.
1563 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1565         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1566         new thread, don't just decrement it.
1567         Patch by Suzuki K P <suzuki@in.ibm.com>.
1569 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1571         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1572         PTHFCT_CALL definition.
1574 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1576         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1577         available, don't use it.
1579 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1581         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1582         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1583         call into the kernel to delay.
1585 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1587         * tst-initializers1.c: We want to test the initializers as seen
1588         outside of libc, so undefined _LIBC.
1590         * pthread_join.c (cleanup): Avoid warning.
1592 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1594         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1595         (__lll_timedwait_tid): Add unwind info.
1597         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1598         function table, mangle the pointers.
1599         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1600         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1601         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1602         demangle pointers before use.
1603         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1604         demangle pointer.
1605         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1606         * sysdeps/pthread/setxid.h: Likewise.
1608 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1610         * tst-rwlock7.c: Show some more information in case of correct
1611         behavior.
1613 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1615         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1616         (lll_futex_timed_wait): Undo part of last change, don't negate
1617         return value.
1619 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1621         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1622         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1624 2006-12-28  David S. Miller  <davem@davemloft.net>
1626         * shlib-versions: Fix sparc64 linux target specification.
1628 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1630         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1631         Adjust include path for pthread_barrier_wait.c move.
1633 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1635         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1636         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1638 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1640         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1641         6 argument cancellable syscalls.
1642         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1643         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1644         6 argument cancellable syscalls.
1645         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1647 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1649         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1650         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1652 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1654         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1655         __sync_lock_release instead of __sync_lock_release_si.
1657 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1659         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1660         Define.
1661         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1662         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1663         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1664         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1665         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1666         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1667         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1668         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1669         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1670         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1671         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1673 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1675         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1676         * pthread_barrier_wait.c: ...here.
1677         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1678         * pthread_cond_broadcast.c: ...here.
1679         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1680         * pthread_cond_signal.c: ...here.
1681         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1682         * pthread_cond_timedwait.c: ...here.
1683         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1684         * pthread_cond_wait.c: ...here.
1685         * sysdeps/pthread/pthread_once.c: Move to...
1686         * pthread_once.c: ...here.
1687         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1688         * pthread_rwlock_rdlock.c: ...here.
1689         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1690         * pthread_rwlock_timedrdlock.c: ...here.
1691         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1692         * pthread_rwlock_timedwrlock.c: ...here.
1693         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1694         * pthread_rwlock_unlock.c: ...here.
1695         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1696         * pthread_rwlock_wrlock.c: ...here.
1697         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1698         * pthread_spin_destroy.c: ...here.
1699         * sysdeps/pthread/pthread_spin_init.c: Move to...
1700         * pthread_spin_init.c: ...here.
1701         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1702         * pthread_spin_unlock.c: ...here.
1703         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1704         * pthread_getcpuclockid.c: ...here.
1706         * init.c: USE_TLS support is now always enabled.
1707         * tst-tls5.h: Likewise.
1708         * sysdeps/alpha/tls.h: Likewise.
1709         * sysdeps/i386/tls.h: Likewise.
1710         * sysdeps/ia64/tls.h: Likewise.
1711         * sysdeps/powerpc/tls.h: Likewise.
1712         * sysdeps/s390/tls.h: Likewise.
1713         * sysdeps/sh/tls.h: Likewise.
1714         * sysdeps/sparc/tls.h: Likewise.
1715         * sysdeps/x86_64/tls.h: Likewise.
1717 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1719         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1720         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1721         failed.
1723         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1724         Define to THREAD_SELF->header.multiple_threads.
1725         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1726         Likewise.
1727         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1728         Likewise.
1729         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1730         (SINGLE_THREAD_P): Likewise.
1731         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1732         (SINGLE_THREAD_P): Likewise.
1733         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1734         (SINGLE_THREAD_P): Likewise.
1735         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1736         (SINGLE_THREAD_P): Likewise.
1737         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
1738         Likewise.
1739         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1740         (SINGLE_THREAD_P): Likewise.
1741         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1742         (SINGLE_THREAD_P): Likewise.
1743         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
1744         Likewise.
1746 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
1748         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
1749         by default rather than 2_3_3.
1751 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
1753         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1754         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
1755         atomic_* instead of catomic_* macros.
1757 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
1759         [BZ #3285]
1760         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
1761         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1762         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1763         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1764         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1765         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
1766         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1767         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1768         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1769         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
1770         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1771         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1772         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1774 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
1776         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
1777         cancelable syscalls with six parameters.
1779         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
1780         operations instead of atomic_*.
1782 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
1784         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
1786 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
1788         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
1789         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
1790         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
1791         New file.
1792         * pthread_attr_setstack.c: Allow overwriting the version number of the
1793         new symbol.
1794         * pthread_attr_setstacksize.c: Likewise.
1795         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
1796         it.
1797         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
1798         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
1800 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
1802         [BZ #3251]
1803         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
1804         Patch by Petr Baudis.
1806 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
1808         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
1810         * tst-cancel2.c (tf): Loop as long as something was written.
1812 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1814         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
1815         mutexes wake all mutexes.
1816         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
1817         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1818         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1820 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
1822         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
1823         to guarantee the thread is always canceled.
1825 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
1827         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
1828         Include stdlib.h.
1829         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
1830         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
1831         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1832         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1833         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1835 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
1837         [BZ #3123]
1838         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
1839         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1840         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1841         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1842         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1843         * Makefile (tests): Add tst-cond22.
1844         * tst-cond22.c: New file.
1846 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
1848         [BZ #3124]
1849         * descr.h (struct pthread): Add parent_cancelhandling.
1850         * sysdeps/pthread/createthread.c (create_thread): Pass parent
1851         cancelhandling value to child.
1852         * pthread_create.c (start_thread): If parent thread was canceled
1853         reset the SIGCANCEL mask.
1854         * Makefile (tests): Add tst-cancel25.
1855         * tst-cancel25.c: New file.
1857 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
1858             Ulrich Drepper  <drepper@redhat.com>
1860         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
1861         counterp if it is already zero.
1862         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
1864 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
1865             Roland McGrath  <roland@redhat.com>
1867         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
1868         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1869         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
1870         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1871         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1872         lll_robust_mutex_timedlock, lll_mutex_unlock,
1873         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1874         Add _L_*_ symbols around the subsection.
1875         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
1876         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
1878 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
1879             Roland McGrath  <roland@redhat.com>
1881         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1882         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1883         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
1884         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1885         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1886         lll_robust_mutex_timedlock, lll_mutex_unlock,
1887         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1888         Add _L_*_ symbols around the subsection.
1889         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
1890         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
1892 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
1894         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
1895         change because it can disturb too much existing code.  If real hard
1896         reader preference is needed we'll introduce another type.
1897         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1898         (pthread_rwlock_timedwrlock): Likewise.
1899         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1900         Likewise.
1902 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
1904         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
1905         reader preference.
1906         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1907         (pthread_rwlock_timedwrlock): Likewise.
1908         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1909         Likewise.
1911 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
1913         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
1914         Only define ifdef SHARED.
1916 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
1918         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
1919         (free_stacks): ...here.
1920         (__free_stack_cache): New function.
1921         * pthreadP.h: Declare __free_stack_cache.
1922         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
1923         ptr_freeres.
1924         * init.c (pthread_functions): Initialize ptr_freeres.
1925         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
1926         New freeres function.
1928 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
1930         [BZ #3018]
1931         * Makefile (extra-objs): Add modules to extra-test-objs instead.
1933 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
1935         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1936         _XOPEN_REALTIME_THREADS.
1938 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
1940         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
1941         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
1942         HAVE_CLOCK_GETTIME_VSYSCALL.
1943         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
1945 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
1947         * sysdeps/unix/sysv/linux/bits/posix_opt.h
1948         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
1949         * descr.h (struct priority_protection_data): New type.
1950         (struct pthread): Add tpp field.
1951         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
1952         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
1953         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
1954         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
1955         TPP mutexes.
1956         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
1957         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
1958         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
1959         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
1960         * tpp.c: New file.
1961         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
1962         boosted by TPP.
1963         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1964         * pthread_mutexattr_getprioceiling.c
1965         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
1966         in the SCHED_FIFO priority range.
1967         * pthread_mutexattr_setprioceiling.c
1968         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
1969         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
1970         if mutex is not TPP.  Ceiling is now in __data.__lock.
1971         * pthread_mutex_setprioceiling.c: Include stdbool.h.
1972         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
1973         is now in __data.__lock.  Add locking.
1974         * pthread_create.c (__free_tcb): Free pd->tpp structure.
1975         * Makefile (libpthread-routines): Add tpp.
1976         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
1977         * tst-tpp.h: New file.
1978         * tst-mutexpp1.c: New file.
1979         * tst-mutexpp6.c: New file.
1980         * tst-mutexpp10.c: New file.
1981         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
1982         * tst-mutex6.c (TEST_FUNCTION): Likewise.
1984 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
1986         [BZ #2843]
1987         * pthread_join.c (pthread_join): Account for self being canceled
1988         when checking for deadlocks.
1989         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
1990         (tf1): Don't print anything after pthread_join returns, this would be
1991         another cancellation point.
1992         (tf2): Likewise.
1993         * tst-join6.c: New file.
1994         * Makefile (tests): Add tst-join6.
1996 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
1998         [BZ #2892]
1999         * pthread_setspecific.c (__pthread_setspecific): Check
2000         out-of-range index before checking for unused key.
2002         * sysdeps/pthread/gai_misc.h: New file.
2004 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2006         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2007         file.  Don't use sysctl.
2008         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2009         overwrite the file if this is likely not true.
2011 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2013         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2014         * Makefile (tests): Add tst-getpid3.
2015         * tst-getpid3.c: New file.
2017 2006-07-30  Roland McGrath  <roland@redhat.com>
2019         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2021         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2022         (pause_not_cancel): New macro.
2023         (nanosleep_not_cancel): New macro.
2024         (sigsuspend_not_cancel): New macro.
2025         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2026         nanosleep_not_cancel macro from <not-cancel.h>.
2027         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2028         macro from <not-cancel.h>.
2030 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2031             Jakub Jelinek  <jakub@redhat.com>
2033         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2034         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2035         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2036         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2037         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2038         * pthread_mutex_lock.c: Likewise.
2039         * pthread_mutex_timedlock.c: Likewise.
2040         * pthread_mutex_trylock.c: Likewise.
2041         * pthread_mutex_unlock.c: Likewise.
2042         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2043         all mutexes.
2044         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2045         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2046         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2047         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2048         pthread-pi-defines.sym.
2049         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2050         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2051         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2052         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2053         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2054         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2055         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2056         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2057         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2058         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2059         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2060         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2061         * tst-mutex2.c: Likewise.
2062         * tst-mutex3.c: Likewise.
2063         * tst-mutex4.c: Likewise.
2064         * tst-mutex5.c: Likewise.
2065         * tst-mutex6.c: Likewise.
2066         * tst-mutex7.c: Likewise.
2067         * tst-mutex7a.c: Likewise.
2068         * tst-mutex8.c: Likewise.
2069         * tst-mutex9.c: Likewise.
2070         * tst-robust1.c: Likewise.
2071         * tst-robust7.c: Likewise.
2072         * tst-robust8.c: Likewise.
2073         * tst-mutexpi1.c: New file.
2074         * tst-mutexpi2.c: New file.
2075         * tst-mutexpi3.c: New file.
2076         * tst-mutexpi4.c: New file.
2077         * tst-mutexpi5.c: New file.
2078         * tst-mutexpi6.c: New file.
2079         * tst-mutexpi7.c: New file.
2080         * tst-mutexpi7a.c: New file.
2081         * tst-mutexpi8.c: New file.
2082         * tst-mutexpi9.c: New file.
2083         * tst-robust1.c: New file.
2084         * tst-robust2.c: New file.
2085         * tst-robust3.c: New file.
2086         * tst-robust4.c: New file.
2087         * tst-robust5.c: New file.
2088         * tst-robust6.c: New file.
2089         * tst-robust7.c: New file.
2090         * tst-robust8.c: New file.
2091         * Makefile (tests): Add the new tests.
2093         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2094         * pthread_mutex_destroy.c: Remove unneeded label.
2096 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2098         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2099         computations to compile time.
2101 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2103         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2105 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2107         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2109 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2111         * pthread_key_create.c (__pthread_key_create): Do away with
2112         __pthread_keys_lock.
2114         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2115         (__kernel_cpumask_size): Mark as hidden.
2116         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2118         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2119         * semaphoreP.h (__sem_mappings_lock): Likewise.
2121 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2123         * pthread_atfork.c: Mark __dso_handle as hidden.
2125 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2127         [BZ #2644]
2128         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2129         the reload problem.  Change the one path in pthread_cancel_init
2130         which causes the problem.  Force gcc to reload.  Simplify callers.
2131         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2132         (_Unwind_GetBSP): Undo last patch.
2134 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2136         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2137         function pointer is reloaded after pthread_cancel_init calls.
2139         [BZ #2644]
2140         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2141         pointers are reloaded after pthread_cancel_init calls.
2143 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2145         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2146         __always_inline.
2148 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2150         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2151         Allocate new object which is passed to timer_sigev_thread so that
2152         the timer can be deleted before the new thread is scheduled.
2154 2006-04-26  Roland McGrath  <roland@redhat.com>
2156         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2158 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2160         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2161         suffix for conditional jumps.
2162         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2163         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2164         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2165         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2166         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2167         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2169         * init.c (sigcancel_handler): Compare with correct PID even if the
2170         thread is in the middle of a fork call.
2171         (sighandler_setxid): Likewise.
2172         Reported by Suzuki K P <suzuki@in.ibm.com> .
2174 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2176         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2178 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2180         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2181         fails [Coverity CID 105].
2183 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2185         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2187 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2189         [BZ #2505]
2190         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2191         Define __lll_rel_instr using lwsync.
2193 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2195         * allocatestack.c (allocate_stack): Always initialize robust_head.
2196         * descr.h: Define struct robust_list_head.
2197         (struct pthread): Use robust_list_head in robust mutex list definition.
2198         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2199         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2200         (__pthread_initialize_minimal_internal): Register robust_list with
2201         the kernel.
2202         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2203         Declare __set_robust_list_avail.
2204         * pthread_create.c (start_thread): Register robust_list of new thread.
2205         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2206         waiters.
2207         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2208         number of users, it's unreliable.
2209         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2210         set_robust_list syscall is available.
2211         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2212         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2213         Set robust_head.list_op_pending before trying to lock a robust mutex.
2214         * pthread_mutex_timedlock.c: Likewise.
2215         * pthread_mutex_trylock.c: Likewise.
2216         * pthread_mutex_unlock.c: Likewise for unlocking.
2217         * Makefile (tests): Add tst-robust8.
2218         * tst-robust8.c: New file.
2220 2006-03-08  Andreas Schwab  <schwab@suse.de>
2222         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2223         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2225 2006-03-05  Roland McGrath  <roland@redhat.com>
2227         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2228         and $config_os doesn't match *linux*.
2230 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2232         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2233         Use __syscall_error.
2234         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2235         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2236         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2237         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2238         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2239         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2241 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2243         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2245 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2247         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2248         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2249         mutex.
2250         (__lll_robust_timedlock_wait): Likewise.
2251         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2252         (__lll_robust_lock_wait): Likewise.
2253         (__lll_robust_timedlock_wait): Likewise.
2254         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2255         (__lll_robust_lock_wait): Likewise.
2256         (__lll_robust_timedlock_wait): Likewise.
2258 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2260         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2261         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2262         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2263         lll_robust_mutex_unlock): Define.
2264         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2266 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2268         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2269         instead of <clone.S>.
2271 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2273         * Makefile (libpthread-routines): Add
2274         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2275         and pthread_mutex_[sg]etprioceiling.
2276         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2277         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2278         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2279         pthread_mutex_setprioceiling.
2280         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2281         PTHREAD_PRIO_PROTECT): New enum values.
2282         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2283         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2284         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2285         prototypes.
2286         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2287         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2288         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2289         Define.
2290         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2291         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2292         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2293         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2294         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2295         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2296         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2297         protocol mutexes.
2298         * pthread_mutex_getprioceiling.c: New file.
2299         * pthread_mutex_setprioceiling.c: New file.
2300         * pthread_mutexattr_getprioceiling.c: New file.
2301         * pthread_mutexattr_setprioceiling.c: New file.
2302         * pthread_mutexattr_getprotocol.c: New file.
2303         * pthread_mutexattr_setprotocol.c: New file.
2305 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2307         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2309 2006-02-27  Roland McGrath  <roland@redhat.com>
2311         * sysdeps/pthread/Subdirs: List nptl here too.
2312         * configure (libc_add_on_canonical): New variable.
2314         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2316         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2317         self to get main source tree's file.
2318         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2319         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2320         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2321         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2322         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2323         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2324         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2325         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2326         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2327         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2328         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2329         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2330         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2332         * Makefile: Use $(sysdirs) in vpath directive.
2334         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2335         (CPPFLAGS-timer_routines.c): Likewise.
2337         * Makeconfig (includes): Variable removed.
2339 2006-02-26  Roland McGrath  <roland@redhat.com>
2341         * sysdeps/generic/pt-raise.c: Moved to ...
2342         * pt-raise.c: ... here.
2343         * sysdeps/generic/lowlevellock.h: Moved to ...
2344         * lowlevellock.h: ... here.
2346 2006-02-23  Roland McGrath  <roland@redhat.com>
2348         * descr.h (struct pthread): Add final member `end_padding'.
2349         (PTHREAD_STRUCT_END_PADDING): Use it.
2351 2006-02-20  Roland McGrath  <roland@redhat.com>
2353         * sysdeps/mips: Directory removed, saved in ports repository.
2354         * sysdeps/unix/sysv/linux/mips: Likewise.
2356 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2358         * tst-robust1.c: Add second mutex to check that the mutex list is
2359         handled correctly.
2361 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2363         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2364         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2365         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2366         lll_robust_mutex_unlock): New macros.
2367         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2368         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2369         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2370         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2371         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2373 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2375         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2376         definitions.
2377         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2379 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2381         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2382         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2383         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2384         (lll_robust_mutex_unlock): Likewise.
2386 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2388         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2389         Set robust_list.__next rather than robust_list.
2390         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2391         (__pthread_list_t): New typedef.
2392         (pthread_mutex_t): Replace __next and __prev fields with __list.
2393         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2394         (__pthread_list_t): New typedef.
2395         (pthread_mutex_t): Replace __next and __prev fields with __list.
2396         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2397         (__pthread_list_t, __pthread_slist_t): New typedefs.
2398         (pthread_mutex_t): Replace __next and __prev fields with __list.
2399         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2400         (__pthread_list_t, __pthread_slist_t): New typedefs.
2401         (pthread_mutex_t): Replace __next and __prev fields with __list.
2402         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2403         (__pthread_list_t, __pthread_slist_t): New typedefs.
2404         (pthread_mutex_t): Replace __next and __prev fields with __list.
2405         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2406         (__pthread_slist_t): New typedef.
2407         (pthread_mutex_t): Replace __next field with __list.
2409 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2411         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2412         PTHREAD_MUTEX_OWNERDEAD.
2413         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2414         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2415         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2416         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2417         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2418         to PTHREAD_MUTEX_INCONSISTENT.
2419         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2420         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2421         * pthread_mutex_trylock.c: Likewise.
2422         * pthread_mutex_timedlock.c: Likewise.
2423         * pthread_mutex_unlock.c: Likewise.
2424         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2425         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2426         lowlevelrobustlock.sym.
2427         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2428         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2429         definitions.
2430         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2431         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2432         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2433         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2434         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2436 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2438         * allocatestack.c (allocate_stack): Initialize robust_list.
2439         * init.c (__pthread_initialize_minimal_internal): Likewise.
2440         * descr.h (struct xid_command): Pretty printing.
2441         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2442         robust_list.  Adjust macros.
2443         * pthread_create.c (start_thread): Adjust robust_list handling.
2444         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2445         but the owner for all robust mutex types.
2446         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2447         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2448         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2449         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2451         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2452         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2454 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2456         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2457         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2459 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2461         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2462         Return status.
2463         (lll_futex_timed_wait): Define.
2465 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2467         * tst-cancel4.c: Test ppoll.
2469 2006-01-18  Andreas Jaeger  <aj@suse.de>
2471         [BZ #2167]
2472         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2473         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2474         by Jim Gifford <patches@jg555.com>.
2476 2006-01-13  Richard Henderson  <rth@redhat.com>
2478         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2480 2006-01-10  Roland McGrath  <roland@redhat.com>
2482         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2483         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2484         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2485         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2486         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2487         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2488         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2489         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2490         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2491         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2493 2006-01-09  Roland McGrath  <roland@redhat.com>
2495         * tst-initializers1-c89.c: New file.
2496         * tst-initializers1-c99.c: New file.
2497         * tst-initializers1-gnu89.c: New file.
2498         * tst-initializers1-gnu99.c: New file.
2499         * Makefile (tests): Add them.
2500         (CFLAGS-tst-initializers1-c89.c): New variable.
2501         (CFLAGS-tst-initializers1-c99.c): New variable.
2502         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2503         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2505         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2506         Use __extension__ on anonymous union definition.
2507         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2508         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2509         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2510         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2511         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2513 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2515         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2516         Don't give the union a name because it changes the mangled name.
2517         Instead name the struct for __data.
2518         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2519         Likewise.
2520         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2521         Likewise.
2523 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2525         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2526         stack bias to mc_ftp field.
2528 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2530         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2531         being too clever and reloading the futex value where it shouldn't.
2533 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2535         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2536         correct type.
2538 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2540         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2541         Add cfi directives.
2543 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2545         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2546         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2547         rename in tcbhead_t.
2549         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2550         Don't give the union a name because it changes the mangled name.
2551         Instead name the struct for __data.
2552         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2553         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2554         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2555         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2556         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2557         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2559 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2561         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2562         Return status.
2563         (lll_futex_timed_wait): Define.
2564         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2565         * sysdeps/pthread/aio_misc.h: New file.
2567 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2569         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2571 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2573         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2574         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2575         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2577 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2579         * tst-cancel24.cc: Use C headers instead of C++ headers.
2581 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2583         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2584         sparc-linux configured glibc.
2585         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2586         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2587         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2588         atomic_compare_and_exchange_val_24_acq instead of
2589         atomic_compare_and_exchange_val_acq.
2590         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2591         instead of atomic_exchange_rel.
2592         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2593         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2594         file.
2595         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2596         file.
2597         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2598         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2599         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2600         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2601         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2602         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2603         New file.
2604         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2605         New file.
2606         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2607         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2608         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2609         file.
2610         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2611         file.
2612         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2614 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2616         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2617         mutex initializers.
2619 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2621         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2622         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2623         THREAD_COPY_POINTER_GUARD): Define.
2624         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2625         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2627 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2629         * version.c: Update copyright year.
2631 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2633         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2634         .eh_frame section, use cfi_* directives.
2635         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2637 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2639         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2640         now.
2642 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2644         * sysdeps/pthread/sigaction.c: Removed.
2645         * sigaction.c: New file.
2646         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2648 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2650         * Makefile (tests): Add tst-signal7.
2651         * tst-signal7.c: New file.
2653 2005-12-27  Roland McGrath  <roland@redhat.com>
2655         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2656         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2657         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2658         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2659         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2660         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2661         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2662         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2663         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2664         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2665         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2667 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2669         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2670         and __prev field to pthread_mutex_t.
2671         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2672         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2673         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2674         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2675         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2676         to pthread_mutex_t.
2678 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2680         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2681         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2682         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2683         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2684         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2685         and PTHREAD_MUTEXATTR_FLAG_BITS.
2686         * descr.h (struct pthread): Add robust_list field and define
2687         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2688         * pthread_mutexattr_getrobust.c: New file.
2689         * pthread_mutexattr_setrobust.c: New file.
2690         * pthread_mutex_consistent.c: New file.
2691         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2692         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2693         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2694         Adjust pthread_mutex_t initializers.
2695         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2696         field to pthread_mutex_t.
2697         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2698         and __prev field to pthread_mutex_t.
2699         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2700         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2701         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2702         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2703         * pthread_mutexattr_gettype.c: Likewise.
2704         * pthread_mutexattr_setpshared.c: Likewise.
2705         * pthread_mutexattr_settype.c: Likewise.
2706         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2707         Initialize mutex kind according to robust flag.
2708         * pthread_mutex_lock.c: Implement local robust mutex.
2709         * pthread_mutex_timedlock.c: Likewise.
2710         * pthread_mutex_trylock.c: Likewise.
2711         * pthread_mutex_unlock.c: Likewise.
2712         * pthread_create.c (start_thread): Mark robust mutexes which remained
2713         locked as dead.
2714         * tst-robust1.c: New file.
2715         * tst-robust2.c: New file.
2716         * tst-robust3.c: New file.
2717         * tst-robust4.c: New file.
2718         * tst-robust5.c: New file.
2719         * tst-robust6.c: New file.
2720         * tst-robust7.c: New file.
2721         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
2722         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2723         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
2724         tst-robust5, tst-robust6, and tst-robust7.
2726         * tst-typesizes.c: New file.
2727         * Makefile (tests): Add tst-typesizes.
2729         * tst-once3.c: More debug output.
2731 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
2733         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
2734         missing after last change.
2736         * version.c: Update copyright year.
2738 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
2740         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
2741         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
2742         * pthread_mutex_trylock.c: Likewise.
2743         * pthread_mutex_timedlock.c: Likewise.
2744         * pthread_mutex_unlock.c: Likewise.
2746 2005-12-22  Roland McGrath  <roland@redhat.com>
2748         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
2749         so that #include_next's search location is not reset to the -I..
2750         directory where <nptl/...> can be found.
2752 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
2754         [BZ #1913]
2755         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2756         Fix unwind info.  Remove useless branch prediction prefix.
2757         * tst-cancel24.cc: New file.
2758         * Makefile: Add rules to build and run tst-cancel24.
2760 2005-12-21  Roland McGrath  <roland@redhat.com>
2762         * libc-cancellation.c: Use <> rather than "" #includes.
2763         * pt-cleanup.c: Likewise.
2764         * pthread_create.c: Likewise.
2765         * pthread_join.c: Likewise.
2766         * pthread_timedjoin.c: Likewise.
2767         * pthread_tryjoin.c: Likewise.
2768         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
2769         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2770         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2771         * unwind.c: Likewise.
2773 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2775         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
2776         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
2777         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2778         THREAD_COPY_POINTER_GUARD): Define.
2780 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
2782         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
2783         rather than one.
2784         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2785         THREAD_COPY_POINTER_GUARD): Define.
2786         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
2787         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
2788         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2789         THREAD_COPY_POINTER_GUARD): Define.
2790         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
2791         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
2792         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
2793         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
2794         Use PTR_DEMANGLE for B0 if defined.
2796 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
2798         * pthread_create.c (__pthread_create_2_1): Use
2799         THREAD_COPY_POINTER_GUARD if available.
2800         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
2801         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2802         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
2803         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
2804         * sysdeps/x86_64/tls.h: Likewise.
2806 2005-12-15  Roland McGrath  <roland@redhat.com>
2808         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
2810 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
2812         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
2813         sysdeps/generic.
2814         * errno-loc.c: New file.
2816 2005-12-12  Roland McGrath  <roland@redhat.com>
2818         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
2819         adjustments before choosing stack size.  Update minimum stack size
2820         calculation to match allocate_stack change.
2822 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
2824         * allocatestack.c (allocate_stack): Don't demand that there is an
2825         additional full page available on the stack beside guard, TLS, the
2826         minimum stack.
2828 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
2830         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2831         (__cleanup_fct_attribute): Use __regparm__ not regparm.
2833         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
2834         compiling 32-bit code we must define __cleanup_fct_attribute.
2836 005-11-24  Jakub Jelinek  <jakub@redhat.com>
2838         [BZ #1920]
2839         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
2840         __attribute__ instead of __attribute.
2841         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2842         (__cleanup_fct_attribute): Likewise.
2844 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
2846         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
2847         a write barrier before writing libgcc_s_getcfa.
2849 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
2851         * sysdeps/unix/sysv/linux/configure: Removed.
2853 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
2855         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
2856         optional init_array/fini_array support.
2858 2005-10-24  Roland McGrath  <roland@redhat.com>
2860         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
2861         versioned_symbol use.
2863 2005-10-16  Roland McGrath  <roland@redhat.com>
2865         * init.c (__pthread_initialize_minimal_internal): Even when using a
2866         compile-time default stack size, apply the minimum that allocate_stack
2867         will require, and round up to page size.
2869 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
2871         * Makefile ($(test-modules)): Remove static pattern rule.
2873 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2874             Ulrich Drepper  <drepper@redhat.com>
2876         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
2877         alignment in callback function.
2878         * Makefile: Add rules to build and run tst-align3.
2879         * tst-align3.c: New file.
2881 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
2883         * allocatestack.c (setxid_signal_thread): Add
2884         INTERNAL_SYSCALL_DECL (err).
2886 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
2888         * allocatestack.c (setxid_signal_thread): Need to use
2889         atomic_compare_and_exchange_bool_acq.
2891 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
2892             Jakub Jelinek  <jakub@redhat.com>
2894         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
2895         CANCEL_RESTMASK.
2896         (struct pthread): Move specific_used field to avoid padding.
2897         Add setxid_futex field.
2898         * init.c (sighandler_setxid): Reset setxid flag and release the
2899         setxid futex.
2900         * allocatestack.c (setxid_signal_thread): New function.  Broken
2901         out of the bodies of the two loops in __nptl_setxid.  For undetached
2902         threads check whether they are exiting and if yes, don't send a signal.
2903         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
2904         * pthread_create.c (start_thread): For undetached threads, check
2905         whether setxid bit is set.  If yes, wait until signal has been
2906         processed.
2908         * allocatestack.c (STACK_VARIABLES): Initialize them.
2909         * pthread_create.c (__pthread_create_2_1): Initialize pd.
2911 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
2913         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
2914         waiters, awake all waiters on the associated mutex.
2916 2005-09-22  Roland McGrath  <roland@redhat.com>
2918         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
2919         ../sysdeps/x86_64/hp-timing.h).
2921 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
2923         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
2924         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2925         (lll_futex_wake_unlock): Define.
2926         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
2927         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2928         (lll_futex_wake_unlock): Define.
2929         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
2930         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2931         (lll_futex_wake_unlock): Define.
2932         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
2933         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2934         (lll_futex_wake_unlock): Define.
2935         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
2936         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2937         (lll_futex_wake_unlock): Define.
2938         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
2939         lll_futex_wake_unlock.
2940         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2941         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2942         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2943         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2944         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2945         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2947 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2949         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2950         Fix typo in register name.
2952 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
2954         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2955         Use __sigfillset.  Document that sigfillset does the right thing wrt
2956         to SIGSETXID.
2958 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
2960         [BZ #1102]
2961         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
2962         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
2963         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
2964         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
2965         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
2966         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
2967         in the structure.
2968         * Makefile (tests): Add tst-initializers1.
2969         (CFLAGS-tst-initializers1.c): Set.
2970         * tst-initializers1.c: New test.
2972 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
2974         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
2975         Make sure __flags are located at offset 48 from the start of the
2976         structure.
2978 2005-07-02  Roland McGrath  <roland@redhat.com>
2980         * Makeconfig: Comment fix.
2982 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
2984         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
2985         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
2986         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
2987         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
2988         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
2989         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2990         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
2991         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
2992         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
2993         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
2995 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
2997         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
2998         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2999         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3000         fields.
3001         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3002         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3003         field.  Put in sysinfo field unconditionally.
3004         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3005         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3006         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3007         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3008         fields.
3009         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3010         * pthread_create.c (__pthread_create_2_1): Use
3011         THREAD_COPY_STACK_GUARD macro.
3012         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3013         tests.
3014         * tst-stackguard1.c: New file.
3015         * tst-stackguard1-static.c: New file.
3017 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3019         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3020         Invoke CGOTSETUP and CGOTRESTORE.
3021         (CGOTSETUP, CGOTRESTORE): Define.
3023 2005-05-29  Richard Henderson  <rth@redhat.com>
3025         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3026         (tf_write, tf_writev): Use it.
3027         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3028         the system minimum.
3030 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3032         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3033         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3034         __librt_*_asynccancel@local.
3036 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3038         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3039         all occurrences of JUMPTARGET.  Instead append @local to labels.
3041 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3043         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3044         size/alignment of struct pthread rather than tcbhead_t.
3045         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3046         Likewise.
3047         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3048         Likewise.
3049         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3050         Likewise.
3052 2005-05-19  Richard Henderson  <rth@redhat.com>
3054         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3055         __sync_val_compare_and_swap, not explicit _si variant.
3056         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3058 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3060         [BZ #915]
3061         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3063 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3065         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3066         .eh_frame section, use cfi_* directives.
3068 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3070         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3071         of "" includes.
3073 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3075         [BZ #1075]
3076         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3077         aio_write blocks.
3079 2005-04-27  Roland McGrath  <roland@redhat.com>
3081         * Makefile (tests): Remove tst-clock2.
3083         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3084         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3085         translating to the kernel clockid_t for our own process/thread clock.
3087         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3089 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3091         * old_pthread_cond_init.c: Include <errno.h>.
3092         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3093         process shared or uses clock other than CLOCK_REALTIME.
3094         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3096 2005-04-13  David S. Miller  <davem@davemloft.net>
3098         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3099         * sysdeps/sparc/sparc64/clone.S: New file.
3101 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3103         [BZ #1102]
3104         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3105         __inline instead of inline.
3106         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3108 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3110         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3111         functionally equivalent, but shorter instructions.
3112         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3113         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3114         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3115         Likewise.
3116         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3117         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3118         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3119         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3120         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3121         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3122         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3123         Likewise.
3124         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3125         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3126         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3127         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3128         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3130 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3132         * sysdeps/mips/Makefile: New file.
3133         * sysdeps/mips/nptl-sysdep.S: New file.
3134         * sysdeps/mips/tcb-offsets.sym: New file.
3135         * sysdeps/mips/pthread_spin_lock.S: New file.
3136         * sysdeps/mips/pthread_spin_trylock.S: New file.
3137         * sysdeps/mips/pthreaddef.h: New file.
3138         * sysdeps/mips/tls.h: New file.
3139         * sysdeps/mips/jmpbuf-unwind.h: New file.
3140         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3141         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3142         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3143         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3144         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3145         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3146         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3147         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3148         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3149         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3151 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3153         [BZ #1112]
3154         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3155         variable to scerr.
3157 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3159         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3161 2005-02-25  Roland McGrath  <roland@redhat.com>
3163         * alloca_cutoff.c: Correct license text.
3164         * tst-unload.c: Likewise.
3165         * sysdeps/pthread/allocalim.h: Likewise.
3166         * sysdeps/pthread/pt-initfini.c: Likewise.
3167         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3168         * sysdeps/pthread/bits/sigthread.h: Likewise.
3169         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3170         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3172 2005-02-16  Roland McGrath  <roland@redhat.com>
3174         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3175         Use unsigned int * for ptr_nthreads.
3177 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3179         [BZ #721]
3180         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3181         gcc4.
3183 2005-02-07  Richard Henderson  <rth@redhat.com>
3185         [BZ #787]
3186         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3187         argument.
3189 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3191         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3192         order of arguments in invocation of atomic_add_zero.
3194 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3196         [BZ #737]
3197         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3198         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3199         at least gotntpoff relocation and addition.
3200         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3201         Likewise.
3202         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3203         Likewise.
3204         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3205         Likewise.
3207 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3209         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3210         entry for static tls deallocation fix.
3211         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3212         also contains information whether the memory pointed to is static
3213         TLS or not.
3214         * sysdeps/i386/tls.h: Likewise.
3215         * sysdeps/ia64/tls.h: Likewise.
3216         * sysdeps/powerpc/tls.h: Likewise.
3217         * sysdeps/s390/tls.h: Likewise.
3218         * sysdeps/sh/tls.h: Likewise.
3219         * sysdeps/sparc/tls.h: Likewise.
3220         * sysdeps/x86_64/tls.h: Likewise.
3222 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3224         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3226 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3228         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3229         %esp.
3230         * Makefile (tests): Add tst-align2.
3231         * tst-align2.c: New test.
3232         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3233         -mpreferred-stack-boundary=4.
3235 2004-12-18  Roland McGrath  <roland@redhat.com>
3237         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3238         New file removed withdrawn for the moment.
3240 2004-12-17  Richard Henderson  <rth@redhat.com>
3242         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3243         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3245 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3247         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3248         Increased PTHREAD_STACK_MIN.
3250         * tst-context1.c (stacks): Use bigger stack size.
3252 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3254         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3255         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3257 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3259         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3260         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3261         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3263 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3265         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3267 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3269         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3270         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3272         * tst-getpid1.c: If child crashes, report this first.  Print which
3273         signal.
3275 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3277         * init.c (__pthread_initialize_minimal_internal): Also unblock
3278         SIGSETXID.
3280 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3282         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3283         _POSIX_THREAD_CPUTIME): Define to 0.
3284         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3285         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3286         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3287         __timer_signal_thread_tclk): Remove.
3288         (init_module): Remove their initialization.
3289         (thread_cleanup): Remove their cleanup assertions.
3290         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3291         __timer_signal_thread_tclk): Remove.
3292         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3293         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3294         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3296 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3298         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3299         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3301         * Makefile (tests): Add tst-getpid2.
3302         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3303         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3304         * tst-getpid2.c: New test.
3306 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3308         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3310 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3312         * Makefile (tests): Add tst-getpid1.
3313         * tst-getpid1.c: New file.
3314         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3315         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3317 2004-12-02  Roland McGrath  <roland@redhat.com>
3319         * Makefile (libpthread-nonshared): Variable removed.
3320         ($(objpfx)libpthread_nonshared.a): Target removed.
3321         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3322         These are now handled by generic magic from
3323         libpthread-static-only-routines being set.
3325 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3327         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3328         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3329         _POSIX_THREAD_PRIO_PROTECT): Define.
3330         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3331         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3332         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3334 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3336         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3337         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3338         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3339         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3340         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3341         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3342         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3344 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3346         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3348         * Makefile (libpthread-routines): Add pthread_setschedprio.
3349         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3350         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3351         * pthread_setschedprio.c: New file.
3353 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3355         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3356         * pthread_cancel.c (pthread_create): Likewise.
3358         * Makefile (libpthread-routines): Add vars.
3359         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3360         * init.c (__default_stacksize, __is_smp): Remove.
3361         * vars.c: New file.
3362         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3363         and define a wrapper macro.
3364         (PTHREAD_STATIC_FN_REQUIRE): Define.
3365         * allocatestack.c (__find_thread_by_id): Undefine.
3366         * pthread_create (__pthread_keys): Remove.
3367         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3368         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3369         PTHREAD_STATIC_FN_REQUIRE.
3371 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3373         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3374         parameter to REGISTER macro.
3376 2004-11-17  Roland McGrath  <roland@redhat.com>
3378         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3379         Make sure SIGCANCEL is blocked as well.
3381 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3383         * sysdeps/pthread/setxid.h: New file.
3384         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3385         (struct xid_command): Add forward decl.
3386         (struct pthread_functions): Change return type of __nptl_setxid hook
3387         to int.
3388         * pthreadP.h (__nptl_setxid): Change return type to int.
3389         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3390         calling thread, return its return value and set errno on failure.
3391         * descr.h (struct xid_command): Change id type to long array.
3393         * Makefile: Add rules to build and test tst-setuid1 and
3394         tst-setuid1-static.
3395         * tst-setuid1.c: New test.
3396         * tst-setuid1-static.c: New test.
3398 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3400         * Makefile (tests): Add tst-exit3.
3401         * tst-exit3.c: New test.
3403 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3405         * Makefile (tests): Add tst-exit2.
3406         * tst-exit2.c: New file.
3408 2004-11-09  Roland McGrath  <roland@redhat.com>
3410         [BZ #530]
3411         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3412         here, before calling clone.
3413         * pthread_create.c (start_thread): Don't do it here.
3415 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3417         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3419 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3421         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3422         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3423         assembler warning.
3425 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3427         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3428         if sched_priority is not between minprio and maxprio.
3430 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3432         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3433         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3435         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3436         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3438 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3440         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3441         not-cancelable I/O functions.
3443 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3445         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3446         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3447         make sure 2 is stored in the futex and we looked at the old value.
3448         Fix a few other problems to return the correct value.
3450 2004-10-14  Richard Henderson  <rth@redhat.com>
3452         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3453         make gcc4 happy.
3455 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3457         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3458         of pthread-functions.h and pthreaddef.h.
3459         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3461         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3462         Change __data.__nwaiters from int to unsigned int.
3464         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3465         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3467         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3468         before return type.
3470         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3471         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3473 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3475         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3476         test fails, remove message queue.
3477         (tf_msgsnd): Likewise.
3479 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3481         * tst-clock1.c: Change #ifdef to #if defined.
3482         * tst-clock2.c: Likewise.
3483         * tst-cond11.c: Likewise.
3485         * sysdeps/pthread/timer_create.c (timer_create): Use
3486         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3487         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3488         THREAD_CPUTIME.
3490 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3492         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3493         _POSIX_THREAD_CPUTIME): Define to 0.
3495 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3497         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3498         and _POSIX_THREAD_CPUTIME to zero.
3499         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3500         * tst-barrier2.c: Fix testing for POSIX feature.
3501         * tst-clock1.c: Likewise.
3502         * tst-clock2.c: Likewise.
3503         * tst-cond11.c: Likewise.
3504         * tst-cond4.c: Likewise.
3505         * tst-cond6.c: Likewise.
3506         * tst-flock2.c: Likewise.
3507         * tst-mutex4.c: Likewise.
3508         * tst-mutex9.c: Likewise.
3509         * tst-rwlock12.c: Likewise.
3510         * tst-rwlock4.c: Likewise.
3511         * tst-signal1.c: Likewise.
3512         * tst-spin2.c: Likewise.
3513         * sysdeps/pthread/posix-timer.h: Likewise.
3514         * sysdeps/pthread/timer_create.c: Likewise.
3515         * sysdeps/pthread/timer_routines.c: Likewise.
3517 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3519         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3520         (__lll_mutex_timedlock_wait): Address futex correctly.
3522         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3523         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3524         make sure 2 is stored in the futex and we looked at the old value.
3525         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3526         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3527         which might very well made the code not working at all before.
3528         [BZ #417]
3530 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3532         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3533         allow SIGSETXID to be sent.
3534         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3535         for SIGSETXID to be defined.
3536         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3537         SIGSETXID cannot be blocked.
3539         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3540         Add __extension__ to long long types.
3541         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3542         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3543         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3544         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3545         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3546         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3547         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3549 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3551         * descr.h (struct pthread): Add stopped_start field.
3552         * sysdeps/pthread/createthread.c (create_thread): Set
3553         start_stopped flag in descriptor for new thread appropriately.
3554         * pthread_create.c (start_thread): Only take lock to be stopped on
3555         startup if stopped_start flag says so.
3557 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3559         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3560         is created detached and if yes, do not try to free the stack in case
3561         the thread creation failed.
3562         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3563         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3564         case there has been no error.  [BZ #405]
3566         * pthread_create.c (start_thread): Don't wait for scheduler data
3567         etc to be set at the beginning of the function.  The cancellation
3568         infrastructure must have been set up.  And enable async
3569         cancellation before potentially going to sleep.  [BZ #401]
3571 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3573         * Versions: Remove exports for pthread_set*id_np functions.
3574         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3575         for now.
3576         * Makefile: Don't build pthread_set*id code for now.
3578 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3580         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3581         internal use.
3582         * allocatestack.c (__nptl_setxid): New function.
3583         * descr.h (struct xid_command): Define type.
3584         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3585         (sighandler_setxid): New function.
3586         (__pthread_initialize_minimal): Register sighandler_setxid for
3587         SIGCANCEL.
3588         * pt-allocrtsig.c: Update comment.
3589         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3590         Declare __nptl_setxid.
3591         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3592         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3593         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3594         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3595         and pthread_setresuid_np.
3596         * pthread_setgid_np.c: New file.
3597         * pthread_setuid_np.c: New file.
3598         * pthread_setegid_np.c: New file.
3599         * pthread_seteuid_np.c: New file.
3600         * pthread_setregid_np.c: New file.
3601         * pthread_setreuid_np.c: New file.
3602         * pthread_setresgid_np.c: New file.
3603         * pthread_setresuid_np.c: New file.
3604         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3605         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3606         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3607         and pthread_setresuid_np.
3608         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3609         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3610         pthread_setregid, and pthread_setresgid.
3612 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3614         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3615         ENOMEM when out of memory.
3617 2004-09-10  Roland McGrath  <roland@redhat.com>
3619         [BZ #379]
3620         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3621         code, since we don't try to use the broken CLONE_STOPPED any more.
3622         * pthread_create.c (start_thread): Likewise.
3624 2004-09-15  Richard Henderson  <rth@redhat.com>
3626         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3628 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3630         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3631         (__libc_unwind_longjmp): Delete macro and declare as function.
3632         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3633         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3634         nptl directory.
3635         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3636         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3637         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3639 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3641         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3642         for __USE_XOPEN2K.
3643         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3644         types also for __USE_XOPEN2K.
3645         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3646         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3647         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3648         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3649         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3650         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3651         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3652         [BZ #320]
3654 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3656         * sysdeps/pthread/pthread.h
3657         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3658         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3659         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3660         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3661         [BZ #375]
3663 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3665         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3666         PSEUDO to be used with . prefix.
3668         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3669         Use atomic_increment instead of atomic_exchange_and_add.
3670         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3671         Likewise.
3672         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3673         Likewise.
3674         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3675         Likewise.
3677         * allocatestack.c (allocate_stack): Use atomic_increment_val
3678         instead of atomic_exchange_and_add.
3679         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3680         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3681         Likewise.
3682         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3683         Likewise.
3685         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3686         the initialization function might throw.
3688 2005-09-05  Richard Henderson  <rth@redhat.com>
3690         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3691         Move definition inside libpthread, libc, librt check.  Provide
3692         definition for rtld.
3694 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3696         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3697         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3698         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3699         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3700         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3701         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3702         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3703         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3704         * unwind.c: Use it.
3706         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3707         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3708         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3709         Likewise.
3710         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3711         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3712         this is the last waiter, signal pthread_cond_destroy caller and
3713         avoid using the pthread_cond_t structure after unlock.
3714         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3715         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3716         Read clock type from the least significant bits of __nwaiters instead
3717         of __clock.
3718         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3719         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
3721 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
3723         [BZ #342]
3724         * Makefile (tests): Add tst-cond20 and tst-cond21.
3725         * tst-cond20.c: New test.
3726         * tst-cond21.c: New test.
3727         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3728         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
3729         it unsigned int.
3730         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3731         Likewise.
3732         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3733         (pthread_cond_t): Likewise.
3734         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3735         Likewise.
3736         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3737         Likewise.
3738         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3739         Likewise.
3740         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
3741         (cond_nwaiters): New.
3742         (clock_bits): New.
3743         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
3744         if there are waiters not signalled yet.
3745         Wait until all already signalled waiters wake up.
3746         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
3747         __nwaiters.  If pthread_cond_destroy has been called and this is the
3748         last waiter, signal pthread_cond_destroy caller and avoid using
3749         the pthread_cond_t structure after unlock.
3750         (__pthread_cond_wait): Increment __nwaiters in the beginning,
3751         decrement it when leaving.  If pthread_cond_destroy has been called
3752         and this is the last waiter, signal pthread_cond_destroy caller.
3753         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3754         Likewise.  Read clock type from the least significant bits of
3755         __nwaiters instead of __clock.
3756         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
3757         whether clock ID can be encoded in COND_CLOCK_BITS bits.
3758         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
3759         clock type just from the last COND_CLOCK_BITS bits of value.
3760         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
3761         instead of __clock, just from second bit of condattr's value.
3763 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
3765         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
3766         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
3767         != 64.
3768         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3770 2004-08-15  Roland McGrath  <roland@frob.com>
3772         * pthread_atfork.c: Update copyright terms including special exception
3773         for these trivial files, which are statically linked into executables
3774         that use dynamic linking for the significant library code.
3776 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3778         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
3779         pthread_rwlock_rdlock.
3780         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
3781         Decrease __nr_readers_queued after reacquiring lock.
3782         * sysdeps/pthread/pthread_rwlock_timedrdlock
3783         (pthread_rwlock_timedrdlock): Likewise.
3784         Reported by Bob Cook <bobcook47@hotmail.com>.
3786 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
3788         * tst-rwlock14.c (tf): Read main thread handle from *ARG
3789         before pthread_barrier_wait.
3791 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
3793         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3794         Remove unnecessary exception handling data.
3796 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
3798         [BZ #284]
3799         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
3800         instead of clockid_t.
3802 2004-07-21  Roland McGrath  <roland@redhat.com>
3804         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
3806 2004-07-19  Roland McGrath  <roland@redhat.com>
3808         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
3810 2004-07-02  Roland McGrath  <roland@redhat.com>
3812         * configure: Don't exit.
3814 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3816         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3817         (__pthread_cond_timedwait): Check for invalid nanosecond in
3818         timeout value.
3820 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
3822         * Makefile: Add rules to build and run tst-fini1.
3823         * tst-fini1.c: New file.
3824         * tst-fini1mod.c: New file.
3826 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
3828         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
3829         if no cancellation support is needed.
3830         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3831         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3832         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3833         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3834         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3835         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3836         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3837         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3838         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3840         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
3841         only if not already defined.
3843 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
3845         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
3846         constraint "m" instead of "0" for futex.
3848         * shlib-versions: Add powerpc64-.*-linux.*.
3850 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
3852         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
3853         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
3854         for valid tv_nsec.
3855         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
3856         1 billion and 64-bit tv_nsec which is valid when truncated to 32
3857         bits.
3859 2004-06-29  Roland McGrath  <roland@redhat.com>
3861         * Banner: NPTL no longer has its own version number.
3862         * Makefile (nptl-version): Variable removed.
3863         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
3864         using $(version), the glibc version number.
3866 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3868         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
3869         Fix branch offset for a PLT entry.
3870         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
3871         Likewise.
3872         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3873         Likewise.
3874         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
3875         Likewise.
3876         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
3877         Likewise.
3879 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3881         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
3882         unconditionally.
3884 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3886         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3887         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
3888         instead of tv_sec.
3889         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
3890         (pthread_rwlock_timedrdlock): Likewise.
3892 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
3894         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
3895         Set __r7 to val, not mutex.
3897 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
3899         * Makefile: Add rules to build tst-rwlock14.
3900         * tst-rwlock14.c: New file.
3902 2004-06-24  Boris Hu  <boris.hu@intel.com>
3904         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
3905         check.
3906         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3908 2004-06-19  Andreas Jaeger  <aj@suse.de>
3910         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
3911         assembler in last patch.
3913 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
3915         * sysdeps/pthread/pthread_cond_timedwait.c
3916         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
3917         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3918         (__pthread_cond_timedwait): Check for invalid nanosecond in
3919         timeout value.
3920         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3921         * tst-cond19.c: New file.
3922         * Makefile: Add rules to build and run tst-cond19.
3924 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
3926         * tst-context1.c (GUARD_PATTERN): Defined.
3927         (tst_context_t): Define struct containing ucontext_t & guard words.
3928         (ctx): Declare as an array of tst_context_t.
3929         (fct): Verify uc_link & guard words are still valid.
3930         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
3932 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3934         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3935         Add __data.__futex field, reshuffle __data.__clock.
3936         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
3937         (__pthread_cond_signal): Increment __futex at the same time as
3938         __wakeup_seq or __total_seq.  Pass address of __futex instead of
3939         address of low 32-bits of __wakeup_seq to futex syscall.
3940         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
3941         (__pthread_cond_wait): Likewise.  Pass __futex value from before
3942         releasing internal lock to FUTEX_WAIT.
3943         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3944         (__pthread_cond_timedwait): Likewise.
3945         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
3946         (FUTEX_CMP_REQUEUE): Define.
3947         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
3948         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
3949         Pass __futex value from before the unlock and __futex address instead
3950         of address of low 32-bits of __wakeup_seq to futex syscall.
3951         Fallback to FUTEX_WAKE all on any errors.
3953 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
3955         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
3956         comment typo.
3957         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
3958         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
3959         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
3960         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
3961         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
3963 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3965         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
3966         Add memory clobber to inline assembly.
3967         (__lll_mutex_trylock): Likewise.
3968         (__lll_mutex_cond_trylock): Likewise.
3970 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3972         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
3973         Pass val argument as 6th system call argument in %r7.
3975 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
3977         * Makefile (tests): Add tst-cond16.
3978         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
3979         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
3980         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3981         Add __data.__futex field, reshuffle __data.__clock.
3982         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
3983         (__pthread_cond_signal): Increment __futex at the same time as
3984         __wakeup_seq or __total_seq.  Pass address of __futex instead of
3985         address of low 32-bits of __wakeup_seq to futex syscall.
3986         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
3987         (__pthread_cond_wait): Likewise.  Pass __futex value from before
3988         releasing internal lock to FUTEX_WAIT.
3989         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
3990         (__pthread_cond_timedwait): Likewise.
3991         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
3992         (FUTEX_CMP_REQUEUE): Define.
3993         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
3994         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
3995         Pass __futex value from before the unlock and __futex address instead
3996         of address of low 32-bits of __wakeup_seq to futex syscall.
3997         Fallback to FUTEX_WAKE all on any errors.
3998         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
3999         Define.
4000         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4001         internally.  Return non-zero if error, zero if success.
4002         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4003         Add __data.__futex field, reshuffle __data.__clock.
4004         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4005         Define.
4006         (lll_futex_requeue): Add val argument, return 1 unconditionally
4007         for the time being.
4008         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4009         Add __data.__futex field, reshuffle __data.__clock.
4010         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4011         Define.
4012         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4013         internally.  Return non-zero if error, zero if success.
4014         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4015         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4016         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4017         Define.
4018         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4019         internally.  Return non-zero if error, zero if success.
4020         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4021         Add __data.__futex field, reshuffle __data.__clock.
4022         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4023         Define.
4024         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4025         internally.  Return non-zero if error, zero if success.
4026         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4027         Add __data.__futex field, reshuffle __data.__clock.
4028         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4029         Add __data.__futex field, reshuffle __data.__clock.
4030         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4031         Increment __futex at the same time as __wakeup_seq or __total_seq.
4032         Pass address of __futex instead of address of low 32-bits of
4033         __wakeup_seq to futex syscall.
4034         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4035         Pass __futex value from before releasing internal lock
4036         to FUTEX_WAIT.
4037         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4038         Likewise.  Avoid unnecessary shadowing of variables.
4039         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4040         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4041         unlock and __futex address instead of address of low 32-bits of
4042         __wakeup_seq to futex_requeue macro, adjust for new return value
4043         meaning.
4044         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4045         (__pthread_cond_signal): Increment __futex at the same time as
4046         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4047         address of low 32-bits of __wakeup_seq to futex syscall.
4048         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4049         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4050         releasing internal lock to FUTEX_WAIT.
4051         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4052         (__pthread_cond_timedwait): Likewise.
4053         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4054         (FUTEX_CMP_REQUEUE): Define.
4055         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4056         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4057         Pass __futex value from before the unlock and __futex address instead
4058         of address of low 32-bits of __wakeup_seq to futex syscall.
4059         Fallback to FUTEX_WAKE all on any errors.
4061 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4063         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4064         Add nop to align the end of critical section.
4065         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4067 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4069         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4070         Add __broadcast_seq field.
4071         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4072         all waiters as woken with woken_seq and bump broadcast counter.
4073         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4074         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4075         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4076         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4078 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4080         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4081         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4082         Reported by Kaz Kojima.
4084 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4086         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4088 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4090         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4091         __broadcast_seq with bc_seq after acquiring internal lock instead of
4092         before it.
4094 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4096         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4097         compilation.
4098         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4099         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4100         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4101         (pthread_cond_t): Add __data.__broadcast_seq field.
4102         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4103         (FRAME_SIZE): Define.
4104         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4105         Comment typo fixes.
4106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4107         Define.
4108         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4109         typo fixes.
4110         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4111         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4112         fixes.
4114 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4116         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4117         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4118         Add __broadcast_seq field.
4119         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4120         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4121         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4122         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4123         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4124         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4125         all waiters as woken with woken_seq and bump broadcast counter.
4126         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4127         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4128         __broadcast_seq field.
4129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4130         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4131         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4132         * pthread_cond_init.c: Initialize __broadcast_seq field.
4133         * Makefile (tests): Add tst-cond17 and tst-cond18.
4134         Add .NOTPARALLEL goal.
4135         * tst-cond16.c: New file.  From Jakub.
4136         * tst-cond17.c: New file.  From Jakub.
4137         * tst-cond18.c: New file.  From Jakub.
4139 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4141         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4142         unwind info.
4144         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4145         Parametrize frame size.  Correct some unwind info.
4146         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4148 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4150         * tst-stack3.c: Note testing functionality beyond POSIX.
4152 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4154         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4155         Change conditional from ifdef to if.
4157 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4159         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4160         SYSDEP_CANCEL_ERROR): Define.
4161         (PSEUDO): Use it.
4163 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4165         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4167 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4169         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4171 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4173         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4174         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4175         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4176         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4178 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4180         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4181         thread has all signals blocked.
4183 2004-04-18  Andreas Jaeger  <aj@suse.de>
4185         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4186         (SEM_VALUE_MAX): Add missing brace.
4188 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4190         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4191         in rt subdir.
4192         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4193         * sysdeps/pthread/tst-mqueue8x.c: New test.
4194         * tst-cancel4.c: Update comment about message queues.
4196         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4197         return it_value { 0, 0 }.
4198         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4199         like SIGEV_SIGNAL.
4200         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4201         assertion for SIGEV_NONE.
4202         (thread_attr_compare): Compare all attributes, not just a partial
4203         subset.
4205 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4207         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4209 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4211         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4212         Just use a plain number.
4213         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4214         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4215         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4216         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4217         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4218         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4219         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4221 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4223         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4224         frame info.
4225         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4227 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4229         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4230         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4231         of calling sigwaitinfo.
4233 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4235         * allocatestack.c (allocate_stack): Set reported_guardsize
4236         unconditionally.
4237         * pthread_getattr_np.c (pthread_getattr_np): Use
4238         reported_guardsize instead of guardsize.
4239         * descr.h (struct pthread): Add reported_guardsize field.
4241 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4243         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4245 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4247         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4249 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4251         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4252         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4253         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4254         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4255         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4256         Define.
4257         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4258         (_POSIX_MESSAGE_PASSING): Define.
4259         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4260         (_POSIX_MESSAGE_PASSING): Define.
4261         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4262         (_POSIX_MESSAGE_PASSING): Define.
4264 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4266         * tst-context1.c (fct): Check whether correct stack is used.
4268 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4270         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4271         matching constraints for asm mem parameters.
4273         * tst-clock2.c (tf): Don't define unless needed.
4275 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4277         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4278         $(gnulib).
4280 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4282         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4283         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4284         * pthreadP.h: Declare __nptl_deallocate_tsd.
4285         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4286         Adjust caller.
4288         * Makefile (tests): Add tst-tsd5.
4289         * tst-tsd5.c: New file.
4291 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4293         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4294         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4295         is SHLIB_COMPAT check.
4296         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4297         (__pthread_attr_getaffinity_old): Likewise.
4298         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4299         (__pthread_getaffinity_old): Likewise.
4300         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4301         (__pthread_setaffinity_old): Likewise.
4303 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4305         * allocatestack.c (_make_stacks_executable): Call
4306         _dl_make_stack_executable first.
4308 2004-03-24  Roland McGrath  <roland@redhat.com>
4310         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4311         constraint instead of "0".
4313 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4315         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4316         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4318         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4319         code to avoid warning.
4321 2004-03-24  Andreas Jaeger  <aj@suse.de>
4323         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4324         (__pthread_attr_setaffinity_old): Remove const.
4326 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4328         * sysdeps/unix/sysv/linux/smp.h: New file.
4329         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4330         * init.c: Define __is_smp.
4331         (__pthread_initialize_minimal_internal): Call is_smp_system to
4332         initialize __is_smp.
4333         * pthreadP.h: Declare __is_smp.
4334         Define MAX_ADAPTIVE_COUNT is necessary.
4335         * pthread_mutex_init.c: Add comment regarding __spins field.
4336         * pthread_mutex_lock.c: Implement adaptive mutex type.
4337         * pthread_mutex_timedlock.c: Likewise.
4338         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4339         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4340         Add __spins field.
4341         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4342         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4343         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4344         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4345         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4346         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4347         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4348         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4349         lll_mutex_cond_trylock.
4350         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4351         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4352         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4353         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4354         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4355         Define BUSY_WAIT_NOP.
4356         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4357         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4359         * tst-mutex5.c: Add support for testing adaptive mutexes.
4360         * tst-mutex7.c: Likewise.
4361         * tst-mutex5a.c: New file.
4362         * tst-mutex7a.c: New file.
4363         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4365         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4366         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4367         vgettimeofday call might destroy the content.
4369         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4370         @pause in the loop.
4372         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4373         No need to restrict type of ret.  Make it int.  Add comment.
4375         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4376         Remove unnecessary setne instruction.
4378 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4380         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4381         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4382         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4383         If realloc fails, break out of the loop.
4385 2004-03-20  Andreas Jaeger  <aj@suse.de>
4387         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4388         (__pthread_setaffinity_old): Fix interface.
4389         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4390         (__pthread_getaffinity_old): Likewise.
4392         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4393         (__pthread_setaffinity_new): Remove duplicate declaration.
4395 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4397         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4398         the return value to a safe register.
4399         (CDISABLE): Set the function argument correctly.
4401 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4403         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4404         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4405         Rewrite so that only one locked memory operation per round is needed.
4406         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4407         (pthread_barrier_wait): After wakeup, release lock only when the
4408         last thread stopped using the barrier object.
4409         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4410         (__pthread_cond_wait): Don't store mutex address if the current
4411         value is ~0l.  Add correct cleanup support and unwind info.
4412         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4413         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4414         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4415         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4416         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4417         Add correct cleanup support and unwind info.
4418         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4419         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4420         information for syscall wrappers.
4422 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4424         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4425         cpusetsize field, remove next.
4426         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4427         parameter for size of the CPU set.
4428         (pthread_setaffinity_np): Likewise.
4429         (pthread_attr_getaffinity_np): Likewise.
4430         (pthread_attr_setaffinity_np): Likewise.
4431         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4432         interface change, keep compatibility code.
4433         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4434         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4435         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4436         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4437         __pthread_getaffinity_np.
4438         * Versions: Add version for changed interfaces.
4439         * tst-attr3.c: Adjust test for interface change.
4440         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4441         increasing buffer sizes.
4442         * pthread_attr_destroy.c: Remove unused list handling.
4443         * pthread_attr_init.c: Likewise.
4445 2004-03-17  Roland McGrath  <roland@redhat.com>
4447         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4448         first argument to clock_getres so we ever enable kernel timers.
4450 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4452         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4454 2004-03-12  Richard Henderson  <rth@redhat.com>
4456         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4457         oldvalue from CENABLE to CDISABLE.
4459 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4461         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4462         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4463         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4464         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4466 2004-03-11  Richard Henderson  <rth@redhat.com>
4468         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4469         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4470         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4472 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4474         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4475         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4476         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4478 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4480         * forward.c (__pthread_cond_broadcast_2_0,
4481         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4482         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4483         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4485 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4487         * sysdeps/sh/tcb-offsets.sym: Add PID.
4488         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4489         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4491 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4493         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4494         include <sysdep-cancel.h>, vfork is no cancellation point.
4495         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4496         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4497         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4499 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4501         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4502         libc_hidden_def.
4503         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4504         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4505         Likewise.
4506         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4507         Likewise.
4508         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4509         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4510         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4511         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4512         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4514         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4515         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4516         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4517         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4518         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4519         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4521         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4522         a local register for saving old PID.  Negate PID in parent upon exit.
4524         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4525         tcb-offsets.h.
4526         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4527         before syscall, set to the old value in the parent afterwards.
4528         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4529         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4530         tcb-offsets.h.
4531         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4532         before syscall, set to the old value in the parent afterwards.
4533         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4534         * sysdeps/s390/tcb-offsets.sym: Add PID.
4536         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4537         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4538         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4539         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4540         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4541         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4543 2004-03-10  Andreas Schwab  <schwab@suse.de>
4545         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4546         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4547         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4549 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4551         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4552         * tst-cancel21.c (do_one_test): Likewise.
4553         Reported by Gordon Jin <gordon.jin@intel.com>.
4555 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4557         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4558         if non-zero and set to INT_MIN if zero.
4559         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4560         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4561         (SAVE_PID, RESTORE_PID): Define.
4562         (__vfork): Use it.
4563         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4564         Use relative path to avoid including NPTL i386/vfork.S.
4565         (SAVE_PID, RESTORE_PID): Define.
4566         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4567         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4568         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4569         tst-vfork2x.
4570         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4571         * tst-vfork1.c: New test.
4572         * tst-vfork2.c: New test.
4573         * tst-vfork1x.c: New test.
4574         * tst-vfork2x.c: New test.
4576 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4578         * sysdeps/i386/tcb-offsets.sym: Add PID.
4579         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4580         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4581         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4583 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4585         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4587 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4589         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4590         _rtld_global_ro.
4592 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4594         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4595         _rtld_global_ro.
4597         * tst-once4.c: Remove unnecessary macro definition.
4599         * tst-mutex7.c (do_test): Limit thread stack size.
4600         * tst-once2.c (do_test): Likewise.
4601         * tst-tls3.c (do_test): Likewise.
4602         * tst-tls1.c (do_test): Likewise.
4603         * tst-signal3.c (do_test): Likewise.
4604         * tst-kill6.c (do_test): Likewise.
4605         * tst-key4.c (do_test): Likewise.
4606         * tst-join4.c (do_test): Likewise.
4607         * tst-fork1.c (do_test): Likewise.
4608         * tst-context1.c (do_test): Likewise.
4609         * tst-cond2.c (do_test): Likewise.
4610         * tst-cond10.c (do_test): Likewise.
4611         * tst-clock2.c (do_test): Likewise.
4612         * tst-cancel10.c (do_test): Likewise.
4613         * tst-basic2.c (do_test): Likewise.
4614         * tst-barrier4.c (do_test): Likewise.
4616 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4618         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4620 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4622         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4623         (__pthread_cond_timedwait): Optimize wakeup test.
4624         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4625         (__pthread_cond_wait): Likewise.
4626         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4627         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4628         Likewise.
4630 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4632         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4633         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4634         the atomic instruction needed.
4635         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4636         (__lll_mutex_lock_wait): Likewise.
4638 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4640         * Makefile (tests): Add tst-cond14 and tst-cond15.
4641         * tst-cond14.c: New file.
4642         * tst-cond15.c: New file.
4644 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4646         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4647         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4648         needs to be implemented differently to be useful.
4650 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4652         * pthread_attr_setschedparam.c: Don't test priority against limits
4653         here.  Set ATTR_FLAG_SCHED_SET flag.
4654         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4655         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4656         from parent thread to child.  If attribute is used and scheduling
4657         parameters are not inherited, copy parameters from attribute or
4658         compute them.  Check priority value.
4659         * pthread_getschedparam.c: If the parameters aren't known yet get
4660         them from the kernel.
4661         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4662         ATTR_FLAG_POLICY_SET flag for thread.
4663         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4664         and ATTR_FLAG_POLICY_SET.
4666         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4668         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4669         fail if stack address hasn't been set.  Just return 0.
4671 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4673         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4674         libpthread for the files in this list.
4675         (CFLAGS-tst-unload): Removed.
4676         * tst-unload.c (do_test): Don't use complete path for
4677         LIBPHREAD_SO.
4679         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4680         tst-_res1mod2.
4682 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4684         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4685         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4686         operation per round is needed.
4687         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4688         (__lll_mutex_lock_wait): Likewise.
4690 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4692         * tst-cancel9.c (cleanup): Don't print to stderr.
4694 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4696         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4698 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4700         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4701         (__syscall_error_handler2): Call CDISABLE.
4702         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4703         (__syscall_error_handler2): Call CDISABLE.
4705         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4706         Release lock before the loop, don't reacquire it.
4708         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4710 2004-02-19  Andreas Schwab  <schwab@suse.de>
4712         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4713         Fix last change.
4715 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
4717         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4718         (pthread_barrier_wait): After wakeup, release lock only when the
4719         last thread stopped using the barrier object.
4720         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
4721         (pthread_barrier_wait): Likewise.
4722         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4723         Likewise.
4724         * Makefile (tests): Add tst-barrier4.
4725         * tst-barrier4.c: New file.
4727         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4728         (__pthread_cond_timedwait): Perform timeout test while holding
4729         internal lock to prevent wakeup race.
4730         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4731         * sysdeps/pthread/pthread_cond_timedwait.c
4732         (__pthread_cond_timedwait): Likewise.
4733         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4734         (__pthread_cond_timedwait): Likewise.
4736 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
4738         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
4739         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
4740         * Makefile (tests): Add tst-rwlock13.
4741         * tst-rwlock13.c: New test.
4743 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
4745         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4746         (__condvar_tw_cleanup): Little optimization.
4747         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4749 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
4751         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
4752         libpthread as "lib" parameter to SHLIB_COMPAT.
4753         (__novmx_siglongjmp): Fix typo in function name.
4754         (__novmx_longjmp): Fix typo in function name.
4756 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4758         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
4759         __builtin_expect.
4761         * sysdeps/generic/pt-longjmp.c: Moved to...
4762         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
4764 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
4766         * Makefile (libpthread-routines): Add pt-cleanup.
4767         * pt-longjmp.c: Removed.
4768         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
4769         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
4770         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
4771         Version longjmp, siglongjmp for GLIBC_2.3.4.
4772         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
4774 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4776         * sysdeps/pthread/pthread_cond_timedwait.c
4777         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
4778         Reuse code.  Add __builtin_expects.
4780         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4781         (__pthread_cond_timedwait): Get internal lock in case timeout has
4782         passed before the futex syscall.
4783         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4785 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
4787         * allocatestack.c: Pretty printing.
4789         * sysdeps/pthread/createthread.c (create_thread): Don't add
4790         CLONE_DETACHED bit if it is not necessary.
4792 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
4794         * pthread_getattr_np.c: Include ldsodefs.h.
4796 2004-01-16  Richard Henderson  <rth@redhat.com>
4798         * allocatestack.c: Don't declare __libc_stack_end.
4799         * init.c (__pthread_initialize_minimal_internal): Likewise.
4800         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
4802 2004-01-15  Richard Henderson  <rth@redhat.com>
4804         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
4805         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
4806         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
4807         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
4808         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
4809         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
4810         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
4811         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
4813 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
4815         * init.c (pthread_functions): Make array const.
4817 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
4819         * allocatestack.c (__make_stacks_executable): Change interface.
4820         Check parameters.  Pass parameter on to libc counterpart.
4821         * pthreadP.h: Change declaration.
4823 2004-01-13  Richard Henderson  <rth@redhat.com>
4825         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
4826         prototype form.
4827         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
4828         Likewise.
4830         * sysdeps/alpha/Makefile: New file.
4831         * sysdeps/alpha/tcb-offsets.sym: New file.
4832         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4833         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
4835         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
4836         on powerpc version.
4838 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
4840         * Makefile (tests): Add tst-backtrace1.
4841         * tst-backtrace1.c: New test.
4843 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
4845         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
4846         register as second parameter to the REGISTER macro.
4847         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
4848         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
4849         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
4850         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
4851         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
4852         of thread register as second parameter to REGISTER macro in 64 case.
4854 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
4856         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
4857         (CFLAGS-getpid.o): Defined.
4858         (CFLAGS-getpid.os): Defined.
4860 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
4862         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
4863         returned for main thread does not overlap with any other VMA.
4864         Patch by Jakub Jelinek.
4866 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
4868         * tst-raise1.c: Include stdio.h.
4870 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
4872         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
4873         setting with __ASSUME_TGKILL || defined __NR_tgkill.
4874         If pid is 0, set it to selftid.
4875         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
4876         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
4877         != 0, return self->tid without doing a syscall.
4878         * descr.h (struct pthread): Move pid field after tid.
4880         * Makefile (tests): Add tst-raise1.
4881         * tst-raise1.c: New file.
4883 2003-12-23  Roland McGrath  <roland@redhat.com>
4885         * tst-oddstacklimit.c: New file.
4886         * Makefile (tests): Add it.
4887         (tst-oddstacklimit-ENV): New variable.
4889         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
4890         value up to page size for __default_stacksize.
4892 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
4894         * Makefile (tests): Add tst-eintr5.
4895         * tst-eintr5.c: New file.
4897         * eintr.c (eintr_source): Prevent sending signal to self.
4899         * tst-eintr2.c (tf1): Improve error message.
4901 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
4903         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
4904         * sysdeps/unix/sysv/linux/getpid.c: New file.
4905         * pthread_cancel.c: Add comment explaining use of PID field.
4906         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4907         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
4908         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
4909         temporarily to signal the field must not be relied on and updated
4910         by getpid().
4911         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
4912         temporarily negative.
4913         * sysdeps/unix/sysv/linux/raise.c: Likewise.
4915 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
4917         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
4918         (eintr_source): If ARG != NULL, use pthread_kill.
4919         * tst-eintr1.c: Adjust for this change.
4920         * tst-eintr2.c: Likewise.
4921         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
4922         * tst-eintr3.c: New file.
4923         * tst-eintr4.c: New file.
4925 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
4927         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
4928         if CANCELSTATE_BITMASK is set.
4929         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
4930         Likewise.
4932         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
4933         (tests-reverse): Add tst-cancel23.
4934         * tst-cancel22.c: New test.
4935         * tst-cancel23.c: New test.
4937 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
4939         * tst-eintr1.c: Better error messages.
4941         * Makefile (tests): Add tst-eintr2.
4942         * tst-eintr2.c: New file.
4944 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
4946         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
4947         (CFLAGS-tst-cancelx21.c): Set.
4948         * tst-cancel21.c: New test.
4949         * tst-cancelx21.c: New test.
4951         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
4952         comparison operand.
4953         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
4954         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
4955         * pt-longjmp.c: Include jmpbuf-unwind.h.
4956         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
4957         _JMPBUF_UNWINDS.  Adjust compared pointers.
4958         * init.c (__pthread_initialize_minimal_internal): Initialize
4959         pd->stackblock_size.
4960         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
4961         * sysdeps/alpha/jmpbuf-unwind.h: New file.
4962         * sysdeps/i386/jmpbuf-unwind.h: New file.
4963         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
4964         * sysdeps/s390/jmpbuf-unwind.h: New file.
4965         * sysdeps/sh/jmpbuf-unwind.h: New file.
4966         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
4967         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
4968         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
4969         (_JMPBUF_CFA_UNWINDS): Remove.
4970         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
4972 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
4974         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
4975         (CFLAGS-tst-cancelx20.c): Set.
4976         * tst-cancel20.c: New test.
4977         * tst-cancelx20.c: New test.
4979 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
4981         * init.c (__pthread_initialize_minimal_internal): Don't treat
4982         architectures with separate register stack special here when
4983         computing default stack size.
4985 2003-12-17  Roland McGrath  <roland@redhat.com>
4987         * Makefile (tst-cancelx7-ARGS): New variable.
4988         Reportd by Greg Schafer <gschafer@zip.com.au>.
4990 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
4992         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
4993         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
4994         (tst-stack3-ENV): Set.
4995         ($(objpfx)tst-stack3-mem): New.
4996         * tst-stack3.c: New test.
4998 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5000         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5001         Add unwind directives.  Drop unused .regstk directive.
5002         (_fini_EPILOG_BEGINS): Add unwind directives.
5004 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5006         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5007         Assume parameter is a pointer.
5008         (lll_futex_wake): Likewise.
5009         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5010         Likewise.
5011         (lll_futex_wake): Likewise.
5012         Reported by Boris Hu.
5013         * sysdeps/unix/sysv/linux/unregister-atfork.c
5014         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5016         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5018 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5020         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5021         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5022         __rtld_lock_initialize for ld.so lock.
5023         Patch in part by Adam Li <adam.li@intel.com>.
5025 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5027         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5028         in $(gnulib).  Also, remove stale comment.
5030 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5032         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5033         advantage of new syscall stub and optimize accordingly.
5035         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5036         from SYS_futex, to match expectations of
5037         sysdep.h:DO_INLINE_SYSCALL.
5038         (lll_futex_clobbers): Remove.
5039         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5040         (lll_futex_wake): Likewise.
5041         (lll_futex_requeue): Likewise.
5042         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5043         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5044         Jelinek).
5045         (__lll_mutex_lock): Likewise.
5046         (__lll_mutex_cond_lock): Likewise.
5047         (__lll_mutex_timed_lock): Likewise.
5048         (__lll_mutex_unlock): Likewise.
5049         (__lll_mutex_unlock_force): Likewise.
5051         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5052         comes before the include of <sysdep.h>.
5053         (THREAD_SELF_SYSINFO): New macro.
5054         (THREAD_SYSINFO): Likewise.
5055         (INIT_SYSINFO): New macro.
5056         (TLS_INIT_TP): Call INIT_SYSINFO.
5058         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5060         * sysdeps/pthread/createthread.c (create_thread): Use
5061         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5062         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5063         THREAD_SELF_SYSINFO instead of open code.
5064         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5065         (THREAD_SYSINFO): Likewise.
5067         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5069         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5071 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5073         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5074         instead of .init.  Patch by David Mosberger.
5076 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5078         * sysdeps/pthread/configure.in: Remove broken declaration in C
5079         cleanup handling check.
5081 2003-11-30  Andreas Jaeger  <aj@suse.de>
5083         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5084         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5085         Likewise.
5087 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5089         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5090         * pthread_attr_destroy.c: Include shlib-compat.h.
5091         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5092         is set in iattr->flags.
5093         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5095 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5097         * Makefile (distribute): Add tst-cleanup4aux.c.
5099         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5100         include.
5102 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5104         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5105         pthread_cond_signal.
5107         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5108         store mutex address if the current value is ~0l.
5109         * sysdeps/pthread/pthread_cond_timedwait.c
5110         (__pthread_cond_timedwait): Likewise.
5111         * sysdeps/pthread/pthread_cond_broadcast.c
5112         (__pthread_cond_broadcast): Don't use requeue for pshared
5113         condvars.
5115         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5116         (__pthread_cond_wait): Don't store mutex address if the current
5117         value is ~0l.
5118         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5119         (__pthread_cond_timedwait): Likewise.
5120         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5121         (__pthread_cond_broadcast): Don't use requeue for pshared
5122         condvars.
5124         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5125         element with ~0l for pshared condvars, with NULL otherwise.
5127         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5128         (__pthread_cond_wait): Don't store mutex address if the current
5129         value is ~0l.
5130         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5131         (__pthread_cond_timedwait): Likewise.
5132         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5133         (__pthread_cond_broadcast): Don't use requeue for pshared
5134         condvars.
5136         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5137         * tst-cond12.c: New file.
5138         * tst-cond13.c: New file.
5140 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5142         * sysdeps/pthread/configure.in: Make missing forced unwind support
5143         fatal.
5145 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5147         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5149 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5151         * Makefile: Add magic to clean up correctly.
5153 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5155         * unwind.c (FRAME_LEFT): Define.
5156         (unwind_stop): Handle old style cleanups here.
5157         (__pthread_unwind): Handle old style cleanups only if
5158         !HAVE_FORCED_UNWIND.
5159         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5160         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5161         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5162         ($(objpfx)tst-cleanupx4): Likewise.
5163         * tst-cleanup4.c: New test.
5164         * tst-cleanup4aux.c: New.
5165         * tst-cleanupx4.c: New test.
5167 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5169         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5170         lll_mutex_*lock macros to skip atomic operations on some archs.
5172 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5174         * sysdeps/pthread/tst-timer.c (main): Initialize
5175         sigev2.sigev_value as well.
5177 2003-10-15  Roland McGrath  <roland@redhat.com>
5179         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5180         is missing.
5181         * sysdeps/pthread/configure: Regenerated.
5183 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5185         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5186         locking macros.  No distinction between normal and mutex locking
5187         anymore.
5188         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5189         Merge bits from lowlevelmutex.S we still need.
5190         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5191         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5192         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5193         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5194         new mutex implementation.
5195         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5196         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5197         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5198         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5199         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5200         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5201         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5202         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5203         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5204         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5205         symbol for entry point to avoid cancellation.
5207 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5209         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5210         changes.
5211         (SAVE_OLDTYPE_0): Fix a typo.
5213 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5215         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5216         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5218 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5220         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5221         correct offset.
5223 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5225         * Makefile (tests): Add tst-cancel19.
5226         * tst-cancel19.c: New test.
5228 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5230         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5231         restoring of the old cancellation type.
5233 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5235         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5237 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5239         * sysdeps/pthread/malloc-machine.h: New file
5241 2003-09-24  Roland McGrath  <roland@redhat.com>
5243         * allocatestack.c (__make_stacks_executable): Don't ignore return
5244         value from _dl_make_stack_executable.
5246 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5248         * allocatestack.c (__make_stacks_executable): Also change
5249         permission of the currently unused stacks.
5251         * allocatestack.c (change_stack_perm): Split out from
5252         __make_stacks_executable.
5253         (allocate_stack): If the required permission changed between the time
5254         we started preparing the stack and queueing it, change the permission.
5255         (__make_stacks_executable): Call change_stack_perm.
5257         * Makefile: Build tst-execstack-mod locally.
5258         * tst-execstack-mod.c: New file.
5260 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5262         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5264 2003-09-23  Roland McGrath  <roland@redhat.com>
5266         * tst-execstack.c: New file.
5267         * Makefile (tests): Add it.
5268         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5269         (LDFLAGS-tst-execstack): New variable.
5271         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5272         whether to use PROT_EXEC for stack mmap.
5273         (__make_stacks_executable): New function.
5274         * pthreadP.h: Declare it.
5275         * init.c (__pthread_initialize_minimal_internal): Set
5276         GL(dl_make_stack_executable_hook) to that.
5278 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5280         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5281         recommendation from AMD re avoidance of lock prefix.
5283 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5285         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5286         lll_futex_timed_wait instead of lll_futex_wait.
5287         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5288         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5289         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5290         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5291         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5292         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5293         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5294         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5295         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5296         Completely revamp the locking macros.  No distinction between
5297         normal and mutex locking anymore.
5298         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5299         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5300         __lll_lock_timedwait): Fix prototypes.
5301         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5302         __lll_lock_timedwait): Likewise.
5303         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5304         macros, add __builtin_expect.
5305         (lll_mutex_timedlock): Likewise.  Fix return value.
5306         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5307         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5308         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5309         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5310         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5311         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5312         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5313         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5315 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5317         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5318         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5319         operation if possible.
5321         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5322         like jumping over the lock prefix.
5324 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5326         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5327         locking macros.  No distinction between normal and mutex locking
5328         anymore.
5329         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5330         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5331         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5332         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5333         locking.  Merge bits from lowlevelmutex.S we still need.
5334         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5335         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5336         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5337         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5338         * Makefile (routines): Remove libc-lowlevelmutex.
5339         (libpthread-rountines): Remove lowlevelmutex.
5340         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5341         for new mutex implementation.
5342         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5343         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5344         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5345         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5346         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5347         Likewise.
5348         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5349         Likewise.
5350         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5351         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5352         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5353         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5354         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5355         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5356         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5357         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5358         Likewise.
5359         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5360         Likewise.
5361         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5362         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5363         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5364         Don't use requeue.
5365         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5366         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5368 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5370         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5371         in parameters of asm with output parameters.
5373         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5374         type of DECR parameter to int.
5375         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5377 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5379         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5380         guardsize for each thread.
5382 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5384         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5385         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5386         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5388         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5389         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5390         NULL.
5391         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5392         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5393         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5394         (pthread_getaffinity_np): Add hidden_def.
5396         * Makefile (tests): Add tst-attr3.
5397         * tst-attr3.c: New test.
5399         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5401 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5403         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5404         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5406 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5408         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5409         * tst-align.c: Include tst-stack-align.h.
5410         (tf, do_test): Use TEST_STACK_ALIGN macro.
5412 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5414         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5415         variable.
5417 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5419         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5420         stack-related values for the initial thread.
5422 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5424         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5426 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5428         * pthread_mutex_lock.c: Minor code rearrangements.
5430 2003-09-05  Roland McGrath  <roland@redhat.com>
5432         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5433         Instead, include ../nptl_db/db_info.c to do its magic.
5434         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5435         (__pthread_pthread_key_2ndlevel_size): Likewise.
5436         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5437         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5438         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5439         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5440         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5441         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5442         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5443         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5444         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5445         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5446         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5447         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5448         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5449         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5450         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5451         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5452         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5454 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5456         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5457         of pthread_t to be compatible with LT.
5458         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5459         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5460         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5461         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5462         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5463         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5464         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5466 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5468         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5470 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5472         * unwind-forcedunwind.c: Move to...
5473         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5474         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5475         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5476         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5477         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5478         * unwind.c: Include jmpbuf-unwind.h.
5479         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5481 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5483         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5484         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5485         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5486         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5487         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5488         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5489         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5490         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5491         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5492         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5493         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5494         function.
5495         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5496         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5497         * Makefile (tests): Add tst-stack2.
5498         * tst-stack2.c: New test.
5499         * tst-stack1.c: Include limits.h and sys/param.h.
5500         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5502         * pthread_condattr_setpshared.c: Include errno.h.
5503         (pthread_condattr_setpshared): Return EINVAL if pshared
5504         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5506         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5507         defined symbol for entry point to avoid cancellation.
5508         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5509         Likewise.
5510         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5511         Likewise.
5512         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5513         Likewise.
5514         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5515         Likewise.
5516         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5517         Likewise.
5518         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5519         __close_nocancel, __read_nocancel, __write_nocancel,
5520         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5521         libpthread.so or librt.so, define to corresponding function
5522         without _nocancel suffix.
5523         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5524         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5525         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5527         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5529 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5531         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5532         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5534         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5535         in subsections has a symbol associated with it.
5537         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5538         defined symbol for entry point to avoid cancellation.
5539         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5541 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5543         * Makefile (tests): Add tst-tls5.
5544         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5545         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5546         ($(objpfx)tst-tls5): New.
5547         ($(objpfx)tst-tls6.out): Likewise.
5548         (tests): Depend on $(objpfx)tst-tls6.out.
5549         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5550         (do_test): Check pthread_self () return value alignment.
5551         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5552         (tf): Check pthread_self () return value alignment.
5553         * tst-tls5.c: New test.
5554         * tst-tls5.h: New.
5555         * tst-tls5mod.c: New.
5556         * tst-tls5moda.c: New.
5557         * tst-tls5modb.c: New.
5558         * tst-tls5modc.c: New.
5559         * tst-tls5modd.c: New.
5560         * tst-tls5mode.c: New.
5561         * tst-tls5modf.c: New.
5562         * tst-tls6.sh: New test.
5564         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5565         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5566         * init.c (pthread_functions): Initialize them.
5567         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5568         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5569         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5570         pthread_cond_timedwait@@GLIBC_2.3.2.
5572 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5574         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5575         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5576         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5577         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5578         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5579         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5581         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5583         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5584         _POSIX_THREAD_PRIORITY_SCHEDULING.
5585         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5587 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5589         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5590         nested function, use static inline function from libio.h.
5591         Code by Richard Henderson.
5593         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5594         weak.
5596 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5598         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5599         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5600         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5601         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5602         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5603         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5604         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5605         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5606         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5607         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5608         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5609         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5610         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5611         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5612         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5613         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5614         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5615         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5616         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5617         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5618         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5619         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5620         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5621         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5622         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5623         * sysdeps/sparc/tls.h: New file.
5624         * sysdeps/sparc/tcb-offsets.sym: New file.
5625         * sysdeps/sparc/Makefile: New file.
5626         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5627         * init.c [__sparc__] (__NR_set_tid_address): Define.
5629 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5631         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5632         _IO_release_lock): Define.
5634 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5636         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5637         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5639 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5641         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5642         (__pthread_cleanup_class): Add missing return types of member
5643         functions.
5645 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5647         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5648         (lll_mutex_unlock_force): Add memory barrier between store and futex
5649         syscall.
5651 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5653         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5654         tempmsg in first loop.
5656 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5658         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5659         _POSIX_THREAD_PRIORITY_SCHEDULING.
5660         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5662 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5664         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5665         (__rtld_lock_default_lock_recursive,
5666         __rtld_lock_default_unlock_recursive): Define.
5667         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5668         __rtld_lock_unlock_recursive): Define using
5669         GL(_dl_rtld_*lock_recursive).
5670         * init.c (__pthread_initialize_minimal_internal): Initialize
5671         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5672         Lock GL(_dl_load_lock) the same number of times as
5673         GL(_dl_load_lock) using non-mt implementation was nested.
5675         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5676         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5678 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5680         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5681         PIPE_BUF.
5683 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5685         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5687 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5689         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5690         to first syscall error check.  Move syscall error check for tkill
5691         into __ASSUME_CLONE_STOPPED #ifdef.
5693 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5695         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5696         is not defined, do explicit synchronization.
5697         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5698         is not defined also unlock pd->lock for non-debugging case in case
5699         it is necessary.
5700         * pthread_create.c (start_thread): Always get and release pd->lock
5701         if __ASSUME_CLONE_STOPPED is not defined.
5702         (start_thread_debug): Removed.  Adjust users.
5703         * allocatestack.c (allocate_stack): Always initialize lock if
5704         __ASSUME_CLONE_STOPPED is not defined.
5705         * Makefile (tests): Add tst-sched1.
5706         * tst-sched1.c: New file.
5708         * sysdeps/pthread/createthread.c (do_clone): Only use
5709         sched_setschduler and pass correct parameters.
5711 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5713         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
5714         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
5715         PTHREAD_STACK_MIN in comments.
5717 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5719         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5720         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
5721         argument.
5722         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
5723         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
5724         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
5725         (__pthread_cleanup_upto): Fix prototype.
5726         (_longjmp_unwind): Adjust caller.
5727         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
5728         Change second argument to const struct pointer.
5729         * tst-sem8.c (main): Remove unused s2 and s3 variables.
5730         * tst-sem9.c (main): Likewise.
5731         * unwind.c: Include string.h for strlen prototype.
5733 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
5735         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5736         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
5737         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
5738         Define HAVE_CMOV.
5739         Patch by Nicholas Miell <nmiell@attbi.com>.
5741 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
5743         * init.c (__pthread_initialize_minimal_internal): Initialize
5744         GL(dl_init_static_tls).
5745         * pthreadP.h (__pthread_init_static_tls): New prototype.
5746         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
5747         New functions.
5748         * Makefile (tests): Add tst-tls4.
5749         (modules-names): Add tst-tls4moda and tst-tls4modb.
5750         ($(objpfx)tst-tls4): Link against libdl and libpthread.
5751         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
5752         tst-tls4modb.so.
5753         * tst-tls4.c: New file.
5754         * tst-tls4moda.c: New file.
5755         * tst-tls4modb.c: New file.
5757 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
5759         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
5760         before __timer_dealloc.
5761         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
5762         Don't call list_unlink.
5764 2003-07-29  Roland McGrath  <roland@redhat.com>
5766         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
5768 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
5770         * tst-cancel17.c (do_test): Check if aio_cancel failed.
5771         Don't reuse struct aiocb A if it failed.
5772         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
5773         not just one byte, as that does not block.
5775 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
5777         * sysdeps/pthread/unwind-resume.c: New file.
5778         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
5779         unwind-resume in csu subdir.
5780         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
5781         exceptions.
5782         (librt-sysdep_routines, librt-shared-only-routines): Add
5783         rt-unwind-resume.
5784         * sysdeps/pthread/rt-unwind-resume.c: New file.
5785         * unwind-forcedunwind.c: New file.
5786         * Makefile (libpthread-routines): Add unwind-forcedunwind.
5787         (libpthread-shared-only-routines): Likewise.
5788         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
5789         * pthreadP.h (pthread_cancel_init): New prototype.
5790         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
5792         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
5793         attr argument const struct pthread_attr *.
5795         * res.c (__res_state): Return __resp.
5796         * descr.h: Include resolv.h.
5797         (struct pthread): Add res field.
5798         * pthread_create.c: Include resolv.h.
5799         (start_thread): Initialize __resp.
5800         * Makefile (tests): Add tst-_res1.
5801         (module-names): Add tst-_res1mod1, tst-_res1mod2.
5802         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
5803         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
5804         libpthread.
5805         * tst-_res1.c: New file.
5806         * tst-_res1mod1.c: New file.
5807         * tst-_res1mod2.c: New file.
5809 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
5811         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
5813         * Makefile: Define various *-no-z-defs variables for test DSOs
5814         which has undefined symbols.
5816 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
5818         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
5819         Retry if the stwcx fails to store once_control.
5821 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
5823         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
5824         pthread_attr_setaffinity.
5825         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
5826         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
5827         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
5828         * pthread_attr_destroy.c: Free cpuset element if allocated.
5829         * pthread_create.c: Pass iattr as additional parameter to
5830         create_thread.
5831         * sysdeps/pthread/createthread.c: If attribute is provided and
5832         a new thread is created with affinity set or scheduling parameters,
5833         start thread with CLONE_STOPPED.
5834         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
5835         pthread_attr_setaffinity.
5836         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5837         cpuset element.
5839 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
5841         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
5843 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
5845         * sysdeps/pthread/configure.in: Require CFI directives also for
5846         ppc and s390.
5848 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
5850         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5851         Add cfi directives.
5853 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5855         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
5856         CLEANUP_JMP_BUF.
5857         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
5858         registers as variables.  Call __pthread_mutex_unlock_usercnt.
5859         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5860         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
5861         not self pointer in __writer.  Compare with TID to determine
5862         deadlocks.
5863         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5864         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
5865         Likewise.
5866         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
5867         Likewise.
5868         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
5869         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5870         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
5871         macros also when compiling librt.
5873 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
5875         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
5876         -fasynchronous-unwind-tables.
5877         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
5878         (PSEUDO): Add cfi directives.
5879         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
5880         Likewise.
5881         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5882         Likewise.
5884 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
5886         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
5887         __pthread_unregister_cancel): Add prototypes and hidden_proto.
5888         * unwind.c (__pthread_unwind_next): Add hidden_def.
5889         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
5890         Likewise.
5891         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
5892         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5893         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
5894         Likewise.
5895         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
5896         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
5897         Likewise.
5898         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
5899         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
5900         __pthread_unregister_cancel and __pthread_unwind_next.
5902 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
5904         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
5905         different symbol for the cancellation syscall wrapper and
5906         non-cancellation syscall wrapper.
5907         (PSEUDO_END): Define.
5909 2003-07-05  Richard Henderson  <rth@redhat.com>
5911         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
5912         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
5913         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
5914         return actual return value from the syscall, not 0.
5916 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
5918         * descr.h (struct pthread): Add pid field.
5919         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
5920         (__reclaim_stacks): Likewise.
5921         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
5922         also check for PID of the signal source.
5923         (__pthread_initialize_minimal_internal): Also initialize pid field
5924         of initial thread's descriptor.
5925         * pthread_cancel.c: Use tgkill instead of tkill if possible.
5926         * sysdeps/unix/sysv/linux/fork.c: Likewise.
5927         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
5928         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5929         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5931 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
5933         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
5934         Fix use of parameter.
5935         (__libc_cleanup_pop): Likewise.
5937 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
5939         * init.c (sigcancel_handler): Change parameters to match handler
5940         for SA_SIGACTION.  Check signal number and code to recognize
5941         invalid invocations.
5943 2003-07-03  Roland McGrath  <roland@redhat.com>
5945         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
5946         Apply sizeof (struct pthread) bias to r13 value.
5948 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
5950         * sysdeps/pthread/configure.in: Require CFI directives.
5952         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
5953         definition.
5954         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
5955         libpthread compilation.
5956         * unwind.c (__pthread_unwind): Add hidden_def.
5957         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
5959 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
5961         * libc-cancellation.c (__libc_cleanup_routine): Define.
5962         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
5963         (__pthread_cleanup_pop): Define.
5965 2003-07-01  Richard Henderson  <rth@redhat.com>
5967         * sysdeps/alpha/elf/pt-initfini.c: New file.
5968         * sysdeps/alpha/pthread_spin_lock.S: New file.
5969         * sysdeps/alpha/pthread_spin_trylock.S: New file.
5970         * sysdeps/alpha/pthreaddef.h: New file.
5971         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
5972         * sysdeps/alpha/tls.h: New file.
5973         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
5974         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
5975         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
5976         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
5977         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
5978         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
5979         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
5980         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
5981         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
5982         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
5984 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
5986         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
5987         cleanup support and unwind info.
5989 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
5991         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5992         Use correct cleanup handler registration.  Add unwind info.
5993         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
5994         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
5995         * tst-once3.c: Add cleanup handler and check it is called.
5996         * tst-once4.c: Likewise.
5997         * tst-oncex3.c: New file.
5998         * tst-oncex4.c: New file.
5999         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6001 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6003         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6005 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6007         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6008         (tf_msgsnd): Likewise.
6010         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6011         premature returns a bit more.
6013 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6015         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6016         definition to the front.
6018         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6019         the cleanup functions to make the names unique.  Fix dwarf opcode
6020         un unwind table.
6021         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6022         functions to make the names unique.  Fix CFA offset for two blocks.
6024 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6026         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6027         missing closing braces.
6028         Patch by Christophe Saout <christophe@saout.de>.
6030 2003-06-24  Roland McGrath  <roland@redhat.com>
6032         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6034 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6036         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6037         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6039         * pthreadP.h: Declare __find_thread_by_id.
6040         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6041         * pthread_clock_gettime.c: Allow using other thread's clock.
6042         * pthread_clock_settime.c: Likewise.
6043         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6044         * Makefile: Add rules to build and run tst-clock2.
6045         * tst-clock2.c: New file.
6047 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6049         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6050         to use exception-based cleanup handler.
6051         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6053         * tst-cond8.c (ch): Announce that we are done.
6055         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6057         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6058         Also test aio_suspend with timeout value.
6060 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6062         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6063         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6064         attribute_hidden.
6066         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6067         (__pthread_mutex_lock_internal): Likewise.
6068         (__pthread_mutex_unlock_internal): Likewise.
6069         (__pthread_mutex_unlock_usercnt): Declare.
6070         * pthread_mutex_destroy.c: Always fail if used in any way.
6071         * pthread_mutex_init.c: Update comment.
6072         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6073         * pthread_mutex_timedlock.c: Adjust __nusers.
6074         * pthread_mutex_trylock.c: Adjust __nusers.
6075         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6076         and public interfaces are wrapper with pass additional parameter.
6077         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6078         parameter zero.
6079         * tst-mutex8.c: New file.
6080         * Makefile (tests): Add tst-mutex8.
6081         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6082         __pthread_mutex_unlock_usercnt.
6083         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6084         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6085         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6086         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6087         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6088         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6089         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6090         Add __nusers.
6091         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6092         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6093         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6094         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6095         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6097         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6098         * pthread_mutex_timedlock.c: Likewise.
6099         * pthread_mutex_trylock.c: Adjust __nusers.
6100         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6101         * tst-mutex9.c: New file.
6102         * Makefile (tests): Add tst-mutex9.
6103         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6104         * sysdeps/ia64/tls.h: Likewise.
6105         * sysdeps/powerpc/tls.h: Likewise.
6106         * sysdeps/s390/tls.h: Likewise.
6107         * sysdeps/sh/tls.h: Likewise.
6108         * sysdeps/x86_64/tls.h: Likewise.
6109         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6110         Change type of __owner.
6111         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6112         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6113         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6114         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6115         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6117 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6119         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6120         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6122         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6123         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6124         instead of nr to lll_futex_wake.  Only set errno and return -1
6125         if err < 0.
6127         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6128         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6129         return actual return value from the syscall, not 0.
6131 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6133         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6134         find a random value.
6135         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6136         errno==EIDRM.
6138         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6139         compat_timer_settime.
6140         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6141         compat_timer_gettime.
6142         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6143         compat_timer_getoverrun.
6144         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6145         compat_timer_delete.
6147         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6148         error-checking mutex detect busy mutexes.
6150 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6152         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6153         Add ax to clobber list.
6154         (lll_mutex_cond_lock): Likewise.
6155         (lll_mutex_unlock): Likewise.
6156         (lll_lock): Likewise.
6157         (lll_unlock): Likewise.
6159         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6160         * tst-cancel18.c: New file.
6161         * tst-cancelx18.c: New file.
6163         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6164         and tcdrain.
6166         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6167         * tst-cancel17.c: New file.
6168         * tst-cancelx17.c: New file.
6170         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6171         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6172         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6174         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6176 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6178         * sysdeps/pthread/createthread.c (create_thread): Set
6179         header.multiple_threads unconditionally.
6180         * allocatestack.c (allocate_stack): Likewise.
6181         * descr.h (struct pthread): Add header.multiple_threads
6182         unconditionally.
6183         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6184         Define for librt.  #error if neither libpthread, libc nor librt.
6185         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6186         Likewise.
6187         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6188         CDISABLE): Likewise.
6189         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6190         CDISABLE): Likewise.
6191         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6192         CDISABLE): Likewise.
6193         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6194         CDISABLE): Likewise.  Access header.multiple_threads outside of
6195         libc and libpthread.
6196         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6197         Likewise.
6198         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6199         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6201 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6203         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6204         Also test early cancellation before the thread reaches the cancellation
6205         point.
6207         * Makefile: Compile forward.c with exceptions.
6209         * sysdeps/unix/sysv/linux/sleep.c: New file.
6211 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6213         * Makefile: Add CFLAGS definition to compile function wrappers
6214         duplicated from libc with exceptions.
6215         * tst-cancel4.c: Also check cancellation handlers.
6217         * Makefile: Add rules to build and run tst-cancel16 and
6218         tst-cancelx16.  Add missing CFLAGS definitions.
6219         * tst-cancel16.c: New file.
6220         * tst-cancelx16.c: New file.
6222 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6224         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6225         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6226         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6227         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6229         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6230         (LIBC_CANCEL_RESET): Likewise.
6231         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6232         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6233         librt-cancellation.
6234         (CFLAGS-libcrt-cancellation.c): Define.
6235         * sysdeps/pthread/librt-cancellation.c: New file.
6236         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6237         macros also when compiling librt.
6238         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6239         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6240         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6241         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6242         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6243         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6244         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6246         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6247         compat_timer_create.
6249 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6251         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6253         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6254         __register_atfork.
6255         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6256         Add libc_hidden_def.
6258 2003-06-13  Roland McGrath  <roland@redhat.com>
6260         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6261         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6263 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6265         * allocatestack.c (queue_stack): Always inline.
6266         * ptreadhP.h (__do_cancel): Likewise.
6268 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6270         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6271         a typo.
6273 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6275         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6276         (__pthread_cond_signal): Remove incorrect second addition for
6277         cond_lock!=0.
6279 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6281         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6282         (__pthread_cond_signal): Use correct futex pointer in
6283         __lll_mutex_lock_wait call.
6285         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6286         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6288 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6290         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6291         cancelable.
6292         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6293         Likewise.
6295         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6296         hand-written CFI generation code.  Since ENTRY/END also initiated
6297         CFI frames this caused two CFI sets to be generated.
6299 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6301         * cleanup_routine.c: New file.
6302         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6303         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6304         cleanup handling.
6305         * Makefile (libpthread-routines): Add cleanup_routine.
6306         Add more CFLAGS variables to compile with exceptions.  Add comments
6307         why which file needs unwind tables.
6308         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6309         tests.
6310         * tst-cancelx1.c: New file.
6311         * tst-cancelx2.c: New file.
6312         * tst-cancelx3.c: New file.
6313         * tst-cancelx4.c: New file.
6314         * tst-cancelx5.c: New file.
6315         * tst-cancelx6.c: New file.
6316         * tst-cancelx7.c: New file.
6317         * tst-cancelx8.c: New file.
6318         * tst-cancelx9.c: New file.
6319         * tst-cancelx10.c: New file.
6320         * tst-cancelx11.c: New file.
6321         * tst-cancelx12.c: New file.
6322         * tst-cancelx13.c: New file.
6323         * tst-cancelx14.c: New file.
6324         * tst-cancelx15.c: New file.
6325         * tst-cleanupx0.c: New file.
6326         * tst-cleanupx0.expect: New file.
6327         * tst-cleanupx1.c: New file.
6328         * tst-cleanupx2.c: New file.
6329         * tst-cleanupx3.c: New file.
6331         * tst-cleanup0.c: Make standard compliant.
6332         * tst-cleanup1.c: Likewise.
6334         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6335         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6336         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6337         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6338         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6339         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6340         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6341         CLEANUP_JMP_BUF.
6342         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6343         * tst-cancel12.c: New file.
6344         * tst-cancel13.c: New file.
6345         * tst-cancel14.c: New file.
6346         * tst-cancel15.c: New file.
6347         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6348         and tst-cancel15.
6350         * tst-cancel1.c: Add some comments.
6352         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6353         timeout correctly.
6355 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6357         * Makefile (CFLAGS-pthread_cancel.c): Define.
6359 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6361         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6362         Change type of __writer element to int.
6363         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6364         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6365         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6366         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6367         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6368         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6369         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6370         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6371         Compare with TID to determine deadlocks.
6372         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6373         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6374         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6375         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6376         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6377         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6378         Likewise.
6379         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6380         Likewise.
6381         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6382         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6383         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6384         Likewise.
6385         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6386         Likewise.
6387         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6388         * Makefile (tests): Add tst-rwlock12.
6389         * tst-rwlock12.c: New file.
6391 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6393         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6394         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6395         Remove bogus hidden_proto.
6396         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6397         Likewise.
6398         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6399         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6400         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6401         ___lll_mutex_timedlock): Likewise.
6403 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6405         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6406         (__pthread_cond_signal): Add some code to eventually handle
6407         cond_lock!=0.
6409 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6411         * Makefile (tests): Add tst-exec4.
6412         (tst-exec4-ARGS): Define.
6413         * tst-exec4.c: New file.
6415 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6417         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6418         Also fail if tv_nsec < 0.
6419         (__lll_timedwait_tid): Likewise.
6420         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6421         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6422         Likewise.
6423         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6424         Likewise.
6425         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6426         Likewise.
6427         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6428         Likewise.
6429         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6430         Likewise.
6431         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6432         Likewise.
6434         * Makefile (tests): Add tst-sem8 and tst-sem9.
6435         * tst-sem8.c: New file.
6436         * tst-sem9.c: New file.
6437         * sem_open.c: Fix creation of in_use record if the file exists but
6438         no internal record.
6440         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6441         definitions.
6443         * sysdeps/pthread/timer_create.c (timer_create): In case
6444         evp==NULL, assign timer ID to sival_ptr.
6446         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6447         struct pthread_unwind_buf *.
6448         (struct pthread): Likewise for cleanup_jmp_buf element.
6450         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6451         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6452         * unwind.c (__pthread_unwind_next): Likewise.
6454 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6456         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6457         (lll_futex_timed_wait): Use int for futex value parameter.
6458         (lll_futex_wake): Likewise.
6459         (lll_futex_requeue): Likewise.
6461         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6462         Replace one memory operation with one register operation.
6464         * tst-join4.c (do_test): Fix error message.
6466         * tst-rwlock6.c (do_test): Use correct format specifier.
6468         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6469         (__lll_mutex_lock_wait): Replace one memory operation with one
6470         register operation.
6471         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6472         (__lll_mutex_lock_wait): Likewise.
6474         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6475         (__lll_mutex_cond_lock): Add one to value parameter of
6476         __lll_lock_wait to reflect reality in the futex syscall.
6477         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6478         (lll_mutex_cond_lock): Likewise.
6480 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6482         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6483         New function.
6484         (lll_mutex_cond_lock): Define.
6486 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6488         * Makefile (tests): Add tst-signal6.
6489         * tst-signal6.c: New file.
6491         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6492         (__lll_mutex_unlock_force): New function
6493         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6495         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6496         (__lll_mutex_unlock_force): New function.
6497         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6499         * tst-rwlock7.c (do_test): Use correct format specifier.
6501         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6502         Find break parameter in correct asm argument.
6504 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6506         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6507         Remove out4.
6508         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6509         error occured.
6510         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6511         Add __mutex.
6512         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6513         lll_futex_requeue, lll_mutex_unlock_force): Define.
6515 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6517         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6518         (pthread_cond_t): Add __mutex.
6519         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6520         lll_futex_requeue, lll_mutex_unlock_force): Define.
6522 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6524         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6525         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6526         Add __mutex field.
6527         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6528         Define.
6529         (lll_futex_wait, lll_futex_wake): Define.
6530         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6531         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6532         FUTEX_REQUEUE instead of FUTEX_WAIT.
6533         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6534         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6535         mutex which was used in condvar structure.  Call
6536         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6537         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6539         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6540         include tcb-offsets.h.  Read wakeup value in locked region.
6541         Use the value of gbr register as THREAD_ID.
6542         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6543         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6544         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6546         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6547         macros.
6549 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6551         * sysdeps/pthread/pthread_cond_broadcast.c
6552         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6554 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6556         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6557         typo in register name.
6558         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6559         correctly.  Actually use requeue.  Little optimization.
6560         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6561         mutex address early.  Handle cancellation state as 32-bit value.
6562         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6563         Remove unnecessary label.
6565 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6567         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6568         instead of FUTEX_WAIT.
6569         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6570         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6571         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6572         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6573         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6574         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6575         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6576         of __pthread_mutex_lock_internal.
6577         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6578         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6579         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6580         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6581         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6582         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6583         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6584         Add pthread_mutex_cond_lock.
6585         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6586         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6587         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6588         lll_mutex_cond_lock.
6589         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6590         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6591         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6592         Add __mutex field.
6593         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6594         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6596         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6597         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6599         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6600         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6601         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6602         macro don't define aliases.
6604         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6605         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6606         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6607         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6608         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6609         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6610         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6611         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6612         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6614 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6616         * sem_open.c: Fix one endless loop.  Implement correct semantics
6617         wrt opening the same semaphore more then once.
6618         * sem_close.c: Adjust for sem_open change.
6619         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6620         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6621         * Makefile (tests): Add tst-sem7.
6622         * tst-sem7.c: New file.
6624 2003-05-16  Roland McGrath  <roland@redhat.com>
6626         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6627         uninitialized variable braino.
6629 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6631         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6632         test for syscall availability.
6634         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6635         __no_posix_timers to -1 if the syscalls don't exist.
6637         * pthread_join.c (pthread_join): Set tid field of the joined
6638         thread to -1.  This isn't necessary but helps to recognize some
6639         error conditions with almost no cost.
6641         * allocatestack.c (FREE_P): Also negative values indicate an
6642         unused stack.
6644         * unwind.c: Include <unistd.h>.
6646 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6648         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6650 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6652         * Makefile (crti-objs, crtn-objs): New variables.
6653         (omit-deps, extra-objs): Add crtn.
6654         ($(objpfx)libpthread.so): Depend on both crti and crtn
6655         and links to them in multidir.
6656         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6658 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6660         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6661         (lll_mutex_unlock): Use atomic_exchange_rel.
6663 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6665         * cond-perf.c (cons): Add missing locking around setting of alldone.
6667 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6669         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6670         related macros.
6671         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6673 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6675         * tst-sem6.c: New file.
6676         * Makefile (tests): Add tst-sem6.
6678         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6679         Use atomic_exchange_rel instead of atomic_exchange.
6680         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6681         Likewise.
6683         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6684         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6685         vsyscall is possible.
6687         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6688         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6689         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6690         pthread_setaffinity_np.
6691         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6692         and pthread_setaffinity_np.
6693         * Makefile (libpthread-routines): Add pthread_getaffinity and
6694         pthread_setaffinity.
6696         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6697         use it in case mmap to allocate the stack fails.
6698         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6699         ARCH_MAP_FLAGS here.
6700         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6701         ARCH_RETRY_MMAP.
6703 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6705         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6706         handler implementation.  It is now lockless in fork().
6707         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6708         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6709         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6710         declare the __fork_*_lists.
6711         (struct fork_handler): Include pointers to all three functions.
6712         Add next, refcntr and need_signal elements.
6713         (__fork_handlers): New declaration.
6714         (__register_atfork_malloc): Remove declaration.
6715         (HAVE_register_atfork_malloc): Remove definition.
6716         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
6717         __pthread_child_handler variable.
6718         (__libc_pthread_init): Use __register_atfork instead of explicitly
6719         adding to the list.
6720         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
6721         and lll_futex_wake.
6722         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6724         * unwind.c (unwind_cleanup): Print error message and then abort.  This
6725         function must never be reached.
6727         * cond-perf.c: New file.
6729 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
6731         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
6733 2003-05-04  Roland McGrath  <roland@redhat.com>
6735         * Makefile ($(objpfx)../libc.so): New target.
6737 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
6739         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6740         (pthread_condattr_t): Size is only an int, don't use long for
6741         alignment.
6742         (pthread_mutexattr_t): Likewise.
6743         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6744         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6745         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6747 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
6749         * sysdeps/i386/tls.h: Define THREAD_ID.
6750         * sysdeps/ia64/tls.h: Likewise.
6751         * sysdeps/powerpc/tls.h: Likewise.
6752         * sysdeps/s390/tls.h: Likewise.
6753         * sysdeps/sh/tls.h: Likewise.
6754         * sysdeps/x86_64/tls.h: Likewise.
6755         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
6756         record ownership.
6757         * pthread_mutex_timedlock.c: Likewise.
6758         * pthread_mutex_trylock.c: Likewise.
6759         * pthread_mutex_unlock.c: Likewise.
6760         * pthread_rwlock_trywrlock.c: Likewise.
6761         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
6762         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6763         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6764         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6766         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
6767         flag.
6769 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
6771         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6772         (__SIZEOF_PTHREAD_COND_T): Define to 48.
6773         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
6774         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6775         Make __align long long instead of long.
6776         (pthread_rwlock_t): Formatting.
6777         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
6778         (pthread_rwlock_t): Formatting.
6779         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6780         (pthread_cond_t): Make __align long long instead of long.
6781         (pthread_rwlock_t): Move __flags field to the same position as in
6782         linuxthreads.
6784 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
6786         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
6787         * tst-rwlock7.c (do_test): Likewise.
6789 2003-04-26  Roland McGrath  <roland@redhat.com>
6791         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
6793 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
6795         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
6796         sizeof (struct pthread).
6797         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
6798         1 struct pthread.
6799         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
6800         to 0.
6801         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
6802         struct pthread.
6803         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
6804         to 32-bit bytes.
6805         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
6806         tcbp.
6807         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
6808         unneccessarily.
6809         (NO_TLS_OFFSET): Define.
6810         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
6811         add TLS_TCB_SIZE unnecessarily.
6813 2003-04-22  Roland McGrath  <roland@redhat.com>
6815         * Makeconfig (shared-thread-library): Reverse link order to work
6816         around linker bug.
6818 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
6820         * semaphore.h: Fix typo in comment.
6822 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
6824         * sysdeps/pthread/sigfillset.c: New file.
6826         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
6827         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
6828         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
6829         * sysdeps/pthread/sigaction.c: Likewise.
6830         * sysdeps/pthread/sigprocmask.c: New file.
6831         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
6832         __SIGRTMIN+1.
6833         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
6834         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
6835         in this case.
6837 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
6839         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6840         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
6842         * sysdeps/unix/sysv/linux/unregister-atfork.c
6843         (__unregister_atfork): Don't free memory not allocated dynamically.
6845         * semaphore.h: Remove __THROW marker from cancellation points.
6846         * nptl/sysdeps/pthread/pthread.h: Likewise.
6848 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
6850         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
6851         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
6852         __THROW.
6854 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
6856         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
6858 2003-04-15  Roland McGrath  <roland@redhat.com>
6860         * forward.c (__pthread_unwind): Tweak to avoid warning.
6862 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
6864         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
6866 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
6868         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
6869         overflow CFA advance instructions.
6870         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6872 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
6874         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
6875         * sysdeps/i386/pthread_spin_lock.c: Likewise.
6876         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
6877         defined.
6879         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
6880         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
6881         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
6882         DW_CFA_advance_loc for .Laddl-.Lsubl.
6884 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
6886         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
6887         position-independent unwind data for static libraries.
6888         Add missing unwind info.  Add comments.
6890         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
6891         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6892         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6893         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6895 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
6897         * Makefile: Make sure all cancellation points are compiled with
6898         exception and asynchronous unwind tables.
6900         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
6901         which mishandles loading of global object addresses in PIC.
6902         (THREAD_SETMEM_NC): Likewise.
6904 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
6906         * pthread.h: Define new data structure for cleanup buffer.  Declare
6907         new cleanup handler interfaces.
6908         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
6909         (struct pthread): Add cleanup_jmp_buf pointer.  Define
6910         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
6911         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
6912         it.  Declare old cleanup handler installation functions.
6913         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
6914         handling.
6915         * cleanup_defer.c: Likewise.
6916         * cleanup_compat.c: New file.  Old cleanup code.
6917         * cleanup_def_compat.c: New file.  Old cleanup code.
6918         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
6919         if own thread descriptor.
6920         * unwind.c: New file.
6921         * forward.c: Add __pthread_unwind.
6922         * init.c (pthread_functions): Add __pthread_unwind.
6923         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
6924         Add ptr___pthread_unwind.
6925         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
6926         and unwind function.
6927         * Makefile (libpthread-routines): Add cleanup_compat,
6928         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
6929         table generation if necessary.
6930         * version.c: Record whether unwind support is compiled in.
6931         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
6932         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
6933         handler interfaces.
6934         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
6935         complication to generate unwind information for syscall wrappers.
6936         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6937         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
6938         __cleanup_fct_attribute.
6940         * Makefile: Add rules to build and run tst-cleanup0.
6941         * tst-cleanup0.c: New file.
6942         * tst-cleanup0.expect: New file.
6944         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
6945         caller.  Optimize to avoid often unecessary local variable.
6947 2003-04-11  Roland McGrath  <roland@redhat.com>
6949         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
6950         sets variable `multidir'; include that.
6951         (generated): Add it.
6952         ($(objpfx)$(multidir)/crti.o): New target.
6953         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
6955 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
6957         * tst-attr2.c (do_test): Add cast to avoid warning.
6958         * tst-mutex4.c (do_test): Likewise.
6960 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
6962         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
6963         in child.
6965 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
6967         * Makefile (tests): Add tst-detach1.
6968         * tst-detach1.c: New file.
6970 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
6972         * sysdeps/pthread/pthread.h: Remove duplicate
6973         pthread_cleanup_{push,pop} definitions.
6975         * tst-barrier2.c: Eliminate warnings.
6976         * tst-cancel4.c: Likewise.
6977         * tst-cond4.c: Likewise.
6978         * tst-cond6.c: Likewise.
6979         * tst-detach1.c: Likewise.
6980         * tst-rwlock4.c: Likewise.
6981         * tst-rwlock6.c: Likewise.
6982         * tst-rwlock7.c: Likewise.
6983         * tst-sem3.c: Likewise.
6984         * tst-spin2.c: Likewise.
6985         * tst-umask1.c: Likewise.
6987 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
6989         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
6991 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
6993         * descr.h (struct pthread): Move cancelhandling member to the front.
6995 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
6997         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
6998         malloc_parent, and malloc_child statically.
6999         (__register_atfork_malloc): New function.
7000         (free_mem): Don't free any of the malloc_* variables on the list.
7001         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7002         Define HAVE_register_atfork_malloc.
7004 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7006         * sysdeps/pthread/createthread.c (create_thread): Add some more
7007         comments explaining when to set multiple_threads and when not.
7009         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7010         THREAD_ATOMIC_BIT_SET if not already defined.
7011         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7012         THREAD_ATOMIC_BIT_SET:
7013         * sysdeps/x86_64/tls.h: Likewise.
7014         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7015         THREAD_ATOMIC_CMPXCHG_VAL.
7016         (_pthread_cleanup_pop_restore): Likewise.
7017         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7018         (__pthread_enable_asynccancel_2): Likewise.
7019         (__pthread_disable_asynccancel): Likewise.
7020         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7021         (__libc_disable_asynccancel): Likewise.
7022         * init.c (sigcancel_handler): Likewise.
7023         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7024         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7026 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7028         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7029         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7030         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7031         * Makefile (tests): Add tst-cancel11.
7032         * tst-cancel11.c: New file.
7034 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7036         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7037         round, not the first.  Use specific_used flag instead of local
7038         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7039         (__free_tcb): Don't call deallocate_tsd here.
7040         (start_thread): Call deallocate_tsd here.
7041         * pthread_setspecific.c: Set specific_used flag really only when
7042         needed.
7043         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7044         * tst-tsd3.c: New file.
7045         * tst-tsd4.c: New file.
7047 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7049         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7050         Use atomic_exchange_and_add instead of __lll_add.
7051         (__lll_mutex_timedlock): Likewise.
7052         Patch by Ian Wienand.
7054 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7056         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7057         (SINGLE_THREAD_P): Fix typo.
7058         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7060 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7062         * Makefile (tests): Add tst-align.
7063         * tst-align.c: New file.
7064         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7066         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7067         function correctly.
7069         * tst-tsd2.c: Add casts to avoid warnings.
7071 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7073         * descr.h (struct pthread): Move most often used elements to the front.
7075 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7077         * Makefile (libpthread-routines): Add pthread_atfork.
7078         (libpthread-static-only-routines): Add pthread_atfork.
7080 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7082         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7083         of TLS_DTV_AT_TP.
7084         (INSTALL_DTV): Add parens.
7085         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7086         Use passed descr instead of THREAD_SELF.
7087         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7088         (__lll_mutex_timedlock_wait): Correct expected value after
7089         spurious wakeup.
7090         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7091         Release lock before waking up the waiters.
7092         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7093         criteria.  Reorderstruct passed to cleanup handler.  Fix
7094         handling of cancellation and failung pthread_mutex_unlock call.
7095         Use __pthread_enable_asynccancel_2 instead of
7096         __pthread_enable_asynccancel.
7097         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7098         Return result of lock re-get if it fails.
7099         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7100         for __pthread_cleanup_push.
7101         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7102         completely broken rwlock implementation.
7103         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7104         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7105         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7106         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7107         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7108         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7109         versioned_symbol macro.
7110         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7111         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7113 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7115         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7116         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7117         and __helper_tid.
7118         (struct timer): Remove th and bar field.
7119         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7120         debugging code.  Create only one helper thread.
7121         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7122         helper thread.
7123         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7124         Renamed.  Define statically.  Use thread info from siginfo.
7125         (__helper_once): New variable.
7126         (__helper_tid): New variable.
7127         (__reset_helper_control): New function.
7128         (__start_helper_thread): New function.
7130         * pthread_create.c (start_thread): Don't use setjmp inside
7131         __builtin_expect to work around gcc bug.
7133         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7134         timer_delete syscall fails, but not with ENOSYS, set
7135         __no_posix_timers.
7137         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7138         (timer_settime): Fix typo.
7139         * sysdeps/unix/sysv/linux/timer_getoverr.c
7140         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7142 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7144         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7145         offset of cleanupbuf.__prev.
7147 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7149         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7150         of included file.
7152 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7154         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7155         NULL provide default definition to syscall.
7157 2003-03-25  Roland McGrath  <roland@redhat.com>
7159         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7160         (timer_id2ptr): Fix typo.
7162 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7164         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7165         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7166         * sysdeps/ia64/pthreaddef.h: Likewise.
7167         * sysdeps/powerpc/pthreaddef.h: Likewise.
7168         * sysdeps/s390/pthreaddef.h: Likewise.
7169         * sysdeps/sh/pthreaddef.h: Likewise.
7170         * sysdeps/x86_64/pthreaddef.h: Likewise.
7171         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7172         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7173         being changed.
7174         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7175         SIGTIMER is not unblocked.
7176         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7177         RT signal taken.
7178         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7179         be send.
7180         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7181         pass pointer through as ID.
7182         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7183         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7184         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7185         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7186         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7187         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7188         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7189         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7190         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7191         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7192         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7193         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7194         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7195         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7196         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7197         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7198         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7199         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7200         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7201         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7202         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7203         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7204         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7205         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7206         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7207         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7208         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7209         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7210         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7211         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7212         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7213         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7214         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7216         * pthreadP.h: Remove FRAME_LEFT definition.
7217         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7218         already left frame.  Programs which have this problem are not POSIX
7219         compliant.
7220         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7222 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7224         * sysdeps/pthread/tst-timer.c: Check return values of the
7225         functions we test.
7227 2003-03-23  Roland McGrath  <roland@redhat.com>
7229         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7230         * tst-tls3mod.c: Likewise.
7231         * tst-tls1.c: Likewise.
7232         * tst-tls2.c: Likewise.
7234         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7235         undefined behavior.
7237         * tst-join5.c (tf1, tf2): Add a cast.
7239         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7241         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7242         Don't test anything.
7243         * tst-cond4.c: Likewise.
7244         * tst-cond6.c: Likewise.
7245         * tst-flock2.c: Likewise.
7246         * tst-mutex4.c: Likewise.
7247         * tst-rwlock4.c: Likewise.
7248         * tst-signal1.c: Likewise.
7249         * tst-spin2.c: Likewise.
7250         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7252         * tst-mutex4.c: Use test-skeleton.c.
7253         * tst-spin2.c: Likewise.
7254         * tst-sysconf.c: Likewise.
7255         * tst-barrier2.c: Likewise.
7256         * tst-cond4.c: Likewise.
7257         * tst-cond6.c: Likewise.
7258         * tst-rwlock4.c: Likewise.
7259         * tst-unload.c: Likewise.
7260         * tst-flock2.c (do_test): Use return instead of exit.
7262 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7264         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7266 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7268         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7269         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7270         instead of __lll_compare_and_swap.
7271         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7272         Likewise.
7273         Removed definition if __lll_compare_and_swap.
7275         * cancellation.c: Adjust for new form of compare&exchange macros.
7276         * cleanup_defer.c: Likewise.
7277         * init.c: Likewise.
7278         * libc-cancellation.c: Likewise.
7279         * old_pthread_cond_broadcast.c: Likewise.
7280         * old_pthread_cond_signal.c: Likewise.
7281         * old_pthread_cond_timedwait.c: Likewise.
7282         * old_pthread_cond_wait.c: Likewise.
7283         * pthread_cancel.c: Likewise.
7284         * pthread_create.c: Likewise.
7285         * pthread_detach.c: Likewise.
7286         * pthread_join.c: Likewise.
7287         * pthread_key_delete.c: Likewise.
7288         * pthread_setcancelstate.c: Likewise.
7289         * pthread_setcanceltype.c: Likewise.
7290         * pthread_timedjoin.c: Likewise.
7291         * pthread_tryjoin.c: Likewise.
7292         * sysdeps/pthread/createthread.c: Likewise.
7294 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7296         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7297         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7298         definitions.  Replace uses with calls to atomic_* functions.
7299         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7300         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7301         __lll_test_and_set calls with atomic_exchange_and_add and
7302         atomic_exchange calls respectively.
7303         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7304         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7305         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7306         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7307         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7308         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7309         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7311         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7312         returns the old value.
7314 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7316         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7317         int for variable OLDVAL and correct inline assembler contraint.
7318         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7319         type int for variable OLD.
7321         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7322         only for s390-32.
7323         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7324         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7325         instead of multiple_threads field in the TCB.
7327 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7329         * sysdeps/i386/i686/bits/atomic.h: Removed.
7330         * sysdeps/i386/i586/bits/atomic.h: Removed.
7331         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7332         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7333         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7334         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7335         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7336         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7337         * atomic.h: Removed.  Moved to glibc.
7339         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7340         support for clock selection.
7342         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7343         signalling waiters.
7345 2003-03-18  Roland McGrath  <roland@redhat.com>
7347         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7348         Add __lll_rel_instr first.  Add memory clobber.
7349         (lll_mutex_unlock): Use __lll_test_and_set.
7350         From Paul Mackerras <paulus@samba.org>.
7352         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7353         unconditionally.
7354         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7355         (SINGLE_THREAD_P):  Add `header.' prefix.
7356         From Paul Mackerras <paulus@samba.org>.
7358         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7359         pthread_timedjoin_np to ...
7360         (libpthread: GLIBC_2.3.3): ... here.
7361         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7363         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7364         Avoid shadowing VAL variable.
7366         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7367         New macro.
7369 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7371         * Makefile (tests): Add tst-cond11.
7372         * tst-cond11.c: New file.
7374         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7375         struct passed to cleanup handler to eliminate one more
7376         instruction.
7377         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7379         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7380         (pthrad_cond_t): Replace __unused field with __clock.
7382         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7383         waken all waiters in cleanup handler.
7384         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7385         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7387         * pthread_condattr_getclock.c: New file.
7388         * pthread_condattr_setclock.c: New file.
7389         * sysdeps/pthread/pthread.h: Declare these new functions.
7390         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7391         * Makefile (libpthread-routines): Add the new functions.
7392         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7393         Renamed field to value.  Document use of the bits.
7394         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7395         change.
7396         * pthread_condattr_setpshared.c: Likewise.
7397         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7398         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7399         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7400         Add __clock field.
7401         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7402         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7403         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7404         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7405         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7406         Implement clock selection.
7407         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7408         * pthread-errnos.sym: Add ENOSYS.
7409         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7410         _POSIX_CLOCK_SELECTION.
7411         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7413         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7414         invalid .size directive.
7416 2003-03-17  Roland McGrath  <roland@redhat.com>
7418         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7419         Formatting tweaks.
7421 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7423         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7424         Use __lll_add instead of spelling it out.  Use protected symbol names.
7425         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7426         Use __lll_add.
7427         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7428         Renamed from lll_compare_and_swap.  Use new name where necessary.
7429         (__lll_add): Defined.
7430         (__lll_dec_if_positive): Defined.
7431         (__lll_test_and_set): Defined.
7432         * sysdeps/ia64/pthread_spin_init.c: Removed.
7433         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7434         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7435         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7436         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7437         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7438         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7439         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7440         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7441         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7442         __sync_lock_release_si.
7443         Patch by Jakub Jelinek.
7445         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7446         Fix timeout handling.
7447         (__lll_timedwait_tid): Likewise.
7448         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7449         Patch by Jakub Jelinek.
7451         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7453 2003-03-17  Roland McGrath  <roland@redhat.com>
7455         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7456         * sysdeps/pthread/pthread_spin_init.c: New file.
7457         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7458         * sysdeps/powerpc/Makefile: New file.
7459         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7460         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7461         * sysdeps/powerpc/pthreaddef.h: New file.
7462         * sysdeps/powerpc/tcb-offsets.sym: New file.
7463         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7464         * sysdeps/powerpc/tls.h: New file.
7465         * sysdeps/powerpc/bits/atomic.h: New file.
7466         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7467         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7468         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7470         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7471         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7472         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7473         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7474         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7475         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7476         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7477         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7478         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7479         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7480         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7481         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7482         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7483         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7484         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7486         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7487         not gettimeofday.
7488         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7489         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7490         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7491         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7492         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7494 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7496         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7497         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7498         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7499         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7500         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7502 2003-03-16  Roland McGrath  <roland@redhat.com>
7504         * tst-fork4.c: Include <string.h>.
7505         * tst-signal2.c: Likewise.
7506         * tst-mutex5.c (do_test): exit -> return.
7507         * tst-mutex2.c: Include <stdlib.h>.
7509 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7511         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7512         (__lll_mutex_timedlock_wait): Correct expected value after
7513         spurious wakeup.  Otherwise we would never wait again.
7515         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7516         zone versus inline asm stupidity.  Use correct instructions.
7518         * tst-rwlock6.c: Add some more status output.
7520 2003-03-15  Roland McGrath  <roland@redhat.com>
7522         * sysdeps/pthread/configure.in: New file.
7523         * sysdeps/pthread/configure: New file (generated).
7525 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7527         * allocatestack.c (allocate_stack): Store the exact stack size of
7528         user allocated stacks.
7530 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7532         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7533         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7534         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7535         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7536         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7537         Use `header.' prefix.
7538         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7540 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7542         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7543         __builtin_frame_address, use stack pointer.
7545         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7546         instead of __builtin_frame_pointer.
7548 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7550         * tst-basic1.c (do_test): Add cast to avoid warning.
7551         * tst-basic2.c (do_test): Likewise.
7553         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7554         amount of stack correction.
7556         * tst-fork4.c: Use test-skeleton.c.
7558 2003-03-14  Roland McGrath  <roland@redhat.com>
7560         * init.c: Fix typo "#eli" for "#else".
7562 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7564         * allocatestack.c (__stack_user): Use hidden_data_def.
7565         * pthread_create.c (__pthread_keys): Likewise.
7567         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7569 2003-03-14  Roland McGrath  <roland@redhat.com>
7571         * tst-fork4.c: New file.
7572         * Makefile (tests): Add it.
7574         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7575         we always define the padding space.
7576         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7577         stopped supporting its own extensions fully.
7578         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7579         struct also called `header', so `header.multiple_threads' is the field
7580         name to use on all machines.
7581         * allocatestack.c (allocate_stack): Use `header.' prefix.
7582         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7583         * pthread_create.c (__pthread_create_2_1): Likewise.
7584         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7585         (THREAD_SELF): Likewise.
7586         * sysdeps/x86_64/tls.h: Likewise.
7587         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7588         (SINGLE_THREAD_P): Likewise.
7589         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7590         (SINGLE_THREAD_P): Likewise.
7591         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7592         (SINGLE_THREAD_P): Likewise.
7594         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7595         value directly.
7597 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7599         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7600         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7602         * pthread_create.c (start_thread): setjmp is expected to return 0.
7604         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7605         (THREAD_GETMEM_NC): Likewise.
7607 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7609         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7610         and the size of the stack which must be allocated is a multiple,
7611         allocate one more page.
7612         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7613         MULTI_PAGE_ALIASING.
7615 2003-03-13  Roland McGrath  <roland@redhat.com>
7617         * pthread_create.c (start_thread): Set EXITING_BIT after the
7618         event-reporting (and destructors), not before.
7620 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7622         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7623         lll_futex_wake): Declare register variables as long int instead of
7624         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7625         Make syscall arguments clobbered by the syscall.
7626         (lll_futex_wait): Define using lll_futex_timed_wait.
7628         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7629         to void *.
7631         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7632         PPID if [! NDEBUG].
7634         * allocatestack.c (nptl_ncreated): Only declare if
7635         COLORING_INCREMENT != 0.
7637         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7638         (__libc_enable_asynccancel_2): Remove prototype.
7640         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7641         ctid to match kernel.
7643 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7645         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7646         libc_multiple_threads.
7647         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7648         __libc_multiple_threads to...
7649         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7651         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7652         versioning.
7653         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7654         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7656         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7657         (__pthread_once_internal): Define.
7659         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7660         macros instead of .symver directly.
7661         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7662         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7664         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7665         * sysdeps/x86_64/tcb-offsets.sym: New file.
7666         * sysdeps/x86_64/Makefile: New file.
7668         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7669         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7670         to access own pthread_t in TCB.
7671         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7672         Likewise.
7673         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7674         Likewise.
7675         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7677 2003-03-12  Roland McGrath  <roland@redhat.com>
7679         * pthread-errnos.sym: New file.
7680         * Makefile (gen-as-const-headers): New variable, list that file.
7681         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7682         header <pthread-errnos.h> instead of defining errno values here.
7683         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7684         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7685         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7686         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7687         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7688         Likewise.
7689         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7690         Likewise.
7691         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7692         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7693         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7694         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7695         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7696         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7697         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7698         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7699         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7700         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7701         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7702         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7703         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7704         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7705         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7706         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7707         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7708         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7709         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7710         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7711         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7712         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7713         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
7714         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
7715         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
7716         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7717         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7719         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
7720         CLONE_CHILD_SETTID worked.
7722 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7724         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
7725         file.
7726         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
7727         file.
7729         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7730         (pthread_cond_t): Add padding.
7732         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
7733         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
7734         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
7736         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
7737         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
7738         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
7739         (__pthread_rwlock_timedrdlock): Likewise.
7740         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
7741         (__pthread_rwlock_wrlock): Likewise.
7742         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
7743         (__pthread_rwlock_rdlock): Likewise.
7745         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
7747         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
7748         result of lock re-get if it fails.
7750 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7752         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
7753         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7754         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7755         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7756         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7757         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7758         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7759         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7760         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7761         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7763         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
7764         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
7766         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
7767         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
7768         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
7769         (create_thread): Likewise.
7770         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
7771         * init.c (__pthread_initialize_minimal_internal): Initialize
7772         __libc_multiple_threads_ptr if necessary.
7773         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
7774         __pthread_multiple_threads and __libc_multiple_threads_ptr.
7775         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
7776         __libc_multiple_threads.
7777         (__libc_pthread_init): Return pointer to __libc_pthread_init if
7778         necessary.
7780         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
7781         (THREAD_SETMEM_NC): Likewise.
7783         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
7784         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
7785         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
7786         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
7788         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
7789         Eliminate one entire instruction.
7791         * cancellation.c (__pthread_enable_asynccancel_2): New function.
7792         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
7793         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7794         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
7795         instead of __pthread_enable_asynccancel.
7796         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7797         (__pthread_cond_wait): Likewise.
7798         * sysdeps/pthread/pthread_cond_timedwait.c
7799         (__pthread_cond_timedwait): Likewise.
7800         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
7802         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7803         (__condvar_cleanup): Wake up all waiters in case we got signaled
7804         after being woken up but before disabling asynchronous
7805         cancellation.
7806         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
7807         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
7808         (__condvar_cleanup): Likewise.
7810         * init.c (__NR_set_tid_address): If already defined, don't redefine.
7811         Make it an error if architecture has no #if case.  Add x86-64.
7813         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
7814         pt-initfini.s generation.
7816         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
7817         (TLS_INIT_TP): Fix typo.
7819 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7821         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
7822         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
7824         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
7825         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7826         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
7827         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
7828         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
7829         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7830         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7831         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7833 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7835         * sysdeps/pthread/pthread_cond_timedwait.c
7836         (__pthread_cond_timedwait): Return the result of the final
7837         locking.  If it succeeds, the regular function return value.
7839         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
7840         Return result of the final locking.
7841         * version.c (__nptl_main): Work around problems with the strange
7842         INTERNAL_SYSCALL macro on ppc32.
7843         * init.c (__pthread_initialize_minimal_internal): Unblock
7844         SIGCANCEL in case the parent blocked it.
7845         Reported by Paul Mackerras <paulus@samba.org>.
7847         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
7848         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
7849         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
7851 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7853         * sysdeps/pthread/pthread_cond_timedwait.c
7854         (__pthread_cond_timedwait): Unlock and fail if
7855         __pthread_mutex_unlock_internal failed.
7857         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
7858         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
7859         Use ARCH_CLONE.
7860         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
7861         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
7862         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
7863         ALLOCATE_STACK): New macros.
7864         (TLS_TPADJ): New macro.
7865         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
7866         (allocate_stack): Handle TLS_DTV_AT_TP and
7867         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
7868         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
7869         Don't set PD->self.
7870         * init.c [__ia64__] (__NR_set_tid_address): Define.
7872         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
7873         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
7874         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
7875         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
7876         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
7877         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
7878         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
7879         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
7880         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
7881         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
7882         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
7883         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
7884         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
7885         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
7886         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
7887         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
7888         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
7889         * sysdeps/ia64/bits/atomic.h: New file.
7890         * sysdeps/ia64/Makefile: New file.
7891         * sysdeps/ia64/pthread_spin_init.c: New file.
7892         * sysdeps/ia64/pthread_spin_lock.c: New file.
7893         * sysdeps/ia64/pthread_spin_trylock.c: New file.
7894         * sysdeps/ia64/pthread_spin_unlock.c: New file.
7895         * sysdeps/ia64/pthreaddef.h: New file.
7896         * sysdeps/ia64/tcb-offsets.sym: New file.
7897         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
7898         * sysdeps/ia64/tls.h: New file.
7900         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
7901         to syscall instead of no arguments.
7903 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
7905         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
7906         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
7907         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
7908         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
7910         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
7911         unused code.
7913         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
7915         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
7916         lowlevelbarrier.sym.
7917         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
7918         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
7919         Include lowlevelbarrier.h and don't define offsets locally.
7920         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
7922         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
7923         (__lll_mutex_lock_wait): Reverse order of first two parameters.
7924         (__lll_mutex_timedlock_wait): Likewise.
7925         (lll_mutex_lock): Adjust asm for that.
7926         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
7927         (lll_lock): Adjust asm for operand order change.
7928         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
7929         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
7931         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
7932         Reverse order of parameters.
7933         (__lll_timedwait_tid): Remove regparms attribute.
7934         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
7935         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
7937         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7938         (__lll_timedwait_tid): Remove one unnecessary instruction.
7940         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
7941         __lll_mutex_timedlock_wait only for NOT_IN_libc.
7942         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
7943         lowlevelmutex.S.
7945         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
7946         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
7947         for NOT_IN_libc.
7948         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
7949         lowlevellock.S.
7951         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
7952         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
7953         for libc.so.
7954         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
7955         define LOCK here (if UP is not defined).  The actual code is in
7956         lowlevelmutex.S.
7958         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
7959         LOCK is already defined.  Don't define lll_unlock_wake_cb and
7960         __lll_timedwait_tid for libc.so.
7961         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
7962         define LOCK here (if UP is not defined).  The actual code is in
7963         lowlevellock.S.
7965         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
7966         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
7967         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
7968         instead of lowlevelsem.h.
7969         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7970         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7971         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7973         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
7974         lowlevelrwlock.sym.
7975         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
7976         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
7977         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
7979         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
7980         register loading.
7981         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
7982         last changed.  D'oh.
7984         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
7986         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
7987         of __libc_locking_needed.
7988         (lll_trylock): Initialize %eax to zero.
7990         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
7991         pthread_cond_t definition.
7993 2003-03-10  Roland McGrath  <roland@redhat.com>
7995         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
7996         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
7997         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
7998         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
7999         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8001         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8002         Instead of setting PD->multiple_threads, set globals
8003         __pthread_multiple_threads and __libc_multiple_threads.
8004         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8005         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8006         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8008         * descr.h (struct pthread): Conditionalize first member on
8009         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8010         containing an anonymous tcbhead_t.  Move `list' member out.
8011         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8012         * allocatestack.c: Remove use of `header.data.' prefix.
8013         * pthread_create.c: Likewise.
8014         * init.c (__pthread_initialize_minimal_internal): Likewise.
8015         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8016         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8017         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8018         * sysdeps/x86_64/tls.h: Likewise.
8019         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8020         (SINGLE_THREAD_P): Likewise.
8021         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8022         (SINGLE_THREAD_P): Likewise.
8023         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8024         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8026 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8028         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8030         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8031         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8033         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8034         leftovers from the ia32 code.
8036         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8037         memory load.
8038         (clear_once_control): Don't load %esi.
8040         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8041         handling.
8043         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8045         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8046         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8048         * Makefile (tests): Add tst-cond10.
8049         * tst-cond10.c: New file.
8051 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8053         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8054         * tst-signal3.c (do_test): Likewise.
8055         * tst-sem5.c (do_test): Likewise.
8056         * tst-kill6.c (do_test): Likewise.
8057         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8059         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8060         of inc/dec.
8061         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8062         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8063         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8064         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8065         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8066         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8067         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8068         Likewise.
8069         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8070         Likewise.
8071         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8072         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8074         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8075         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8076         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8077         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8078         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8080         * allocatestack.c (allocate_stack): If mprotect() fails free the
8081         TLS memory.
8083 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8085         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8087         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8088         lll_wake_tid.  This was used only to work around kernel limits in
8089         the early days.
8090         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8091         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8092         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8093         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8095         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8096         (__pthread_initialize_minimal_internal): Change initialization of
8097         __static_tls_align_m1 appropriately.
8098         * pthreadP.h (__static_tls_align_m1): Renamed from
8099         __static_tls_align.
8100         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8101         instead of __static_tls_align-1.
8103 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8105         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8107         * pthread_create.c: Define __pthread_keys using nocommon
8108         attribute, not by placing it explicitly in bss.
8109         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8111         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8112         Use it in mmap call to allocate stacks.
8114         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8116         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8117         result of the thread function.
8119 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8121         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8122         version is just fine.
8124         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8125         (__pthread_child_handler): Renamed from pthread_child_handler,
8126         exported, and marked hidden.  Change all users.
8127         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8128         free __pthread_child_handler from child list.
8130 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8132         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8134         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8135         Fix handling of cancellation and failing pthread_mutex_unlock call.
8136         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8137         (__pthread_cond_wait): Likewise.
8139         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8140         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8141         lll_futex_timed_wait call.
8142         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8143         (pthread_rwlock_timedwrlock): Likewise.
8145         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8146         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8147         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8149         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8150         check of lll_futex_wake return value.
8152 2003-03-03  Roland McGrath  <roland@redhat.com>
8154         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8156         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8157         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8158         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8160 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8162         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8163         error for CPU clocks.
8165         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8166         _POSIX_MONOTONIC_CLOCK.
8167         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8169         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8170         recent kernels.
8172 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8174         * descr.h (struct pthread): Move cleanup field to the front.
8176 2003-03-01  Roland McGrath  <roland@redhat.com>
8178         * sem_open.c (sem_open): Braino fix.
8180 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8182         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8183         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8184         __pthread_cleanup_pop functionality.
8185         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8187         * descr.h (struct pthread): Move tid field to the front now that
8188         it is often used.
8190         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8191         (__lll_mutex_timedlock_wait): Remove.
8192         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8193         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8194         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8195         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8196         (lll_unlock_wake_cb): Don't save and restore %esi.
8197         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8198         %esi.
8199         (__lll_timedwait_tid): Add alignment.
8200         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8201         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8202         %esi.
8203         (__lll_timedwait_tid): Removed.
8204         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8205         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8206         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8207         (pthread_barrier_wait): Don't save, load, and restore %esi for
8208         last thread.
8209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8210         (__pthread_cond_signal): Don't save, load, and restore %esi.
8211         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8212         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8213         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8214         Don't save, load, and restore %esi.
8216 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8218         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8219         Release lock before waking up the waiters.
8221         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8223         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8224         (reader_thread): Likewise.
8226         * sysdeps/pthread/pthread_rwlock_unlock.c
8227         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8228         to wake up readers if there are none.
8230         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8231         Release internal lock before wake threads.
8233 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8235         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8236         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8237         predefined.
8238         * tst-rwlock9.c: Likewise.
8239         * tst-rwlock10.c: New file.
8240         * tst-rwlock11.c: New file.
8242         * Makefile (tests): Add tst-dlsym1.
8243         * tst-dlsym1.c: New file.
8245         * init.c (__pthread_initialize_minimal_internal): Set
8246         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8247         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8249 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8251         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8253         * tst-cond2.c: Fix sychronization with child.
8255         * tst-rwlock8.c (reader_thread): Remove unused variable.
8257         * Makefile: Add rules to build and run tst-tls3.
8258         * tst-tls3.c: New file.
8259         * tst-tls3mod.c: New file.
8261         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8262         * tst-rwlock8.c: New file.
8263         * tst-rwlock9.c: New file.
8264         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8265         complete broken rwlock implementation.
8266         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8267         Likewise.
8268         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8269         Likewise.
8270         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8271         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8272         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8273         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8274         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8275         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8276         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8278 2003-02-23  Roland McGrath  <roland@redhat.com>
8280         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8282 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8284         * Makefile (tests): Add tst-context1.
8285         * tst-context1.c: New file.
8287         * Makefile (tests): Add tst-tls1 and tst-tls2.
8288         * tst-tls1.c: New file.
8289         * tst-tls2.c: New file.
8291         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8292         for failed cmpxchg.
8294         * pthread_create.c (start_thread): Set EXITING_BIT early.
8296         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8297         (THREAD_GETMEM_NC): Likewise.
8299 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8301         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8302         off 3 more bytes by using offset-less instructions when possible.
8304         * Makefile: Add dependency for $(objpfx)version.d.
8306         * eintr.c (eintr_source): Add unnecessary return but the compiler
8307         insists.
8309         * tst-kill3.c: Include <unistd.h>.
8311 2003-02-21  Roland McGrath  <roland@redhat.com>
8313         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8315 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8317         * Makefile (tests): Add tst-eintr1.
8318         (distribute): Add eintr.c.
8319         * tst-eintr1.c: New file.
8320         * eintr.c: New file.
8322         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8324         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8325         Disallow sending SIGCANCEL.
8327         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8328         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8329         * tst-kill1.c: New file.
8330         * tst-kill2.c: New file.
8331         * tst-kill3.c: New file.
8332         * tst-kill5.c: New file.
8333         * tst-kill6.c: New file.
8334         * tst-basic7.c: Renamed to...
8335         * tst-kill4.c: ...this.
8337 2003-02-21  Roland McGrath  <roland@redhat.com>
8339         * Makefile (install-lib-ldscripts): New variable.
8341 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8343         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8344         * pthread_cancel.c: Use INVALID_TD_P.
8345         * pthread_detach.c: Likewise.
8346         * pthread_getschedparam.c: Likewise.
8347         * pthread_setschedparam.c: Likewise.
8348         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8349         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8350         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8351         * pthread_timedjoin.c: Likewise.
8353         * tst-basic7.c: Include <signal.h>.
8355         * pthread_join.c (pthread_join): Limited checking for invalid
8356         descriptors.
8357         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8359 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8361         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8362         beginning of the loop.  Clear the entire first block of TSD.
8363         * Makefile (tests): Add tst-key4.
8364         * tst-key4.c: New file.
8366 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8368         * Makefile (tests): Add tst-basic7.
8369         * tst-basic7.c: New file.
8371         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8372         Add some more __builtin_expect.
8374         * pthreadP.h: Define dummy version of DEBUGGING_P.
8376 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8378         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8379         _POSIX_THREAD_PRIORITY_SCHEDULING.
8380         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8381         _XOPEN_REALTIME_THREADS.
8382         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8384         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8385         kernel returns EINVAL for PID <= 0, work around it.
8387         * Makefile (tests): Add tst-signal5.
8388         * tst-signal5.c: New file.
8390         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8391         and LOGIN_NAME_MAX.
8393         * tst-cancel1.c (tf): Block all signals.
8395         * Makefile (tests): Add tst-basic6.
8396         * tst-basic6.c: New file.
8398         * tst-basic1.c: Add test for process ID.
8400         * Makefile (tests): Add tst-cancel10.
8401         * tst-cancel10.c: New file.
8403         * Makefile (tests): Add tst-signal4.
8404         * tst-signal4.c: New file.
8406         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8407         __sigismember instead of sigismember.  Add __builtin_expect.
8409 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8411         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8412         pthread_setcancelstate, and pthread_rwlock_setpshared.
8414         * tst-cancel7.c (do_test): Make sure the pid file exists before
8415         canceling the thread.
8417         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8418         pthread_rwlock_timedrdlock tests.
8419         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8420         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8421         Check for invalid tv_nsec field.
8422         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8423         Likewise.
8425         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8426         recursive mutex of overflow.
8428         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8430         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8431         going into an endless loop.
8432         * Makefile (tests): Add tst-cancel9.
8433         * tst-cancel9.c: New file.
8435         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8437 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8439         * tst-mutex5.c (do_test): Add more timedlock tests.
8441         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8442         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8444         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8445         use INLINE_SYSCALL.  Error number is returned, not -1.
8447         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8448         and __deallocate_stack with internal_function.
8449         * pthread_create.c: Adjust definitions appropriately.
8450         * allocatestack.c: Likewise.
8452         * pthread_join.c: Add one more __builtin_expect.
8453         * pthread_timedjoin.c: Likewise.
8455         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8456         not data of sequence number does not match.
8457         Add one __builtin_expect.
8459         * Makefile (tests): Add tst-clock1.
8460         * tst-clock1.c: New file.
8462         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8463         negative arguments.
8464         * Makefile (tests): Add tst-basic5.
8465         * tst-basic5.c: New file.
8467 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8469         * Makefile (tests): Add tst-basic4.
8470         * tst-basic4.c: New file.
8472         * pthreadP.h: Add declaraction for __nptl_nthreads.
8473         * pthread_create.c: Define __nptl_nthreads
8474         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8475         after thread is done.  If then zero, call exit(0).
8476         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8477         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8478         * init.c (pthread_functions): Initialize ptr_nthreads.
8479         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8480         (__reclaim_stacks): Decrement __nptl_nthreads.
8481         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8482         Define.
8483         * Makefile (tests): Add tst-basic3.
8484         * tst-basic3.c: New file.
8486         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8487         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8488         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8489         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8490         if asynchronous canceling is enabled.
8491         * pthread_join.c (pthread_join): When recognizing circular joins,
8492         take into account the other thread might be already canceled.
8493         * Makefile (tests): Add tst-join5.
8494         * tst-join5.c: New file.
8496         * Makefile (tests): Add tst-join4.
8497         * tst-join4.c: New file.
8499 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8501         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8503 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8505         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8506         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8507         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8508         warning.
8509         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8510         to avoid warning.
8511         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8512         error if lll_futex_wake failed.
8514 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8516         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8517         handling of cancellation and failung pthread_mutex_unlock call.
8518         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8519         * Makefile (tests): Add tst-cond8 and tst-cond9.
8520         * tst-cond8.c: New file.
8521         * tst-cond9.c: New file.
8523         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8525         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8526         non-standard initializers with __USE_GNU.
8528         * Makefile (tests): Add tst-cleanup3.
8529         * tst-cleanup3.c: New file.
8531 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8533         * Makefile (tests): Add tst-attr1 and tst-attr2.
8534         * tst-attr1.c: New file.
8535         * tst-attr2.c: New file.
8537         * Makefile: Add rules to build and run tst-atfork2 test.
8538         * tst-atfork2.c: New file.
8539         * tst-atfork2mod.c: New file.
8541         * sysdeps/unix/sysv/linux/unregister-atfork.c
8542         (__unregister_atfork): Free the memory allocated for the handlers
8543         after removing them from the lists.
8545         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8546         cleanup function.
8548         * tst-atfork1.c (do_test): Wait for the child we forked.
8549         Report error in child.
8551         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8553         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8555 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8557         * Makefile (tests): Add tst-cancel8.
8558         * tst-cancel8.c: New file.
8560         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8561         clearing of control variable.
8562         * Makefile (tests): Add tst-once3 and tst-once4.
8563         * tst-once3.c: New file.
8564         * tst-once4.c: New file.
8566 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8568         * sysdeps/sh/Makefile: New file.
8569         * sysdeps/sh/bits/atomic.h: New file.
8570         * sysdeps/sh/pthread_spin_init.c: New file.
8571         * sysdeps/sh/pthread_spin_lock.c: New file.
8572         * sysdeps/sh/pthread_spin_trylock.S: New file.
8573         * sysdeps/sh/pthread_spin_unlock.S: New file.
8574         * sysdeps/sh/pthreaddef.h: New file.
8575         * sysdeps/sh/tcb-offsets.sym: New file.
8576         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8577         * sysdeps/sh/tls.h: New file.
8578         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8579         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8580         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8581         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8582         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8583         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8584         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8585         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8586         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8587         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8588         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8589         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8590         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8591         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8592         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8593         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8594         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8595         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8596         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8597         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8598         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8599         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8600         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8601         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8602         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8603         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8604         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8605         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8606         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8607         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8609 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8611         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8612         according to POSIX.
8614         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8616 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8618         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8619         (TLS_GET_FS): New #define.
8620         (TLS_SET_FS): New #define.
8621         Correct value of __NR_set_thread_area.
8623         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8625 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8627         * Makefile (tests): Add tst-popen1.
8628         * tst-popen1.c: New file.
8630         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8631         but inactive generalization.
8632         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8633         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8634         Minor optimization, remove one instruction.
8635         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8637 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8639         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8641 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8643         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8644         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8645         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8646         * sysdeps/pthread/pthread_cond_signal.c: New file.
8647         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8648         * sysdeps/pthread/pthread_cond_wait.c: New file.
8649         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8650         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8651         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8652         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8653         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8654         * sysdeps/s390/Makefile: New file.
8655         * sysdeps/s390/bits/atomic.h: New file.
8656         * sysdeps/s390/pthread_spin_init.c: New file.
8657         * sysdeps/s390/pthread_spin_lock.c: New file.
8658         * sysdeps/s390/pthread_spin_trylock.c: New file.
8659         * sysdeps/s390/pthread_spin_unlock.c: New file.
8660         * sysdeps/s390/pthreaddef.h: New file.
8661         * sysdeps/s390/tcb-offsets.sym: New file.
8662         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8663         * sysdeps/s390/tls.h: New file.
8664         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8665         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8666         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8667         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8668         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8669         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8670         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8671         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8672         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8673         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8674         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8675         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8676         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8677         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8678         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8679         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8680         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8681         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8682         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8683         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8684         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8685         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8686         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8688 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8690         * atomic.h: Add a couple more default implementations.
8691         (atomic_compare_and_exchange_acq): Use
8692         __arch_compare_and_exchange_32_acq in return value definition.  It
8693         always exists.
8694         (atomic_bit_set): Renamed from atomic_set_bit.
8695         Add missing atomic_ prefixes.
8697         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8698         thread library is available, use correct value to mark initialized
8699         once variable.
8701 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8703         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8704         __sysconf to determine pagesize.
8706         * pthread_create.c: Include <atomic.h>.
8707         * allocatestack.c (allocate_stack): Implement coloring of the
8708         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8709         size minus one.  Adjust users.
8710         * sysdeps/i386/i686/Makefile: New file.
8712 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
8714         * allocatestack.c: Improve comment throughout the file.
8716         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8717         (__lll_lock_wait): Add branch prediction.
8718         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8719         (__lll_lock_wait): Likewise.
8720         (lll_unlock_wake_cb): Removed.
8722 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
8724         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
8725         _POSIX_THREAD_PRIORITY_SCHEDULING.
8727 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
8729         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8730         Fix return type of ptr___pthread_getspecific.
8732 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
8734         * Makefile (tests): Add tst-umask1.
8735         (tst-umask1-ARGS): Define.
8736         * tst-umask1.c: New file.
8738 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
8740         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
8741         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
8742         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
8743         pthread_rwlock_unlock.
8744         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
8745         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
8746         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
8747         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
8748         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8749         New file.
8750         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
8751         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8752         New file.
8753         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
8754         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
8755         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
8756         New file.
8757         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
8758         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
8759         New file.
8760         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
8761         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
8762         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
8763         New file.
8764         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
8765         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
8766         New file.
8767         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
8769         * Makefile (libpthread-routines): Remove lowlevelcond and
8770         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
8771         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
8772         and pthread_cond_broadcast.
8773         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
8774         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
8775         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
8776         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
8777         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
8778         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
8779         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
8780         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
8781         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
8782         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
8783         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
8784         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
8785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
8786         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
8787         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
8788         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
8789         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
8790         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
8791         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
8792         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
8793         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
8794         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
8795         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
8796         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
8797         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
8798         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
8799         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
8800         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
8801         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
8802         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
8803         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
8805         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
8806         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
8807         of the code is moved to ...
8808         * sysdeps/pthread/createthread.c: ...here.  New file.
8810 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
8812         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
8813         (__new_sem_post): Clear %eax before returning.
8814         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
8816         * Makefile (tests): Add tst-cleanup2.
8817         * tst-cleanup2.c: New file.
8819         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
8820         Interpret first parameter correctly.
8822 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
8824         * Makefile (headers): Add bits/semaphore.h.
8826 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
8828         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
8829         if not SHARED.
8831 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
8833         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
8834         must be used and mapping failed.
8835         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
8837         * Makefile (CFLAGS-pthread_self.os): Define this, not
8838         CFLAGS-pthread_self.c.
8840 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8842         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
8843         lll_unlock_wake_cb.
8845         * Makefile (libpthread-routines): Add version.  Add rules to build
8846         version.os and banner.h.
8847         * version.c: New file.
8849 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
8851         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
8852         the alias unconditional.
8853         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
8855 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8857         * Makefile (CFLAGS-pthread_self.c): New definition.
8859 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8861         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
8862         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
8863         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
8864         * init.c (__pthread_initialize_minimal_internal): Likewise.
8866 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
8868         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
8870         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
8871         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8872         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8873         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
8874         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8875         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8877 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8879         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
8880         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
8881         * tst-cancel-wrappers.sh: Remove all exceptions.
8883 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
8885         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
8886         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
8888         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
8889         Use __libc_pthread_functions array if SHARED.
8891         * pthreadP.h: Move pthread_cond_2_0_t definition to...
8892         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
8894         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
8895         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
8896         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
8897         __libc_ptf_call instead of __libc_maybe_call.
8898         (PTF): New #define.
8899         (__libc_cleanup_region_start): Wrap function name with PTF call.
8900         (__libc_cleanup_region_end): Likewise.
8901         (__libc_cleanup_end): Likewise.
8903         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
8904         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
8905         * pthread_key_create.c: Add __pthread_key_create_internal alias.
8906         * pthreadP.h: Add prototypes.
8908         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
8909         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
8910         __pthread_rwlock_unlock aliases.
8911         * pthreadP.h: Add prototypes for new aliases.
8913         * pthreadP.h (struct pthead_functions): Moved to...
8914         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
8915         * init.c (pthread_functions): Add initializers for new elements.
8917         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
8918         __pthread_cleanup_pop_restore aliases.
8919         * pthreadP.h: Add prototypes.
8921         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
8922         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
8923         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
8924         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
8925         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8926         * pthreadP.h: Adjust prototypes and callers.
8928 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
8930         * Makefile (tests): Add tst-cancel7.
8931         (tst-cancel7-ARGS): New variable.
8932         * tst-cancel7.c: New file.
8934         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
8935         around gcc defficiencies.
8936         * old_pthread_cond_signal.c: Likewise.
8937         * old_pthread_cond_timedwait.c: Likewise.
8938         * old_pthread_cond_wait.c: Likewise.
8940         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
8942 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
8944         * Makefile (tests): Add tst-cond7.
8945         * tst-cond7.c: New file.
8947         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
8948         (condvar_cleanup): Get condvar address from the right place.
8950         * atomic.h: Correct definitions of atomic_full_barrier,
8951         atomic_read_barrier, atomic_write_barrier.
8953         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
8954         race-free.
8955         * old_pthread_cond_signal.c: Likewise.
8956         * old_pthread_cond_timedwait.c: Likewise.
8957         * old_pthread_cond_wait.c: Likewise.
8959 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
8961         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
8963 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
8965         * pthreadP.h (pthread_cond_2_0_t): New type.
8966         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
8967         Use new type for the 2.0 condvar function prototypes.
8968         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
8969         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
8970         parameter.
8971         * old_pthread_cond_destroy.c: Likewise.
8972         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
8973         * old_pthread_cond_signal.c: Likewise.
8974         * old_pthread_cond_timedwait.c: Likewise.
8975         * old_pthread_cond_wait.c: Likewise.
8977         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
8978         (__pthread_cond_wait): Don't save cancellation mode and seq value
8979         in same location.
8981         * herrno.c (__h_errno_location): Don't define as weak.
8983 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
8985         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
8986         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
8987         and pthread_cond_wait.
8988         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
8989         Renamed to...
8990         (__pthread_cond_broadcast_2_0): ... this.
8991         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
8992         Renamed to...
8993         (__pthread_cond_destroy_2_0): ... this.
8994         * old_pthread_cond_init.c (__old_pthread_cond_init):
8995         Renamed to...
8996         (__pthread_cond_init_2_0): ... this.
8997         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
8998         Renamed to...
8999         (__pthread_cond_signal_2_0): ... this.
9000         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9001         Renamed to...
9002         (__pthread_cond_wait_2_0): ... this.
9003         * pthread_cond_destroy.c: Include shlib-compat.h.
9004         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9005         * pthread_cond_init.c: Include shlib-compat.h.
9006         (pthread_cond_init): Change strong_alias into versioned_symbol.
9007         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9008         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9009         fields.
9010         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9011         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9012         __pthread_cond_wait_2_0): New prototypes.
9013         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9014         __old_pthread_cond_init, __old_pthread_cond_signal,
9015         __old_pthread_cond_wait): Removed.
9016         * init.c: Include shlib-compat.h.
9017         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9018         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9019         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9020         ptr___pthread_cond_*_2_0 fields.
9021         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9022         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9024         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9025         LIBC_SIGACTION was not yet defined.
9026         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9027         [!defined LIBC_SIGACTION] (__sigaction): New function and
9028         libc_hidden_weak.
9029         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9030         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9032 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9034         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9036 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9038         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9039         New, larger type definition.
9040         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9041         implementation.
9042         * Versions [libpthread]: Add definitions for new pthread_cond_*
9043         interfaces for version GLIBC_2.3.2.
9044         * pthread_cond_init.c: Update initialization for new type definition.
9045         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9046         pthread_cond_timedwait, pthread_cond_signal, and
9047         pthread_cond_broadcast.  Add old_pthread_cond_init,
9048         old_pthread_cond_destroy, old_pthread_cond_wait,
9049         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9050         old_pthread_cond_broadcast.
9051         * old_pthread_cond_broadcast.c: New file.
9052         * old_pthread_cond_destroy.c: New file.
9053         * old_pthread_cond_init.c: New file.
9054         * old_pthread_cond_signal.c: New file.
9055         * old_pthread_cond_timedwait.c: New file.
9056         * old_pthread_cond_wait.c: New file.
9057         * pthreadP.h: Add prototypes for the compatibility interfaces.
9059         * pthread_cond_destroy.c: Don't include <errno.h>.
9061 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9063         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9064         unnecessary zero offset when addressing MUTEX.
9066 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9068         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9069         __register_atfork.
9070         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9071         for __register_atfork.
9073 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9075         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9076         instead of ASSEMBLER test macro.
9078         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9079         __libc_current_sigrtmax): Add libc_hidden_def.
9081         * sysdeps/pthread/list.h: Remove assert.h include.
9083 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9085         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9086         __pthread_initialize_minimal_internal not
9087         __pthread_initialize_minimal.
9089 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9091         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9092         __pthread_initialize_minimal as hidden.
9094         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9095         constructor.
9097 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9099         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9100         $(common-objpfx)format.lds, include that into the output script.
9101         Fix comment.
9102         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9104 2002-12-28  Andreas Jaeger  <aj@suse.de>
9106         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9107         nsec resolution changes.
9108         (xstat64_conv): Likewise.
9109         (xstat32_conv): Likewise.
9110         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9111         struct kernel_stat.
9112         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9113         structs stat and stat64.
9114         * time/time.h (__timespec_defined): Define for __USE_MISC.
9115         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9117 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9119         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9120         argument.
9121         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9122         (pthread_exit): Use strong_alias to avoid warnings.
9123         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9124         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9125         ptr___pthread_attr_init_2_*.
9126         * init.c (pthread_functions): Adjust.
9128 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9130         * forward.c: Make all functions available by default again.  It
9131         caused too much trouble.
9133         * pt-siglongjmp.c: Removed.
9135 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9137         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9138         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9139         * sysdeps/i386/Makefile: New file.
9140         * sysdeps/i386/tcb-offsets.sym: New file.
9141         * sysdeps/pthread/tcb-offsets.h: New file.
9142         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9143         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9145         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9146         __register_atfork...
9147         (GLIBC_2.3.2): ...here.
9149 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9151         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9152         pthread_attr_setstackaddr with __attribute_deprecated__.
9154 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9156         * pt-system.c (system): Remove cancellation handling.
9157         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9158         cancellation routines.
9160 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9162         * descr.h: Include <dl-sysdep.h>.
9163         (struct pthread): Move header.data.list to the back of the struct.
9164         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9165         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9166         (SYSINFO_OFFSEET): Likewise.
9168 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9170         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9171         Define.
9172         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9173         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9174         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9175         (USE_DL_SYSINFO): Undef.
9177 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9179         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9180         $(common-objpfx)libc.so.
9181         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9182         it is bigger than pipe buffer size even on arches with bigger
9183         page size.
9184         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9186 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9188         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9189         correct errno access for case that USE___THREAD is not defined.
9191 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9193         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9194         Patch by Marijn Ros <marijn@mad.scientist.com>.
9196 2002-12-22  Roland McGrath  <roland@redhat.com>
9198         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9200 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9202         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9204 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9206         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9207         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9208         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9210         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9211         of int $0x80.
9212         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9213         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9214         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9215         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9216         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9217         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9218         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9219         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9221         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9222         sysenter.
9223         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9225         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9227         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9228         in new TCB.
9229         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9230         that sysinfo is properly initialized.
9231         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9232         to 1 only for ld.so.
9234         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9235         RTLD_CORRECT_DYNAMIC_WEAK.
9237 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9239         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9240         Use return 0 as 6th argument to FORWARD4.
9241         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9243 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9245         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9246         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9247         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9248         (INIT_SYSINFO): New #define.
9249         (TLS_TP_INIT): Use INIT_SYSINFO.
9250         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9251         At test to make sure SYSINFO_OFFSET value is correct.
9252         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9254 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9256         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9257         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9258         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9259         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9260         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9261         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9262         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9264 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9266         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9267         macro instead of using int $0x80 directly.
9269         * sysdeps/pthread/bits/stdio-lock.h: New file.
9270         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9271         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9272         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9273         * Makefile (routines): Add libc-lowlevelmutex.
9275         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9276         __i686.get_pc_thunk.dx.
9278 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9280         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9281         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9282         ($(objpfx)tst-cancel-wrappers.out): New rule.
9283         * tst-cancel-wrappers.sh: New test.
9284         * tst-locale1.c: Include signal.h.
9285         (uselocale): Test static linking of __libc_current_sigrt*.
9287 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9289         * Makefile (tests): Add tst-cancel6.
9290         * tst-cancel6.c: New file
9292 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9294         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9295         Define meaningfully for assembler as well.
9296         * pthreadP.h (struct pthread_functions): Remove
9297         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9298         and ptr_pthread_attr_init_2_1 fields.
9299         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9300         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9301         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9302         (FORWARD3): Define using FORWARD4.
9303         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9304         versions.
9305         * pt-system.c: Remove duplicate stdlib.h include.
9307 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9309         * sem_init.c: Define sem_init@GLIBC_2.0.
9310         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9311         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9313         * flockfile.c: Moved to...
9314         * sysdeps/pthread/flockfile.c: ...here.  New file.
9315         * funlockfile.c: Moved to...
9316         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9317         * ftrylockfile.c: Moved to...
9318         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9320 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9322         * libc-cancellation.c: Guard both function with
9323         #if !defined NOT_IN_libc.
9324         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9325         automatically provided pthread wrappers.
9326         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9327         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9328         nor in libpthread.
9329         * pt-open.c: Removed.
9330         * pt-fcntl.c: Removed.
9331         * pt-fsync.c: Removed.
9332         * pt-lseek.c: Removed.
9333         * pt-msgrcv.c: Removed.
9334         * pt-msgsnd.c: Removed.
9335         * pt-msync.c: Removed.
9336         * pt-nanosleep.c: Removed.
9337         * pt-open64.c: Removed.
9338         * pt-pause.c: Removed.
9339         * pt-pread.c: Removed.
9340         * pt-pread64.c: Removed.
9341         * pt-pwrite.c: Removed.
9342         * pt-pwrite64.c: Removed.
9343         * pt-read.c: Removed.
9344         * pt-recv.c: Removed.
9345         * pt-recvfrom.c: Removed.
9346         * pt-recvmsg.c: Removed.
9347         * pt-send.c: Removed.
9348         * pt-sendto.c: Removed.
9349         * pt-sigtimedwait.c: Removed.
9350         * pt-sigwait.c: Removed.
9351         * pt-wait.c: Removed.
9352         * pt-waitpid.c: Removed.
9353         * pt-write.c: Removed.
9354         * pt-accept.c: Removed.
9355         * pt-close.c: Removed.
9356         * pt-connect.c: Removed.
9357         * pt-lseek64.c: Removed.
9358         * pt-sendmsg.c: Removed.
9359         * pt-tcdrain.c: Removed.
9361 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9363         * init.c (__pthread_initialize_minimal_internal): Renamed from
9364         __pthread_initialize_minimal.  Make old name an alias.  This
9365         converts a normal relocation into a relative relocation.
9367         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9369         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9370         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9371         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9372         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9373         pt-sigwaitinfo, pt-waitid, and pt-writev.
9374         * pt-creat.c: Removed.
9375         * pt-poll.c: Removed.
9376         * pt-pselect.c: Removed.
9377         * pt-readv.c: Removed.
9378         * pt-select.c: Removed.
9379         * pt-sigpause.c: Removed.
9380         * pt-sigsuspend.c: Removed.
9381         * pt-sigwaitinfo.c: Removed.
9382         * pt-waitid.c: Removed.
9383         * pt-writev.c: Removed.
9385         * init.c (pthread_functions): New variable.
9386         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9387         (or NULL) to __libc_pthread_init.
9388         * forward.c: Rewrite to use __libc:pthread_functions array to get
9389         function addresses.
9390         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9391         prototype.
9392         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9393         Take new parameter.  Copy content of variable pointed to by it
9394         to __libc_pthread_init.
9396         * pthreadP.h (struct pthread_functions): New type.
9397         (__libc_pthread_init): Declare.
9399         * pthread_attr_destroy.c: Add namespace protected alias.
9400         * pthread_attr_getdetachstate.c: Likewise.
9401         * pthread_attr_getinheritsched.c: Likewise.
9402         * pthread_attr_getschedparam.c: Likewise.
9403         * pthread_attr_getschedpolicy.c: Likewise.
9404         * pthread_attr_getscope.c: Likewise.
9405         * pthread_attr_setdetachstate.c: Likewise.
9406         * pthread_attr_setinheritsched.c: Likewise.
9407         * pthread_attr_setschedparam.c: Likewise.
9408         * pthread_attr_setschedpolicy.c: Likewise.
9409         * pthread_attr_setscope.c: Likewise.
9410         * pthread_cond_broadcast.c: Likewise.
9411         * pthread_cond_destroy.c: Likewise.
9412         * pthread_cond_init.c: Likewise.
9413         * pthread_cond_signal.c: Likewise.
9414         * pthread_cond_wait.c: Likewise.
9415         * pthread_condattr_destroy.c: Likewise.
9416         * pthread_condattr_init.c: Likewise.
9417         * pthread_equal.c: Likewise.
9418         * pthread_exit.c: Likewise.
9419         * pthread_getschedparam.c: Likewise.
9420         * pthread_self.c: Likewise.
9421         * pthread_setcancelstate.c: Likewise.
9422         * pthread_setschedparam.c: Likewise.
9423         * pthread_mutex_destroy.c: Likewise.
9424         * pthread_mutex_init.c: Likewise.
9425         * pthreadP.h: Add prototypes for the aliases.
9427         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9428         multiple_threads member in correct TCB to 1.
9430         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9431         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9432         member of thread decriptor, otherwise return unconditionally 1.
9434 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9436         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9437         regular Linux version.  Remove file.
9438         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9439         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9440         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9441         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9442         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9443         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9444         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9445         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9446         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9447         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9448         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9449         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9450         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9451         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9452         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9453         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9454         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9455         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9456         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9457         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9458         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9459         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9460         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9461         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9462         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9463         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9464         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9465         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9466         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9467         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9469 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9471         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9472         * sysdeps/unix/sysv/linux/open.c: Removed.
9473         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9474         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9475         * sysdeps/unix/sysv/linux/msync.c: Removed.
9476         * sysdeps/unix/sysv/linux/read.c: Removed.
9477         * sysdeps/unix/sysv/linux/close.c: Removed.
9478         * sysdeps/unix/sysv/linux/creat.c: Removed.
9479         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9480         * sysdeps/unix/sysv/linux/pause.c: Removed.
9481         * sysdeps/unix/sysv/linux/select.c: Removed.
9482         * sysdeps/unix/sysv/linux/write.c: Removed.
9484 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9486         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9487         element in TCB to see whether locking is needed.
9489         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9490         MULTIPLE_THREADS_OFFSET value is correct.
9492         * sysdeps/unix/sysv/linux/close.c: New file.
9493         * sysdeps/unix/sysv/linux/connect.S: New file.
9494         * sysdeps/unix/sysv/linux/creat.c: New file.
9495         * sysdeps/unix/sysv/linux/fsync.c: New file.
9496         * sysdeps/unix/sysv/linux/llseek.c: New file.
9497         * sysdeps/unix/sysv/linux/lseek.c: New file.
9498         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9499         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9500         * sysdeps/unix/sysv/linux/msync.c: New file.
9501         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9502         * sysdeps/unix/sysv/linux/open.c: New file.
9503         * sysdeps/unix/sysv/linux/open64.c: New file.
9504         * sysdeps/unix/sysv/linux/pause.c: New file.
9505         * sysdeps/unix/sysv/linux/poll.c: New file.
9506         * sysdeps/unix/sysv/linux/pread.c: New file.
9507         * sysdeps/unix/sysv/linux/pread64.c: New file.
9508         * sysdeps/unix/sysv/linux/pselect.c: New file.
9509         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9510         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9511         * sysdeps/unix/sysv/linux/readv.c: New file.
9512         * sysdeps/unix/sysv/linux/recv.S: New file.
9513         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9514         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9515         * sysdeps/unix/sysv/linux/select.c: New file.
9516         * sysdeps/unix/sysv/linux/send.S: New file.
9517         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9518         * sysdeps/unix/sysv/linux/sendto.S: New file.
9519         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9520         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9521         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9522         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9523         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9524         * sysdeps/unix/sysv/linux/system.c: New file.
9525         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9526         * sysdeps/unix/sysv/linux/wait.c: New file.
9527         * sysdeps/unix/sysv/linux/waitid.c: New file.
9528         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9529         * sysdeps/unix/sysv/linux/writev.c: New file.
9530         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9532         * pt-readv.c: Fix comment.
9534 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9536         * tst-cleanup1.c: Include stdlib.h.
9538         * tst-cancel5.c: New test.
9539         * Makefile (tests): Add tst-cancel5.
9540         (tst-cancel5): Link against libc.so libpthread.so in that order.
9542 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9544         * forward.c (test_loaded): Prevent recursive calls.
9546         * Makefile (routines): Add libc-cancellation.
9547         * libc-cancellation.c: New file.
9548         * descr.h (struct pthread): Add multiple_threads field.
9549         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9550         new thread descriptor to 1.
9551         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9552         Initialize multiple_thread field after successful thread creation.
9553         * cancellation.c (__do_cancel): Move to pthreadP.h.
9554         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9555         (__pthread_disable_asynccancel): Add internal_function attribute.
9556         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9557         * pthread_setcancelstate.c: Likewise.
9558         * pthread_setcanceltype.c: Likewise.
9559         * pthread_exit.c: Likewise.
9560         * pthreadP.h (CANCELLATION_P): Likewise.
9561         (__do_cancel): Define as static inline.
9562         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9563         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9564         declarations.
9565         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9566         fields.  Define MULTIPLE_THREADS_OFFSET.
9567         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9568         declaration.
9569         * sysdeps/unix/sysv/linux/accept.S: New file.
9570         * sysdeps/unix/sysv/linux/read.c: New file.
9571         * sysdeps/unix/sysv/linux/write.c: New file.
9572         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9573         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9574         initialization of __libc_locking_needed.
9575         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9576         __libc_locking_needed, use multiple_threads field in TCB.
9577         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9579 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9581         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9582         version.
9583         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9585         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9586         access to __libc_locking_needed for PIC.
9588 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9590         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9591         declare for libc.so.
9592         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9593         expression.
9594         (__libc_lock_lock): Put into statement expression.
9595         (__libc_lock_unlock): Remove trailing semicolon.
9596         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9598 2002-12-12  Roland McGrath  <roland@redhat.com>
9600         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9601         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9603 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9605         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9606         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9607         Initialize __libc_locking_needed.
9608         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9609         instead of __register_pthread_fork_handler.
9610         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9611         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9612         fork-gen with libc_pthread_init.
9613         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9614         of __register_pthread_fork_handler.
9615         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9616         of __register_pthread_fork_handler.
9617         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9618         __libc_locking_needed to determine whether lock prefix can be avoided.
9619         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9621 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9623         * Makefile (tests): Add tst-cleanup1.
9624         * tst-cleanup1.c: New file.
9625         * cancellation.c (__cleanup_thread): Removed.
9626         (__do_cancel): Remove call to __cleanup_thread.
9627         * pthreadP.h: Remove __cleanup_thread prorotype.
9629         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9630         Remember function and argument even if cancellation handler
9631         function is not available.
9632         (__libc_cleanup_region_end): Execute registered function directly if
9633         pthread functions are not available.
9634         (__libc_cleanup_end): Likewise.
9636         * init.c (__pthread_initialize_minimal): Fix initialization in
9637         static lib by preventing gcc from being too clever.
9639 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9641         * init.c (__pthread_initialize_minimal): Remove unneccesary
9642         sigaddset call.
9644         * Makefile (tests): We can run tst-locale2 now.
9646 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9648         * Versions: Remove duplicated sigwait entry.
9650 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9652         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9653         inside libpthread.
9655         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9657         * pthreadP.h: Declare __pthread_enable_asynccancel and
9658         __pthread_disable_asynccancel.
9659         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9660         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9661         * cancellation.c (__pthread_enable_asynccancel): New function.
9662         (__pthread_disable_asynccancel): New function.
9663         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9664         * pt-close.c: Likewise.
9665         * pt-connect.c: Likewise.
9666         * pt-creat.c: Likewise.
9667         * pt-fcntl.c: Likewise.
9668         * pt-fsync.c: Likewise.
9669         * pt-lseek.c: Likewise.
9670         * pt-lseek64.c: Likewise.
9671         * pt-msgrcv.c: Likewise.
9672         * pt-msgsnd.c: Likewise.
9673         * pt-msync.c: Likewise.
9674         * pt-nanosleep.c: Likewise.
9675         * pt-open.c: Likewise.
9676         * pt-open64.c: Likewise.
9677         * pt-pause.c: Likewise.
9678         * pt-poll.c: Likewise.
9679         * pt-pread.c: Likewise.
9680         * pt-pread64.c: Likewise.
9681         * pt-pselect.c: Likewise.
9682         * pt-pwrite.c: Likewise.
9683         * pt-pwrite64.c: Likewise.
9684         * pt-read.c: Likewise.
9685         * pt-readv.c: Likewise.
9686         * pt-recv.c: Likewise.
9687         * pt-recvfrom.c: Likewise.
9688         * pt-recvmsg.c: Likewise.
9689         * pt-select.c: Likewise.
9690         * pt-send.c: Likewise.
9691         * pt-sendmsg.c: Likewise.
9692         * pt-sendto.c: Likewise.
9693         * pt-sigpause.c: Likewise.
9694         * pt-sigsuspend.c: Likewise.
9695         * pt-sigtimedwait.c: Likewise.
9696         * pt-sigwait.c: Likewise.
9697         * pt-sigwaitinfo.c: Likewise.
9698         * pt-system.c: Likewise.
9699         * pt-tcdrain.c: Likewise.
9700         * pt-wait.c: Likewise.
9701         * pt-waitid.c: Likewise.
9702         * pt-waitpid.c: Likewise.
9703         * pt-write.c: Likewise.
9704         * pt-writev.c: Likewise.
9705         * pthread_join.c: Likewise.
9706         * pthread_timedjoin.c: Likewise.
9708         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9709         (__xpg_sigpause): New function.
9710         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9712 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
9714         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
9716         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
9717         _GI_pthread_cleanup_pop to pthreadP.h.
9719         * ftrylockfile.c: Use _IO_lock_trylock instead of
9720         pthread_mutex_trylock.
9722         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
9723         (CANCEL_RESET): Likewise.
9724         (__pthread_setcanceltype_): Declare.
9725         (__pthread_mutex_lock_internal): Declare.
9726         (__pthread_mutex_unlock_internal): Declare.
9727         (__pthread_once_internal): Declare.
9728         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
9729         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
9731         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
9732         and pthread_mutex_unlock.
9733         * pthread_cond_wait.c: Likewise.
9734         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
9735         * pthread_mutex_unlock.c: Likewise.
9737         * pthread_setcanceltype.c: Add additional alias
9738         __pthread_setcanceltype.
9740         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
9741         * sem_open.c (sem_open): Likewise.
9742         Use __libc_open, __libc_write, and __libc_close instead of
9743         open, write, and close respectively.
9745         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
9746         Rewrite as statement expression since it must return a value.
9748         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
9749         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
9750         __pthread_kill.
9752         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
9753         alias __pthread_once_internal.
9755         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
9757 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
9759         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
9760         * tst-stdio1.c: New file.
9761         * tst-stdio2.c: New file.
9763         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
9765         * Makefile (tests): Comment out tst-locale2 for now.
9766         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
9768         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
9769         -D_IO_MTSAFE_IO.
9770         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
9771         Use _IO_lock_init instead of explicit assignment.
9773         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
9774         Define __libc_lock_* and __libc_lock_recursive macros with
9775         lowlevellock macros, not pthread mutexes.
9777         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
9778         of pthread_mutex_lock.
9779         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
9780         instead of pthread_mutex_unlock.
9782 2002-12-06  Roland McGrath  <roland@redhat.com>
9784         * allocatestack.c (__stack_user): Use uninitialized defn.
9785         * init.c (__pthread_initialize_minimal): Initialize it here.
9787 2002-12-05  Roland McGrath  <roland@redhat.com>
9789         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
9790         string.
9791         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
9793         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
9794         missing & here too.
9796 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
9798         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9799         lowlevellock.
9800         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
9801         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
9802         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
9803         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
9804         for __libc_lock_* macros.
9805         * Makefile (routines): Add libc-lowlevellock.
9807 2002-10-09  Roland McGrath  <roland@redhat.com>
9809         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
9810         Under [__PIC__], call the function via the pointer fetched for
9811         comparison rather than a call by name that uses the PLT.
9812         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
9813         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
9814         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
9815         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
9816         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
9818 2002-12-04  Roland McGrath  <roland@redhat.com>
9820         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
9822         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
9823         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
9825         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
9827 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9829         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
9830         a completely opaque, non-integer type.
9831         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9833 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
9835         * sysdeps/i386/tls.h: Include stdlib.h.
9836         * sysdeps/x86_64/tls.h: Likewise.
9838 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9840         * Makefile (tests): Add tst-locale2.
9841         (tests-static): Likewise.
9842         * tst-locale2.c: New file.
9844         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
9845         volatile and add memory clobbers to lock operations.
9847 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
9849         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
9850         * sysdeps/i386/i486/bits/atomic.h: New file.
9851         * sysdeps/i386/i586/bits/atomic.h: New file.
9852         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
9853         include i486 version.
9854         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
9855         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
9856         Patch by Marijn Ros <marijn@mad.scientist.com>.
9858         * allocatestack.c (get_cached_stack): Don't crash if we first
9859         found a stack with a larger size then needed.
9860         Reported by Hui Huang <hui.huang@sun.com>.
9862         * Makefile (tests): Add tst-sysconf.
9863         * tst-sysconf.c: New file.
9865         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
9866         PTHREAD_THREADS_MAX.
9868 2002-12-02  Roland McGrath  <roland@redhat.com>
9870         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
9871         Declare using hidden_proto instead of attribute_hidden, so there are
9872         non-.hidden static symbols for gdb to find.
9873         (__pthread_keys): Likewise.
9874         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
9875         * allocatestack.c (__stack_user): Likewise.
9876         * pthread_create.c (__pthread_keys): Likewise.
9877         (__nptl_threads_events, __nptl_last_event): Make these static instead
9878         of hidden.
9879         * pthread_key_create.c (__pthread_pthread_keys_max,
9880         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
9882 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
9884         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
9885         statically.
9886         * tst-locale1.c: New file.
9888         * pthread_cond_timedwait.c: Include <stdlib.h>.
9890         * Makefile (tests): Add tst-fork2 and tst-fork3.
9891         * tst-fork2.c: New file.
9892         * tst-fork3.c: New file.
9894 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
9896         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
9898         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
9899         require it to 200112L.
9901         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
9902         instruction only if HAVE_CMOV is defined.
9903         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
9905         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
9907         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
9909         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
9911         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
9913 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
9915         * sysdeps/x86_64/bits/atomic.h: New file.
9917         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
9918         16-bit operations.
9920         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
9921         possible since gettid cannot fail.
9923         * sysdeps/x86_64/pthreaddef.h: New file.
9925         * sysdeps/i386/pthreaddef.h (gettid): Removed.
9927         * sysdeps/x86_64/pthread_spin_init.c: New file.
9928         * sysdeps/x86_64/pthread_spin_lock.c: New file.
9929         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
9930         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
9932         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
9933         Add missing lock prefix.  Minute optimization.
9935         * tst-spin2.c (main): Also check successful trylock call.
9937         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
9938         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
9940         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
9941         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
9943         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
9944         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
9945         value in case of an error.  Add support for INTERNAL_SYSCALL.
9947         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
9948         value in case of an error.
9950         * sysdeps/x86_64/tls.h: New file.
9952 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
9954         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
9955         takes the array member name and the index as parameters.
9956         (THREAD_SETMEM_NC): Likewise.
9957         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
9958         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
9959         interfaces.
9961         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
9962         to decide which code to use.
9963         (THREAD_SETMEM_NC): Likewise.
9965         * allocatestack.c (queue_stack): Don't remove stack from list here.
9966         Do it in the caller.  Correct condition to prematurely terminate
9967         loop to free stacks.
9968         (__deallocate_stack): Remove stack from list here.
9970 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
9972         * Makefile (tests): Add tst-stack1.
9973         * tst-stack1.c: New file.
9975         * allocatestack.c (allocate_stack): Initialize the TCB on a user
9976         provided stack.
9978         * pthread_attr_getstack.c: Return bottom of the thread area.
9980 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
9982         * Makefile (libpthread-routines): Add pt-allocrtsig and
9983         pthread_kill_other_threads.
9984         * pt-allocrtsig.c: New file.
9985         * pthread_kill_other_threads.c: New file.
9986         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
9987         all three functions.
9988         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9989         allocrtsig.
9990         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
9991         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
9992         and __libc_allocate_rtsig_private.
9993         * Versions (libpthread): Export pthread_kill_other_threads_np,
9994         __libc_current_sigrtmin, and __libc_current_sigrtmax.
9996 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
9998         * allocatestack.c (allocate_stack): stackaddr in attribute points to
9999         the end of the stack.  Adjust computations.
10000         When mprotect call fails dequeue stack and free it.
10001         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10002         attribute.
10003         * pthread_getattr_np.c: Likewise.
10005         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10006         surprises.
10008 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10010         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10011         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10013 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10015         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10016         * pthread_setspecific.c: Likewise.
10018 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10020         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10021         definitions.  Get them from the official place.
10022         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10024         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10025         Use new CLONE_ flags in clone() calls.
10027         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10028         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10030         * Versions: Add pthread_* functions for libc.
10031         * forward.c: New file.
10033         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10034         errno-loc.
10035         * herrno.c: New file.
10036         * res.c: New file.
10038         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10039         sem_trywait, and sem_timedwait.  Add herrno and res.
10040         * sem_init.c: Don't initialize lock and waiters members.
10041         * sem_open.c: Likewise.
10042         * sem_post.c: Removed.
10043         * sem_wait.c: Removed.
10044         * sem_trywait.c: Removed.
10045         * sem_timedwait.c: Removed.
10046         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10047         Includes full implementations of sem_post, sem_wait, sem_trywait,
10048         and sem_timedwait.
10049         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10050         for new implementation.
10051         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10052         and waiters fields.
10054         * tst-sem3.c: Improve error message.
10055         * tst-signal3.c: Likewise.
10057         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10058         to tell the kernel about the termination futex and to initialize tid
10059         member.  Don't initialize main_thread.
10060         * descr.h (struct pthread): Remove main_thread member.
10061         * cancelllation.c (__do_cancel): Remove code handling main thread.
10062         The main thread is not special anymore.
10064         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10065         size of the stacks to stack_cache_actsize.
10067         * pt-readv.c: Add missing "defined".
10068         * pt-sigwait.c: Likewise.
10069         * pt-writev.c: Likewise.
10071 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10073         * Versions: Export __connect from libpthread.
10074         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10076         * Makefile (libpthread-routines): Add pt-raise.
10077         * sysdeps/unix/sysv/linux/raise.c: New file.
10078         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10079         * sysdeps/generic/pt-raise.c: New file.
10081         * pthread_cond_init.c: Initialize all data elements of the condvar
10082         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10084         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10085         * pthread_create.c: Likewise.
10087         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10088         * tst-key1.c: New file.
10089         * tst-key2.c: New file.
10090         * tst-key3.c: New file.
10092         * Versions: Export pthread_detach for version GLIBC_2.0.
10093         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10095 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10097         * pthread_key_create.c: Terminate search after an unused key was found.
10098         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10100         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10101         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10103 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10105         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10106         dynamic lookup for errno in PIC.
10108         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10109         release the stack lock as soon as possible.
10110         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10111         the static TLS block.
10112         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10114         * cancellation.c: Renamed from cancelation.c.
10115         * Makefile: Adjust accordingly.
10116         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10117         * cleanup_defer.c: Use CANCELLATION_P.
10118         * pthread_testcancel.c: Likewise.
10119         * descr.h: Fix spelling in comments.
10120         * init.c: Likewise.
10121         * pthread_getattr_np.c: Likewise.
10122         * pthread_getschedparam.c: Likewise.
10123         * pthread_setschedparam.c: Likewise.
10124         * Versions: Likewise.
10126         * pt-pselect.c: New file.
10127         * Makefile (libpthread-routines): Add pt-pselect.
10128         * Versions: Add pselect.
10130         * tst-cancel4.c: New file.
10131         * Makefile (tests): Add tst-cancel4.
10133 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10135         * pthread_mutex_lock.c: Always record lock ownership.
10136         * pthread_mutex_timedlock.c: Likewise.
10137         * pthread_mutex_trylock.c: Likewise.
10139         * pt-readv.c: New file.
10140         * pt-writev.c: New file.
10141         * pt-creat.c: New file.
10142         * pt-msgrcv.c: New file.
10143         * pt-msgsnd.c: New file.
10144         * pt-poll.c: New file.
10145         * pt-select.c: New file.
10146         * pt-sigpause.c: New file.
10147         * pt-sigsuspend.c: New file.
10148         * pt-sigwait.c: New file.
10149         * pt-sigwaitinfo.c: New file.
10150         * pt-waitid.c: New file.
10151         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10152         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10153         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10154         * Versions: Add all the new functions.
10156         * tst-exit1.c: New file.
10157         * Makefile (tests): Add tst-exit1.
10159         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10161 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10163         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10165         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10166         call.  pthread_join is an official cancellation point.
10167         * pthread_timedjoin.c: Likewise.
10169         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10170         and the condvar's mutex are retrieved.
10171         * pthread_cond_timedwait.c: Likewise.
10172         Reported by dice@saros.East.Sun.COM.
10174 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10176         * pthreadP.h: Cut out all type definitions and move them...
10177         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10178         * pthreadP.h: Include <internaltypes.h>.
10180         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10181         performance tweaks.
10183         * sem_trywait.c: Shuffle #includes around to get right order.
10184         * sem_timedwait.c: Likewise.
10185         * sem_post.c: Likewise.
10186         * sem_wait.c: Likewise.
10188         * nptl 0.3 released.
10190         * Makefile (tests): Add tst-signal3.
10191         * tst-signal3.c: New file.
10193 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10195         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10196         the asms modify the sem object.
10197         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10199         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10200         the actual members.
10201         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10202         * semaphoreP.h: Include pthreadP.h.
10203         * sem_getvalue.c: Adjust to sem_t change.
10204         * sem_init.c: Likewise.
10205         * sem_open.c: Likewise.
10206         * sem_post.c: Likewise.
10207         * sem_timedwait.c: Likewise.
10208         * sem_trywait.c: Likewise.
10209         * sem_wait.c: Likewise.
10211 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10213         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10214         * tst-basic2.c: New file.
10215         * tst-exec1.c: New file.
10216         * tst-exec2.c: New file.
10217         * tst-exec3.c: New file.
10219         * tst-fork1.c: Remove extra */.
10221         * nptl 0.2 released.  The API for IA-32 is complete.