* sysdeps/sparc/fpu/fraiseexcpt.c (__feraiseexcept): Fix raising
[glibc.git] / nptl / ChangeLog
blob93f80826ba6d48fd7dde11f0abaaa3f41d36c747
1 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
3         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
4         sparc_old_sem): New structs.
5         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
6         (__sem_wait_cleanup): New function.
7         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
8         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
9         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
10         lll_futex_wait.
11         (__old_sem_wait): New function.
12         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
13         nptl/sysdeps/unix/sysv/linux/sparc version.
14         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
15         Likewise.
16         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
17         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
18         (__new_sem_trywait): Use sparc_old_sem structure.
19         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
20         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
21         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
22         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
23         lll_futex_timed_wait.
24         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
25         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
26         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
27         lll_futex_wake.
28         (__old_sem_post): New function.
29         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
30         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
31         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
32         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
33         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
34         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
36 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
38         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
39         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
40         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
41         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
42         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
43         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
44         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
45         Use FUTEX_WAKE_OP.
46         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
47         kernel-features.h and tcb-offsets.h.
48         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
49         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
50         process private.
51         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
52         tcb-offsets.h.
53         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
54         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
55         process private.
56         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
57         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
58         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
59         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
60         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
61         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
62         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
64 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
66         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
67         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
68         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
69         lll_futex_timed_wait.
71         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
72         __lll_robust_unlock): Rewrite as macros instead of inline functions.
73         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
74         __lll_robust_unlock, __lll_wait_tid): Likewise.
76 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
78         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
79         Fix a pasto.
80         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
81         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
82         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
83         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
84         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
85         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
86         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
87         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
88         kernel-features.h.
89         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
90         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
91         process private.  Switch DW_CFA_advance_loc1 and some
92         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
93         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
94         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
95         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
96         process private.  Switch DW_CFA_advance_loc{1,2} and some
97         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
98         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
99         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
100         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
101         Likewise.
102         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
103         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
104         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
105         Likewise.
106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
107         (__pthread_cond_broadcast): Compare %r8 instead of
108         dep_mutex-cond_*(%rdi) with $-1.
109         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
110         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
111         of oring.
113 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
115         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
117 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
119         * allocatestack.c: Include kernel-features.h.
120         * pthread_create.c: Likewise.
121         * pthread_mutex_init.c: Likewise.
122         * init.c: Likewise.
123         * pthread_cond_timedwait.c: Likewise.
124         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
125         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
126         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
127         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
128         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
130         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
131         Likewise.
132         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
133         Likewise.
134         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
135         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
136         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
137         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
139 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
141         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
142         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
143         byte elements.  One of them is the new __shared element.
144         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
145         adjust names of other padding elements.
146         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
147         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
148         byte elements.  One of them is the new __shared element.
149         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
150         adjust names of other padding elements.
151         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
152         Renamed __pad1 element to __shared, adjust names of other padding
153         elements.
154         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
155         (pthread_rwlock_t): Likewise.
156         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
157         typo.
159 2007-08-09  Anton Blanchard  <anton@samba.org>
161         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
163 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
165         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
166         <kernel-features.h>.
167         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
169 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
171         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
172         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
173         dealing with robust mutexes.
174         * pthread_mutex_timedlock.c: Likewise.
175         * pthread_mutex_trylock.c: Likewise.
176         * pthread_mutex_unlock.c: Likewise.
177         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
179 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
181         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
182         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
183         (PTHREAD_MUTEX_PSHARED): Define.
184         * pthread_mutex_init.c (__pthread_mutex_init): Set
185         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
186         mutexes.
187         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
188         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
189         as second argument to lll_lock.
190         (LLL_MUTEX_TRYLOCK): Take mutex as argument
191         instead of its __data.__lock field.
192         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
193         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
194         to lll_robust_lock.
195         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
196         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
197         instead of mutex->__data.__kind directly, pass
198         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
199         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
200         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
201         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
202         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
203         to lll_timedlock, lll_robust_timedlock, lll_unlock and
204         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
205         of mutex->__data.__kind directly.
206         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
207         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
208         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
209         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
210         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
211         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
212         and lll_futex_wake.
213         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
214         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
215         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
216         directly.
217         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
218         Take mutex as argument instead of its __data.__lock field, pass
219         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
220         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
221         __data.__lock field.
222         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
223         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
224         to lll_robust_cond_lock.
225         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
226         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
227         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
228         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
229         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
230         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
231         lll_futex_wait.
232         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
233         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
234         lll_futex_wake.
235         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
236         pshared variable, pass it to lll_lock, lll_unlock,
237         lll_futex_timedwait and lll_futex_wake.
238         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
239         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
240         and lll_futex_wake.
241         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
242         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
243         macro.
244         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
245         lll_futex_wake_unlock): Likewise.
246         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
247         Likewise.
248         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
249         lll_futex_wake_unlock): Likewise.
250         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
251         Likewise.
252         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
253         lll_futex_wake_unlock): Likewise.
254         (lll_futex_wake): Fix a typo.
255         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
256         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
257         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
258         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
259         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
260         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
261         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
262         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
263         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
264         (__pthread_cond_timedwait): Likewise.
265         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
266         (__condvar_cleanup, __pthread_cond_wait): Likewise.
268 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
270         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
271         Don't use CGOTSETUP and CGOTRESTORE macros.
272         (CGOTSETUP, CGOTRESTORE): Remove.
273         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
274         @local symbol.
276 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
278         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
279         definitions for private futexes.
280         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
281         kernel-features.h and lowlevellock.h.  Use private futexes if
282         they are available.
283         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
284         (__lll_mutex_lock_wait): Rename to
285         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
286         (__lll_mutex_timedlock_wait): Rename to ...
287         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
288         Don't compile in for libc.so.
289         (__lll_mutex_unlock_wake): Rename to ...
290         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
291         (__lll_timedwait_tid): Use __NR_gettimeofday.
292         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
293         the header from assembler.  Renamed all lll_mutex_* resp.
294         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
295         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
296         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
297         Define.
298         (__lll_lock_wait_private): Add prototype.
299         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
300         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
301         __lll_unlock_wake): Likewise.
302         (lll_lock): Add private argument.  Call __lll_lock_wait_private
303         if private is constant LLL_PRIVATE.
304         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
305         lll_timedlock, lll_robust_timedlock): Add private argument.
306         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
307         if private is constant LLL_PRIVATE.
308         (lll_robust_unlock, lll_robust_dead): Add private argument.
309         (lll_lock_t): Remove.
310         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
311         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
312         lll_cond_wake, lll_cond_broadcast): Remove.
313         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
314         kernel-features.h and lowlevellock.h.
315         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
316         (LOAD_FUTEX_WAIT): Define.
317         (__lll_robust_mutex_lock_wait): Rename to ...
318         (__lll_robust_lock_wait): ... this.  Add private argument.
319         Use LOAD_FUTEX_WAIT macro.
320         (__lll_robust_mutex_timedlock_wait): Rename to ...
321         (__lll_robust_timedlock_wait): ... this.    Add private argument.
322         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
323         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
324         lowlevellock.h.
325         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
326         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
327         __lll_mutex_{lock,unlock}_*.
328         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
329         lowlevellock.h and pthread-errnos.h.
330         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
331         FUTEX_CMP_REQUEUE, EINVAL): Remove.
332         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
333         __lll_mutex_{lock,unlock}_*.
334         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
335         lowlevellock.h and pthread-errnos.h.
336         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
337         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
338         __lll_mutex_{lock,unlock}_*.
339         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
340         lowlevellock.h.
341         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
342         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
343         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
344         (__condvar_tw_cleanup): Likewise.
345         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
346         lowlevellock.h.
347         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
348         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
349         __lll_mutex_{lock,unlock}_*.
350         ( __condvar_w_cleanup): Likewise.
351         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
352         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
353         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
354         lowlevellock.h.
355         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
356         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
357         __lll_mutex_{lock,unlock}_*.
358         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
359         lowlevellock.h.
360         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
361         FUTEX_PRIVATE_FLAG): Remove.
362         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
363         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
364         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
365         lowlevellock.h.
366         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
367         FUTEX_PRIVATE_FLAG): Remove.
368         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
369         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
370         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
371         lowlevellock.h.
372         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
373         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
374         __lll_mutex_{lock,unlock}_*.
375         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
376         lowlevellock.h.
377         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
378         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
379         __lll_mutex_{lock,unlock}_*.
380         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
381         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
382         (__new_sem_post): Use standard initial exec code sequences.
383         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
384         lowlevellock.h.
385         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
386         FUTEX_PRIVATE_FLAG): Remove.
387         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
388         exec code sequences.
389         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
390         (__new_sem_trywait): Use standard initial exec code sequences.
391         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
392         (__new_sem_wait): Use standard initial exec code sequences.
394 2007-07-31  Anton Blanchard  <anton@samba.org>
396         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
397         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
398         atomic_full_barrier.
400 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
402         * allocatestack.c (stack_cache_lock): Change type to int.
403         (get_cached_stack, allocate_stack, __deallocate_stack,
404         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
405         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
406         as second argument to lll_lock and lll_unlock macros on
407         stack_cache_lock.
408         * pthread_create.c (__find_in_stack_list): Likewise.
409         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
410         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
411         as second argument.
412         * descr.h (struct pthread): Change lock and setxid_futex field
413         type to int.
414         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
415         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
416         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
417         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
418         Likewise.
419         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
420         * pthread_cond_init.c (__pthread_cond_init): Likewise.
421         * pthreadP.h (__attr_list_lock): Change type to int.
422         * pthread_attr_init.c (__attr_list_lock): Likewise.
423         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
424         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
425         lll_{,un}lock.
426         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
427         also for lll_futex_{wake,wait}.
428         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
429         a pointer to const.
430         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
431         LLL_SHARED as second argument to lll_{,un}lock.
432         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
433         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
434         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
435         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
436         Likewise.
437         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
438         as second argument to lll_{,un}lock macros on pd->lock.
439         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
440         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
441         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
442         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
443         Likewise.
444         * sysdeps/pthread/createthread.c (do_clone, create_thread):
445         Likewise.
446         * pthread_once.c (once_lock): Change type to int.
447         (__pthread_once): Pass LLL_PRIVATE as second argument to
448         lll_{,un}lock macros on once_lock.
449         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
450         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
451         rwlock->__data.__shared as second argument to them and similarly
452         for lll_futex_w*.
453         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
454         Likewise.
455         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
456         Likewise.
457         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
458         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
459         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
460         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
461         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
462         to lll_{,un}lock macros on __sem_mappings_lock.
463         * sem_open.c (check_add_mapping): Likewise.
464         (__sem_mappings_lock): Change type to int.
465         * semaphoreP.h (__sem_mappings_lock): Likewise.
466         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
467         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
468         instead of lll_*mutex_*, pass LLL_SHARED as last
469         argument.
470         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
471         pass LLL_SHARED as last argument.
472         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
473         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
474         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
475         pass LLL_SHARED as last argument.
476         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
477         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
478         LLL_SHARED as last argument.
479         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
480         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
481         Similarly.
482         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
483         __libc_lock_lock_recursive, __libc_lock_unlock,
484         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
485         argument to lll_{,un}lock.
486         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
487         _IO_lock_unlock): Likewise.
488         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
489         compound literal.
490         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
491         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
492         __fork_lock.
493         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
494         free_mem): Likewise.
495         (__fork_lock): Change type to int.
496         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
497         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
498         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
499         lll_futex_wake.
500         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
501         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
502         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
503         New function.
504         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
505         pass it through to lll_futex_*wait, only compile in when
506         IS_IN_libpthread.
507         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
508         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
509         argument and pass it through to lll_futex_*wait.
510         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
511         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
512         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
513         inline functions to __lll_* resp. __lll_robust_*.
514         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
515         (lll_mutex_dead): Add private argument.
516         (__lll_lock_wait_private): New prototype.
517         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
518         __lll_robust_lock_timedwait): Add private argument to prototypes.
519         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
520         call __lll_lock_wait_private, otherwise pass private to
521         __lll_lock_wait.
522         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
523         __lll_robust_timedlock): Add private argument, pass it to
524         __lll_*wait functions.
525         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
526         call __lll_unlock_wake_private, otherwise pass private to
527         __lll_unlock_wake.
528         (__lll_robust_unlock): Add private argument, pass it to
529         __lll_robust_unlock_wake.
530         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
531         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
532         argument, pass it through to __lll_* inline function.
533         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
534         (lll_lock_t): Remove.
535         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
536         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
537         lll_cond_wake, lll_cond_broadcast): Remove.
538         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
539         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
540         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
541         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
542         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
543         the header from assembler.  Renamed all lll_mutex_* resp.
544         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
545         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
546         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
547         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
548         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
549         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
550         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
551         Remove prototype.
552         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
553         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
554         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
555         (lll_trylock): Likewise, use __lll_trylock_asm, pass
556         MULTIPLE_THREADS_OFFSET as another asm operand.
557         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
558         MULTIPLE_THREADS_OFFSET as last asm operand, call
559         __lll_lock_wait_private if private is constant LLL_PRIVATE,
560         otherwise pass private as another argument to __lll_lock_wait.
561         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
562         lll_timedlock, lll_robust_timedlock): Add private argument, pass
563         private as another argument to __lll_*lock_wait call.
564         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
565         MULTIPLE_THREADS_OFFSET as another asm operand, call
566         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
567         otherwise pass private as another argument to __lll_unlock_wake.
568         (lll_robust_unlock): Add private argument, pass private as another
569         argument to __lll_unlock_wake.
570         (lll_robust_dead): Add private argument, use __lll_private_flag
571         macro.
572         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
573         LLL_MUTEX_LOCK_INITIALIZER.
574         (lll_lock_t): Remove.
575         (LLL_LOCK_INITIALIZER_WAITERS): Define.
576         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
577         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
578         lll_cond_wake, lll_cond_broadcast): Remove.
579         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
580         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
581         2007-05-2{3,9} changes.
582         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
583         kernel-features.h and lowlevellock.h.
584         (LOAD_PRIVATE_FUTEX_WAIT): Define.
585         (LOAD_FUTEX_WAIT): Rewritten.
586         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
587         define.
588         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
589         (__lll_mutex_lock_wait): Rename to ...
590         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
591         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
592         (__lll_mutex_timedlock_wait): Rename to ...
593         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
594         contains private argument.  Don't compile in for libc.so.
595         (__lll_mutex_unlock_wake): Rename to ...
596         (__lll_unlock_wake): ... this.  %ecx contains private argument.
597         Don't compile in for libc.so.
598         (__lll_timedwait_tid): Use __NR_gettimeofday.
599         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
600         kernel-features.h and lowlevellock.h.
601         (LOAD_FUTEX_WAIT): Define.
602         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
603         define.
604         (__lll_robust_mutex_lock_wait): Rename to ...
605         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
606         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
607         macro.
608         (__lll_robust_mutex_timedlock_wait): Rename to ...
609         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
610         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
611         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
612         lowlevellock.h.
613         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
614         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
615         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
616         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
617         to __lll_lock_wait in %edx.
618         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
619         Include lowlevellock.h and pthread-errnos.h.
620         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
621         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
622         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
623         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
624         pass LLL_SHARED in %ecx to both __lll_lock_wait and
625         __lll_unlock_wake.
626         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
627         Include lowlevellock.h and pthread-errnos.h.
628         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
629         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
630         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
631         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
632         pass LLL_SHARED in %ecx to both __lll_lock_wait and
633         __lll_unlock_wake.
634         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
635         Include lowlevellock.h.
636         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
637         Don't define.
638         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
639         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
640         pass LLL_SHARED in %ecx to both __lll_lock_wait and
641         __lll_unlock_wake.  Use __NR_gettimeofday.
642         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
643         Include lowlevellock.h.
644         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
645         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
646         to __lll_*, pass cond_lock address in %edx rather than %ecx to
647         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
648         and __lll_unlock_wake.
649         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
650         Include lowlevellock.h.
651         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
652         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
653         MUTEX(%ebx) address in %edx rather than %ecx to
654         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
655         and __lll_unlock_wake.  Move return value from %ecx to %edx
656         register.
657         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
658         Include lowlevellock.h.
659         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
660         Don't define.
661         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
662         MUTEX(%ebp) address in %edx rather than %ecx to
663         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
664         and __lll_unlock_wake.  Move return value from %ecx to %edx
665         register.  Use __NR_gettimeofday.
666         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
667         Include lowlevellock.h.
668         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
669         Don't define.
670         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
671         MUTEX(%ebp) address in %edx rather than %ecx to
672         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
673         and __lll_unlock_wake.  Move return value from %ecx to %edx
674         register.  Use __NR_gettimeofday.
675         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
676         Include lowlevellock.h.
677         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
678         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
679         MUTEX(%edi) address in %edx rather than %ecx to
680         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
681         and __lll_unlock_wake.
682         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
683         Include lowlevellock.h.
684         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
685         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
686         MUTEX(%ebx) address in %edx rather than %ecx to
687         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
688         and __lll_unlock_wake.  Move return value from %ecx to %edx
689         register.
690         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
691         lowlevellock.h.
692         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
693         define.
694         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
695         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
696         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
697         lowlevellock.h.
698         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
699         (sem_timedwait): Use __NR_gettimeofday.
700         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
701         lowlevellock.h.
702         (LOCK): Don't define.
703         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
704         lowlevellock.h.
705         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
706         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
707         are waiters.
708         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
709         2007-05-2{3,9} changes.
710         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
711         kernel-features.h and lowlevellock.h.
712         (LOAD_PRIVATE_FUTEX_WAIT): Define.
713         (LOAD_FUTEX_WAIT): Rewritten.
714         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
715         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
716         (__lll_mutex_lock_wait): Rename to ...
717         (__lll_lock_wait): ... this.  %esi is now private argument.
718         Don't compile in for libc.so.
719         (__lll_mutex_timedlock_wait): Rename to ...
720         (__lll_timedlock_wait): ... this.  %esi contains private argument.
721         Don't compile in for libc.so.
722         (__lll_mutex_unlock_wake): Rename to ...
723         (__lll_unlock_wake): ... this.  %esi contains private argument.
724         Don't compile in for libc.so.
725         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
726         kernel-features.h and lowlevellock.h.
727         (LOAD_FUTEX_WAIT): Define.
728         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
729         (__lll_robust_mutex_lock_wait): Rename to ...
730         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
731         Use LOAD_FUTEX_WAIT macro.
732         (__lll_robust_mutex_timedlock_wait): Rename to ...
733         (__lll_robust_timedlock_wait): ... this. %esi argument contains
734         private, use LOAD_FUTEX_WAIT macro.
735         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
736         lowlevellock.h.
737         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
738         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
739         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
740         __lll_lock_wait and __lll_unlock_wake.
741         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
742         Include lowlevellock.h and pthread-errnos.h.
743         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
744         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
745         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
746         pass LLL_SHARED in %esi to both __lll_lock_wait and
747         __lll_unlock_wake.
748         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
749         Include lowlevellock.h and pthread-errnos.h.
750         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
751         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
752         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
753         pass LLL_SHARED in %esi to both __lll_lock_wait and
754         __lll_unlock_wake.
755         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
756         Include lowlevellock.h.
757         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
758         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
759         pass LLL_SHARED in %esi to both __lll_lock_wait and
760         __lll_unlock_wake.
761         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
762         Include lowlevellock.h.
763         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
764         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
765         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
766         and __lll_unlock_wake.
767         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
768         Include lowlevellock.h.
769         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
770         Don't define.
771         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
772         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
773         and __lll_unlock_wake.
774         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
775         Include lowlevellock.h.
776         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
777         Don't define.
778         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
779         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
780         and __lll_unlock_wake.
781         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
782         Include lowlevellock.h.
783         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
784         Don't define.
785         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
786         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
787         and __lll_unlock_wake.
788         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
789         Include lowlevellock.h.
790         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
791         Don't define.
792         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
793         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
794         and __lll_unlock_wake.
795         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
796         Include lowlevellock.h.
797         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
798         Don't define.
799         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
800         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
801         and __lll_unlock_wake.
802         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
803         lowlevellock.h.
804         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
805         define.
806         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
807         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
808         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
809         lowlevellock.h.
810         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
811         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
812         lowlevellock.h.
813         (LOCK): Don't define.
814         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
815         lowlevellock.h.
816         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
817         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
818         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
819         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
820         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
821         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
822         (__lll_lock_wait_private): New function.
823         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
824         it to lll_futex_*wait.  Don't compile in for libc.so.
825         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
826         Remove.
827         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
828         (struct sparc_pthread_barrier): Remove.
829         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
830         struct sparc_pthread_barrier.  Pass
831         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
832         and lll_futex_wait macros.
833         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
834         Remove.
835         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
836         Include sparc pthread_barrier_wait.c instead of generic one.
838 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
840         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
842         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
843         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
844         %ecx.
845         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
846         (pthread_rwlock_timedwrlock): Likewise.
847         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
848         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
850 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
852         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
854 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
856         * tst-locale2.c (useless): Add return statement.
858 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
860         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
861         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
862         * pthread_create.c (start_thread): Likewise.
863         * init.c (sighandler_setxid): Likewise.
864         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
865         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
866         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
867         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
868         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
869         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
870         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
871         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
872         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
873         Likewise.
874         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
875         Likewise.
876         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
877         Likewise.
878         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
879         __rtld_notify): Likewise.
880         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
881         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
882         __pthread_once): Likewise.
883         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
884         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
885         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
886         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
887         (lll_futex_wait): Add private argument, define as wrapper around
888         lll_futex_timed_wait.
889         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
890         use __lll_private_flag macro.
891         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
892         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
893         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
894         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
895         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
896         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
897         (lll_futex_wait): Add private argument, define as wrapper around
898         lll_futex_timed_wait.
899         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
900         use __lll_private_flag macro.
901         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
902         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
903         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
904         Define.
905         (lll_futex_timed_wait, lll_futex_wake): Use it.
906         (lll_private_futex_wait, lll_private_futex_timed_wait,
907         lll_private_futex_wake): Removed.
908         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
909         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
910         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
911         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
912         (lll_futex_wait): Add private argument, define as wrapper around
913         lll_futex_timed_wait.
914         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
915         use __lll_private_flag macro.
916         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
917         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
918         to lll_futex_*.
919         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
920         (lll_private_futex_wait, lll_private_futex_timed_wait,
921         lll_private_futex_wake): Removed.
922         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
923         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
924         (lll_private_futex_wait, lll_private_futex_timed_wait,
925         lll_private_futex_wake): Removed.
926         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
927         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
928         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
929         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
930         (lll_futex_wait): Add private argument, define as wrapper around
931         lll_futex_timed_wait.
932         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
933         use __lll_private_flag macro.
934         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
935         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
936         to lll_futex_*.
937         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
938         Define.
939         (lll_futex_timed_wait, lll_futex_wake): Use it.
940         (lll_private_futex_wait, lll_private_futex_timed_wait,
941         lll_private_futex_wake): Removed.
943 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
945         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
946         of the structure for sparc32.
948 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
950         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
952 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
954         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
955         code used when private futexes are assumed.
956         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
957         Likewise.
959 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
961         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
962         (__lll_private_flag): Define.
963         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
964         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
965         __lll_private_flag.
966         (lll_private_futex_wait, lll_private_futex_timedwait,
967         lll_private_futex_wake): Define as wrapper around non-_private
968         macros.
969         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
970         (__lll_private_flag): Define.
971         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
972         (lll_private_futex_wait, lll_private_futex_timedwait,
973         lll_private_futex_wake): Define as wrapper around non-_private
974         macros.
976 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
978         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
979         parameter to lll_futex_wait call.
980         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
982         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
983         Replace lll_futex_wait with lll_private_futex_wait.
984         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
985         Add LLL_SHARED parameter to lll_futex_wake().
987         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
988         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
989         lll_private_futex_wake.
990         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
991         bit from private parm before syscall.
992         (lll_futex_timed_wait): Likewise.
993         (lll_futex_wake): Likewise.
994         (lll_futex_wake_unlock): Likewise.
995         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
996         (lll_robust_mutex_unlock): Likewise.
997         (lll_mutex_unlock_force): Likewise.
998         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1000 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1002         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1003         compilation when unconditionally using private futexes.
1004         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1005         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1006         Likewise.
1007         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1008         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1010 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1012         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1013         Define.
1015 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1017         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1018         kernel-features.h.
1020 2007-05-16  Roland McGrath  <roland@redhat.com>
1022         * init.c (__nptl_initial_report_events): New variable.
1023         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1024         to that.
1026 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1028         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1029         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1031 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1033         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1034         implementation.
1036 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1038         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1039         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1040         * pthread_mutex_timedlock.c: Likewise.
1041         * pthread_mutex_trylock.c: Likewise.
1042         * pthread_mutex_unlock.c: Likewise.
1044 2007-06-17  Andreas Schwab  <schwab@suse.de>
1046         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1047         sections.
1049 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1051         * allocatestack.c (allocate_stack): Make code compile if
1052         __ASSUME_PRIVATE_FUTEX is set.
1054 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1056         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1057         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1058         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1059         (__pthread_rwlock_wrlock): Likewise.
1060         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1061         (pthread_rwlock_timedrdlock): Likewise.
1062         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1063         (pthread_rwlock_timedwrlock): Likewise.
1064         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1065         (__pthread_rwlock_unlock): Likewise.
1067 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1069         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1070         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1071         Split __flags into __flags, __shared, __pad1 and __pad2.
1072         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1073         futexes if they are available.
1074         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1075         in libc-lowlevellock.S allow using private futexes.
1076         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1077         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1078         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1079         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1080         lll_private_futex_timed_wait and lll_private_futex_wake.
1081         (lll_robust_mutex_unlock): Fix typo.
1082         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1083         field in futex command setup.
1084         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1085         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1086         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1087         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1088         if they are available.  Remove clear_once_control.
1089         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1090         futexes if they are available.
1091         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1092         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1093         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1094         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1095         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1096         Wake only when there are waiters.
1097         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1098         support.  Indicate that there are waiters.  Remove unnecessary
1099         extra cancellation test.
1100         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1101         left-over duplication of __sem_wait_cleanup.
1103 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1105         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1106         parameter to lll_futex_wait, lll_futex_timed_wait, and
1107         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1108         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1109         lll_private_futex_wake.
1110         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1111         * allocatestack.c: Adjust use of lll_futex_* macros.
1112         * init.c: Likewise.
1113         * lowlevellock.h: Likewise.
1114         * pthread_barrier_wait.c: Likewise.
1115         * pthread_cond_broadcast.c: Likewise.
1116         * pthread_cond_destroy.c: Likewise.
1117         * pthread_cond_signal.c: Likewise.
1118         * pthread_cond_timedwait.c: Likewise.
1119         * pthread_cond_wait.c: Likewise.
1120         * pthread_create.c: Likewise.
1121         * pthread_mutex_lock.c: Likewise.
1122         * pthread_mutex_setprioceiling.c: Likewise.
1123         * pthread_mutex_timedlock.c: Likewise.
1124         * pthread_mutex_unlock.c: Likewise.
1125         * pthread_rwlock_timedrdlock.c: Likewise.
1126         * pthread_rwlock_timedwrlock.c: Likewise.
1127         * pthread_rwlock_unlock.c: Likewise.
1128         * sysdeps/alpha/tls.h: Likewise.
1129         * sysdeps/i386/tls.h: Likewise.
1130         * sysdeps/ia64/tls.h: Likewise.
1131         * sysdeps/powerpc/tls.h: Likewise.
1132         * sysdeps/pthread/aio_misc.h: Likewise.
1133         * sysdeps/pthread/gai_misc.h: Likewise.
1134         * sysdeps/s390/tls.h: Likewise.
1135         * sysdeps/sh/tls.h: Likewise.
1136         * sysdeps/sparc/tls.h: Likewise.
1137         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1138         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1139         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1140         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1141         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1142         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1143         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1144         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1145         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1146         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1147         Likewise.
1148         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1149         * sysdeps/x86_64/tls.h: Likewise.
1151 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1153         * pthread_getattr_np.c: No need to install a cancellation handler,
1154         this is no cancellation point.
1155         * pthread_getschedparam.c: Likewise.
1156         * pthread_setschedparam.c: Likewise.
1157         * pthread_setschedprio.c: Likewise.
1158         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1159         lll_unlock_wake_cb.
1160         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1161         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1162         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1163         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1164         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1165         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1166         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1167         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1168         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1169         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1170         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1171         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1173         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1174         whether there are more than one thread makes no sense here since
1175         we only call the slow path if the locks are taken.
1176         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1178         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1179         COND_NWAITERS_SHIFT.
1180         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1181         COND_CLOCK_BITS.
1182         * pthread_cond_init.c: Likewise.
1183         * pthread_cond_timedwait.c: Likewise.
1184         * pthread_cond_wait.c: Likewise.
1185         * pthread_condattr_getclock.c: Likewise.
1186         * pthread_condattr_setclock.c: Likewise.
1187         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1188         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1189         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1190         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1191         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1193 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1195         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1196         unistd.h.
1198         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1199         insn suffix.
1200         (THREAD_GSCOPE_GET_FLAG): Remove.
1201         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1202         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1203         changes.
1204         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1205         (THREAD_GSCOPE_GET_FLAG): Remove.
1206         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1207         instead of THREAD_GSCOPE_GET_FLAG.
1208         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1209         it.
1210         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1211         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1212         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1213         THREAD_GSCOPE_WAIT): Define.
1214         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1215         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1216         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1217         THREAD_GSCOPE_WAIT): Define.
1218         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1219         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1220         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1221         THREAD_GSCOPE_WAIT): Define.
1222         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1223         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1224         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1225         THREAD_GSCOPE_WAIT): Define.
1227 2007-05-24  Richard Henderson  <rth@redhat.com>
1229         * descr.h (struct pthread): Add header.gscope_flag.
1230         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1231         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1232         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1233         THREAD_GSCOPE_WAIT): Define.
1235 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1237         * init.c: Make it compile with older kernel headers.
1239         * tst-initializers1.c: Show through exit code which test failed.
1241         * pthread_rwlock_init.c: Also initialize __shared field.
1242         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1243         element in rwlock structure into four byte elements.  One of them is
1244         the new __shared element.
1245         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1246         Likewise.
1247         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1248         __shared, adjust names of other padding elements.
1249         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1250         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1251         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1252         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1253         FUTEX_PRIVATE_FLAG.
1254         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1255         futex to use private operations if possible.
1256         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1257         Likewise.
1258         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1259         Likewise.
1260         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1261         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1262         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1263         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1264         Likewise.
1265         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1266         Likewise.
1267         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1268         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1270 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1272         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1273         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1274         * pthread_rwlock_timedrdlock.c: Likewise.
1275         * pthread_rwlock_tryrdlock.c: Likewise.
1277         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1278         optimization.
1280         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1281         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1282         duplication of __sem_wait_cleanup.
1284         * allocatestack.c: Revert last change.
1285         * init.c: Likewise.
1286         * sysdeps/i386/tls.h: Likewise.
1287         * sysdeps/x86_64/tls.h: Likewise.
1288         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1289         header structure.
1290         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1292         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1293         Add private field.
1294         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1295         * pthread_barrier_init.c: Set private flag if pshared and private
1296         futexes are supported.
1297         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1298         private field in futex command setup.
1299         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1301 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1303         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1304         support.
1305         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1306         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1307         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1308         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1309         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1311         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1312         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1313         fields in the structure.
1314         (__old_sem_init): New function.
1315         * sem_open.c: Initialize all fields of the structure.
1316         * sem_getvalue.c: Adjust for renamed element.
1317         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1318         (gen-as-const-headers): Add structsem.sym.
1319         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1320         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1321         struct new_sem.  Add struct old_sem.
1322         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1323         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1324         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1325         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1326         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1327         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1328         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1329         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1330         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1331         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1332         * tst-sem10.c: New file.
1333         * tst-sem11.c: New file.
1334         * tst-sem12.c: New file.
1335         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1336         of struct sem.
1338 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1339             Jakub Jelinek  <jakub@redhat.com>
1341         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1342         Move __pthread_enable_asynccancel right before futex syscall.
1343         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1344         Likewise.
1346 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1348         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1349         THREAD_COPY_PRIVATE_FUTEX): Define.
1350         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1351         THREAD_COPY_PRIVATE_FUTEX): Define.
1352         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1353         * init.c (__pthread_initialize_minimal_internal): Use
1354         THREAD_SET_PRIVATE_FUTEX.
1356         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1357         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1358         THREAD_GSCOPE_FLAG_WAIT): Define.
1359         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1360         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1361         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1362         PTR_DEMANGLE.
1363         (THREAD_GSCOPE_GET_FLAG): Define.
1364         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1365         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1366         instead of ->header.gscope_flag directly.
1368 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1370         * init.c (__pthread_initialize_minimal_internal): Check whether
1371         private futexes are available.
1372         * allocatestack.c (allocate_stack): Copy private_futex field from
1373         current thread into the new stack.
1374         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1375         futexes if they are available.
1376         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1377         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1378         in libc-lowlevellock.S allow using private futexes.
1379         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1380         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1381         FUTEX_PRIVATE_FLAG.
1382         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1383         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1384         if they are available.
1385         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1386         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1387         * sysdeps/i386/tcb-offsets.sym: Likewise.
1388         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1389         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1391 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1393         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1394         Remove ptr_wait_lookup_done again.
1395         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1396         (__pthread_initialize_minimal_internal): Initialize
1397         _dl_wait_lookup_done pointer in _rtld_global directly.
1398         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1399         Remove code to code _dl_wait_lookup_done.
1400         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1401         encrypted for now.
1403 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1405         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1406         pthread_mutex_init failed with ENOTSUP.
1408 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1410         * allocatestack.c (__wait_lookup_done): New function.
1411         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1412         Add ptr_wait_lookup_done.
1413         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1414         * pthreadP.h: Declare __wait_lookup_done.
1415         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1416         Define macros to implement reference handling of global scope.
1417         * sysdeps/x86_64/tls.h: Likewise.
1418         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1419         Initialize GL(dl_wait_lookup_done).
1421 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1423         [BZ #4512]
1424         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1425         is detected.
1426         * pthread_mutex_timedlock.c: Likewise.
1427         * pthread_mutex_trylock.c: Likewise.
1428         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1430         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1431         * tst-robust9.c: New file.
1432         * tst-robustpi9.c: New file.
1434         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1435         unnecessary extra cancellation test.
1437 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1439         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1440         extra cancellation test.
1441         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1443 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1445         * descr.h (struct pthread): Rearrange members to fill hole in
1446         64-bit layout.
1448         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1449         (__pthread_setaffinity_new): If syscall was successful and
1450         RESET_VGETCPU_CACHE is defined, use it before returning.
1451         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1453 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1455         [BZ #4455]
1456         * tst-align2.c: Include stackinfo.h.
1457         * tst-getpid1.c: Likewise.
1459 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1461         [BZ #4455]
1462         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1463         * tst-getpid1.c (do_test): Likewise.
1465         [BZ #4456]
1466         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1467         (allocate_stack): Likewise.
1469 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1471         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1472         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1473         (__lll_robust_timedlock_wait): Likewise.
1474         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1476 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1478         [BZ #4465]
1479         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1480         * tst-cancel4.c (tf_fdatasync): New test.
1482 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1484         [BZ #4392]
1485         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1486         check mutexes like normal mutexes.
1488         [BZ #4306]
1489         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1490         Initialize the whole sigevent structure to appease valgrind.
1492 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1494         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1495         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1497 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1499         * tst-locale1.c: Avoid warnings.
1500         * tst-locale2.c: Likewise.
1502 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1504         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1505         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1507 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1509         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1510         __extern_always_inline where appropriate.
1511         * sysdeps/pthread/pthread.h: Likewise.
1513 2007-03-13  Richard Henderson  <rth@redhat.com>
1515         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1516         separate cfi regions for the two subsections.
1518 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1520         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1521         new thread, don't just decrement it.
1522         Patch by Suzuki K P <suzuki@in.ibm.com>.
1524 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1526         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1527         PTHFCT_CALL definition.
1529 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1531         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1532         available, don't use it.
1534 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1536         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1537         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1538         call into the kernel to delay.
1540 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1542         * tst-initializers1.c: We want to test the initializers as seen
1543         outside of libc, so undefined _LIBC.
1545         * pthread_join.c (cleanup): Avoid warning.
1547 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1549         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1550         (__lll_timedwait_tid): Add unwind info.
1552         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1553         function table, mangle the pointers.
1554         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1555         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1556         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1557         demangle pointers before use.
1558         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1559         demangle pointer.
1560         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1561         * sysdeps/pthread/setxid.h: Likewise.
1563 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1565         * tst-rwlock7.c: Show some more information in case of correct
1566         behavior.
1568 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1570         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1571         (lll_futex_timed_wait): Undo part of last change, don't negate
1572         return value.
1574 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1576         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1577         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1579 2006-12-28  David S. Miller  <davem@davemloft.net>
1581         * shlib-versions: Fix sparc64 linux target specification.
1583 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1585         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1586         Adjust include path for pthread_barrier_wait.c move.
1588 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1590         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1591         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1593 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1595         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1596         6 argument cancellable syscalls.
1597         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1598         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1599         6 argument cancellable syscalls.
1600         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1602 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1604         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1605         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1607 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1609         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1610         __sync_lock_release instead of __sync_lock_release_si.
1612 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1614         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1615         Define.
1616         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1617         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1618         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1619         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1620         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1621         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1622         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1623         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1624         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1625         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1626         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1628 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1630         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1631         * pthread_barrier_wait.c: ...here.
1632         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1633         * pthread_cond_broadcast.c: ...here.
1634         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1635         * pthread_cond_signal.c: ...here.
1636         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1637         * pthread_cond_timedwait.c: ...here.
1638         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1639         * pthread_cond_wait.c: ...here.
1640         * sysdeps/pthread/pthread_once.c: Move to...
1641         * pthread_once.c: ...here.
1642         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1643         * pthread_rwlock_rdlock.c: ...here.
1644         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1645         * pthread_rwlock_timedrdlock.c: ...here.
1646         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1647         * pthread_rwlock_timedwrlock.c: ...here.
1648         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1649         * pthread_rwlock_unlock.c: ...here.
1650         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1651         * pthread_rwlock_wrlock.c: ...here.
1652         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1653         * pthread_spin_destroy.c: ...here.
1654         * sysdeps/pthread/pthread_spin_init.c: Move to...
1655         * pthread_spin_init.c: ...here.
1656         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1657         * pthread_spin_unlock.c: ...here.
1658         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1659         * pthread_getcpuclockid.c: ...here.
1661         * init.c: USE_TLS support is now always enabled.
1662         * tst-tls5.h: Likewise.
1663         * sysdeps/alpha/tls.h: Likewise.
1664         * sysdeps/i386/tls.h: Likewise.
1665         * sysdeps/ia64/tls.h: Likewise.
1666         * sysdeps/powerpc/tls.h: Likewise.
1667         * sysdeps/s390/tls.h: Likewise.
1668         * sysdeps/sh/tls.h: Likewise.
1669         * sysdeps/sparc/tls.h: Likewise.
1670         * sysdeps/x86_64/tls.h: Likewise.
1672 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1674         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1675         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1676         failed.
1678         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1679         Define to THREAD_SELF->header.multiple_threads.
1680         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1681         Likewise.
1682         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1683         Likewise.
1684         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1685         (SINGLE_THREAD_P): Likewise.
1686         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1687         (SINGLE_THREAD_P): Likewise.
1688         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1689         (SINGLE_THREAD_P): Likewise.
1690         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1691         (SINGLE_THREAD_P): Likewise.
1692         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
1693         Likewise.
1694         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1695         (SINGLE_THREAD_P): Likewise.
1696         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1697         (SINGLE_THREAD_P): Likewise.
1698         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
1699         Likewise.
1701 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
1703         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
1704         by default rather than 2_3_3.
1706 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
1708         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1709         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
1710         atomic_* instead of catomic_* macros.
1712 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
1714         [BZ #3285]
1715         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
1716         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1717         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1718         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1719         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1720         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
1721         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1722         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1723         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1724         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
1725         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1726         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1727         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1729 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
1731         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
1732         cancelable syscalls with six parameters.
1734         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
1735         operations instead of atomic_*.
1737 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
1739         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
1741 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
1743         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
1744         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
1745         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
1746         New file.
1747         * pthread_attr_setstack.c: Allow overwriting the version number of the
1748         new symbol.
1749         * pthread_attr_setstacksize.c: Likewise.
1750         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
1751         it.
1752         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
1753         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
1755 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
1757         [BZ #3251]
1758         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
1759         Patch by Petr Baudis.
1761 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
1763         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
1765         * tst-cancel2.c (tf): Loop as long as something was written.
1767 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1769         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
1770         mutexes wake all mutexes.
1771         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
1772         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1773         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1775 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
1777         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
1778         to guarantee the thread is always canceled.
1780 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
1782         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
1783         Include stdlib.h.
1784         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
1785         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
1786         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1788         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1790 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
1792         [BZ #3123]
1793         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
1794         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1795         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1796         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1797         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1798         * Makefile (tests): Add tst-cond22.
1799         * tst-cond22.c: New file.
1801 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
1803         [BZ #3124]
1804         * descr.h (struct pthread): Add parent_cancelhandling.
1805         * sysdeps/pthread/createthread.c (create_thread): Pass parent
1806         cancelhandling value to child.
1807         * pthread_create.c (start_thread): If parent thread was canceled
1808         reset the SIGCANCEL mask.
1809         * Makefile (tests): Add tst-cancel25.
1810         * tst-cancel25.c: New file.
1812 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
1813             Ulrich Drepper  <drepper@redhat.com>
1815         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
1816         counterp if it is already zero.
1817         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
1819 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
1820             Roland McGrath  <roland@redhat.com>
1822         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
1823         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1824         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
1825         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1826         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1827         lll_robust_mutex_timedlock, lll_mutex_unlock,
1828         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1829         Add _L_*_ symbols around the subsection.
1830         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
1831         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
1833 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
1834             Roland McGrath  <roland@redhat.com>
1836         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1837         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1838         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
1839         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1840         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1841         lll_robust_mutex_timedlock, lll_mutex_unlock,
1842         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1843         Add _L_*_ symbols around the subsection.
1844         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
1845         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
1847 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
1849         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
1850         change because it can disturb too much existing code.  If real hard
1851         reader preference is needed we'll introduce another type.
1852         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1853         (pthread_rwlock_timedwrlock): Likewise.
1854         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1855         Likewise.
1857 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
1859         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
1860         reader preference.
1861         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1862         (pthread_rwlock_timedwrlock): Likewise.
1863         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1864         Likewise.
1866 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
1868         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
1869         Only define ifdef SHARED.
1871 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
1873         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
1874         (free_stacks): ...here.
1875         (__free_stack_cache): New function.
1876         * pthreadP.h: Declare __free_stack_cache.
1877         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
1878         ptr_freeres.
1879         * init.c (pthread_functions): Initialize ptr_freeres.
1880         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
1881         New freeres function.
1883 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
1885         [BZ #3018]
1886         * Makefile (extra-objs): Add modules to extra-test-objs instead.
1888 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
1890         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1891         _XOPEN_REALTIME_THREADS.
1893 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
1895         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
1896         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
1897         HAVE_CLOCK_GETTIME_VSYSCALL.
1898         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
1900 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
1902         * sysdeps/unix/sysv/linux/bits/posix_opt.h
1903         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
1904         * descr.h (struct priority_protection_data): New type.
1905         (struct pthread): Add tpp field.
1906         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
1907         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
1908         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
1909         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
1910         TPP mutexes.
1911         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
1912         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
1913         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
1914         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
1915         * tpp.c: New file.
1916         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
1917         boosted by TPP.
1918         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1919         * pthread_mutexattr_getprioceiling.c
1920         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
1921         in the SCHED_FIFO priority range.
1922         * pthread_mutexattr_setprioceiling.c
1923         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
1924         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
1925         if mutex is not TPP.  Ceiling is now in __data.__lock.
1926         * pthread_mutex_setprioceiling.c: Include stdbool.h.
1927         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
1928         is now in __data.__lock.  Add locking.
1929         * pthread_create.c (__free_tcb): Free pd->tpp structure.
1930         * Makefile (libpthread-routines): Add tpp.
1931         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
1932         * tst-tpp.h: New file.
1933         * tst-mutexpp1.c: New file.
1934         * tst-mutexpp6.c: New file.
1935         * tst-mutexpp10.c: New file.
1936         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
1937         * tst-mutex6.c (TEST_FUNCTION): Likewise.
1939 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
1941         [BZ #2843]
1942         * pthread_join.c (pthread_join): Account for self being canceled
1943         when checking for deadlocks.
1944         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
1945         (tf1): Don't print anything after pthread_join returns, this would be
1946         another cancellation point.
1947         (tf2): Likewise.
1948         * tst-join6.c: New file.
1949         * Makefile (tests): Add tst-join6.
1951 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
1953         [BZ #2892]
1954         * pthread_setspecific.c (__pthread_setspecific): Check
1955         out-of-range index before checking for unused key.
1957         * sysdeps/pthread/gai_misc.h: New file.
1959 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
1961         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
1962         file.  Don't use sysctl.
1963         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
1964         overwrite the file if this is likely not true.
1966 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
1968         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
1969         * Makefile (tests): Add tst-getpid3.
1970         * tst-getpid3.c: New file.
1972 2006-07-30  Roland McGrath  <roland@redhat.com>
1974         * Makefile (libpthread-routines): Add ptw-sigsuspend.
1976         * sysdeps/unix/sysv/linux/i386/not-cancel.h
1977         (pause_not_cancel): New macro.
1978         (nanosleep_not_cancel): New macro.
1979         (sigsuspend_not_cancel): New macro.
1980         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1981         nanosleep_not_cancel macro from <not-cancel.h>.
1982         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
1983         macro from <not-cancel.h>.
1985 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
1986             Jakub Jelinek  <jakub@redhat.com>
1988         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
1989         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
1990         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
1991         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
1992         * pthread_mutex_init.c: Add support for priority inheritance mutex.
1993         * pthread_mutex_lock.c: Likewise.
1994         * pthread_mutex_timedlock.c: Likewise.
1995         * pthread_mutex_trylock.c: Likewise.
1996         * pthread_mutex_unlock.c: Likewise.
1997         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
1998         all mutexes.
1999         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2000         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2001         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2002         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2003         pthread-pi-defines.sym.
2004         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2005         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2006         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2007         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2008         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2009         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2010         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2011         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2012         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2013         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2014         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2015         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2016         * tst-mutex2.c: Likewise.
2017         * tst-mutex3.c: Likewise.
2018         * tst-mutex4.c: Likewise.
2019         * tst-mutex5.c: Likewise.
2020         * tst-mutex6.c: Likewise.
2021         * tst-mutex7.c: Likewise.
2022         * tst-mutex7a.c: Likewise.
2023         * tst-mutex8.c: Likewise.
2024         * tst-mutex9.c: Likewise.
2025         * tst-robust1.c: Likewise.
2026         * tst-robust7.c: Likewise.
2027         * tst-robust8.c: Likewise.
2028         * tst-mutexpi1.c: New file.
2029         * tst-mutexpi2.c: New file.
2030         * tst-mutexpi3.c: New file.
2031         * tst-mutexpi4.c: New file.
2032         * tst-mutexpi5.c: New file.
2033         * tst-mutexpi6.c: New file.
2034         * tst-mutexpi7.c: New file.
2035         * tst-mutexpi7a.c: New file.
2036         * tst-mutexpi8.c: New file.
2037         * tst-mutexpi9.c: New file.
2038         * tst-robust1.c: New file.
2039         * tst-robust2.c: New file.
2040         * tst-robust3.c: New file.
2041         * tst-robust4.c: New file.
2042         * tst-robust5.c: New file.
2043         * tst-robust6.c: New file.
2044         * tst-robust7.c: New file.
2045         * tst-robust8.c: New file.
2046         * Makefile (tests): Add the new tests.
2048         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2049         * pthread_mutex_destroy.c: Remove unneeded label.
2051 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2053         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2054         computations to compile time.
2056 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2058         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2060 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2062         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2064 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2066         * pthread_key_create.c (__pthread_key_create): Do away with
2067         __pthread_keys_lock.
2069         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2070         (__kernel_cpumask_size): Mark as hidden.
2071         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2073         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2074         * semaphoreP.h (__sem_mappings_lock): Likewise.
2076 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2078         * pthread_atfork.c: Mark __dso_handle as hidden.
2080 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2082         [BZ #2644]
2083         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2084         the reload problem.  Change the one path in pthread_cancel_init
2085         which causes the problem.  Force gcc to reload.  Simplify callers.
2086         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2087         (_Unwind_GetBSP): Undo last patch.
2089 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2091         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2092         function pointer is reloaded after pthread_cancel_init calls.
2094         [BZ #2644]
2095         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2096         pointers are reloaded after pthread_cancel_init calls.
2098 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2100         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2101         __always_inline.
2103 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2105         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2106         Allocate new object which is passed to timer_sigev_thread so that
2107         the timer can be deleted before the new thread is scheduled.
2109 2006-04-26  Roland McGrath  <roland@redhat.com>
2111         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2113 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2115         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2116         suffix for conditional jumps.
2117         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2118         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2119         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2120         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2121         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2122         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2124         * init.c (sigcancel_handler): Compare with correct PID even if the
2125         thread is in the middle of a fork call.
2126         (sighandler_setxid): Likewise.
2127         Reported by Suzuki K P <suzuki@in.ibm.com> .
2129 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2131         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2133 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2135         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2136         fails [Coverity CID 105].
2138 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2140         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2142 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2144         [BZ #2505]
2145         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2146         Define __lll_rel_instr using lwsync.
2148 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2150         * allocatestack.c (allocate_stack): Always initialize robust_head.
2151         * descr.h: Define struct robust_list_head.
2152         (struct pthread): Use robust_list_head in robust mutex list definition.
2153         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2154         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2155         (__pthread_initialize_minimal_internal): Register robust_list with
2156         the kernel.
2157         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2158         Declare __set_robust_list_avail.
2159         * pthread_create.c (start_thread): Register robust_list of new thread.
2160         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2161         waiters.
2162         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2163         number of users, it's unreliable.
2164         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2165         set_robust_list syscall is available.
2166         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2167         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2168         Set robust_head.list_op_pending before trying to lock a robust mutex.
2169         * pthread_mutex_timedlock.c: Likewise.
2170         * pthread_mutex_trylock.c: Likewise.
2171         * pthread_mutex_unlock.c: Likewise for unlocking.
2172         * Makefile (tests): Add tst-robust8.
2173         * tst-robust8.c: New file.
2175 2006-03-08  Andreas Schwab  <schwab@suse.de>
2177         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2178         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2180 2006-03-05  Roland McGrath  <roland@redhat.com>
2182         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2183         and $config_os doesn't match *linux*.
2185 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2187         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2188         Use __syscall_error.
2189         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2190         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2191         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2192         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2193         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2194         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2196 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2198         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2200 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2202         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2203         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2204         mutex.
2205         (__lll_robust_timedlock_wait): Likewise.
2206         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2207         (__lll_robust_lock_wait): Likewise.
2208         (__lll_robust_timedlock_wait): Likewise.
2209         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2210         (__lll_robust_lock_wait): Likewise.
2211         (__lll_robust_timedlock_wait): Likewise.
2213 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2215         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2216         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2217         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2218         lll_robust_mutex_unlock): Define.
2219         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2221 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2223         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2224         instead of <clone.S>.
2226 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2228         * Makefile (libpthread-routines): Add
2229         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2230         and pthread_mutex_[sg]etprioceiling.
2231         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2232         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2233         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2234         pthread_mutex_setprioceiling.
2235         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2236         PTHREAD_PRIO_PROTECT): New enum values.
2237         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2238         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2239         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2240         prototypes.
2241         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2242         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2243         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2244         Define.
2245         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2246         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2247         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2248         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2249         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2250         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2251         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2252         protocol mutexes.
2253         * pthread_mutex_getprioceiling.c: New file.
2254         * pthread_mutex_setprioceiling.c: New file.
2255         * pthread_mutexattr_getprioceiling.c: New file.
2256         * pthread_mutexattr_setprioceiling.c: New file.
2257         * pthread_mutexattr_getprotocol.c: New file.
2258         * pthread_mutexattr_setprotocol.c: New file.
2260 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2262         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2264 2006-02-27  Roland McGrath  <roland@redhat.com>
2266         * sysdeps/pthread/Subdirs: List nptl here too.
2267         * configure (libc_add_on_canonical): New variable.
2269         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2271         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2272         self to get main source tree's file.
2273         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2274         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2275         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2276         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2277         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2278         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2279         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2280         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2281         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2282         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2283         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2284         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2285         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2287         * Makefile: Use $(sysdirs) in vpath directive.
2289         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2290         (CPPFLAGS-timer_routines.c): Likewise.
2292         * Makeconfig (includes): Variable removed.
2294 2006-02-26  Roland McGrath  <roland@redhat.com>
2296         * sysdeps/generic/pt-raise.c: Moved to ...
2297         * pt-raise.c: ... here.
2298         * sysdeps/generic/lowlevellock.h: Moved to ...
2299         * lowlevellock.h: ... here.
2301 2006-02-23  Roland McGrath  <roland@redhat.com>
2303         * descr.h (struct pthread): Add final member `end_padding'.
2304         (PTHREAD_STRUCT_END_PADDING): Use it.
2306 2006-02-20  Roland McGrath  <roland@redhat.com>
2308         * sysdeps/mips: Directory removed, saved in ports repository.
2309         * sysdeps/unix/sysv/linux/mips: Likewise.
2311 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2313         * tst-robust1.c: Add second mutex to check that the mutex list is
2314         handled correctly.
2316 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2318         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2319         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2320         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2321         lll_robust_mutex_unlock): New macros.
2322         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2323         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2324         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2325         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2326         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2328 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2330         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2331         definitions.
2332         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2334 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2336         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2337         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2338         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2339         (lll_robust_mutex_unlock): Likewise.
2341 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2343         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2344         Set robust_list.__next rather than robust_list.
2345         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2346         (__pthread_list_t): New typedef.
2347         (pthread_mutex_t): Replace __next and __prev fields with __list.
2348         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2349         (__pthread_list_t): New typedef.
2350         (pthread_mutex_t): Replace __next and __prev fields with __list.
2351         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2352         (__pthread_list_t, __pthread_slist_t): New typedefs.
2353         (pthread_mutex_t): Replace __next and __prev fields with __list.
2354         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2355         (__pthread_list_t, __pthread_slist_t): New typedefs.
2356         (pthread_mutex_t): Replace __next and __prev fields with __list.
2357         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2358         (__pthread_list_t, __pthread_slist_t): New typedefs.
2359         (pthread_mutex_t): Replace __next and __prev fields with __list.
2360         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2361         (__pthread_slist_t): New typedef.
2362         (pthread_mutex_t): Replace __next field with __list.
2364 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2366         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2367         PTHREAD_MUTEX_OWNERDEAD.
2368         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2369         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2370         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2371         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2372         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2373         to PTHREAD_MUTEX_INCONSISTENT.
2374         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2375         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2376         * pthread_mutex_trylock.c: Likewise.
2377         * pthread_mutex_timedlock.c: Likewise.
2378         * pthread_mutex_unlock.c: Likewise.
2379         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2380         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2381         lowlevelrobustlock.sym.
2382         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2383         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2384         definitions.
2385         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2386         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2387         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2388         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2389         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2391 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2393         * allocatestack.c (allocate_stack): Initialize robust_list.
2394         * init.c (__pthread_initialize_minimal_internal): Likewise.
2395         * descr.h (struct xid_command): Pretty printing.
2396         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2397         robust_list.  Adjust macros.
2398         * pthread_create.c (start_thread): Adjust robust_list handling.
2399         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2400         but the owner for all robust mutex types.
2401         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2402         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2403         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2404         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2406         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2407         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2409 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2411         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2412         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2414 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2416         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2417         Return status.
2418         (lll_futex_timed_wait): Define.
2420 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2422         * tst-cancel4.c: Test ppoll.
2424 2006-01-18  Andreas Jaeger  <aj@suse.de>
2426         [BZ #2167]
2427         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2428         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2429         by Jim Gifford <patches@jg555.com>.
2431 2006-01-13  Richard Henderson  <rth@redhat.com>
2433         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2435 2006-01-10  Roland McGrath  <roland@redhat.com>
2437         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2438         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2439         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2440         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2441         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2442         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2443         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2444         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2445         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2446         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2448 2006-01-09  Roland McGrath  <roland@redhat.com>
2450         * tst-initializers1-c89.c: New file.
2451         * tst-initializers1-c99.c: New file.
2452         * tst-initializers1-gnu89.c: New file.
2453         * tst-initializers1-gnu99.c: New file.
2454         * Makefile (tests): Add them.
2455         (CFLAGS-tst-initializers1-c89.c): New variable.
2456         (CFLAGS-tst-initializers1-c99.c): New variable.
2457         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2458         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2460         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2461         Use __extension__ on anonymous union definition.
2462         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2463         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2464         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2465         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2466         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2468 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2470         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2471         Don't give the union a name because it changes the mangled name.
2472         Instead name the struct for __data.
2473         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2474         Likewise.
2475         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2476         Likewise.
2478 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2480         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2481         stack bias to mc_ftp field.
2483 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2485         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2486         being too clever and reloading the futex value where it shouldn't.
2488 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2490         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2491         correct type.
2493 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2495         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2496         Add cfi directives.
2498 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2500         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2501         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2502         rename in tcbhead_t.
2504         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2505         Don't give the union a name because it changes the mangled name.
2506         Instead name the struct for __data.
2507         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2508         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2509         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2510         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2511         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2512         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2514 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2516         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2517         Return status.
2518         (lll_futex_timed_wait): Define.
2519         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2520         * sysdeps/pthread/aio_misc.h: New file.
2522 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2524         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2526 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2528         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2529         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2530         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2532 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2534         * tst-cancel24.cc: Use C headers instead of C++ headers.
2536 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2538         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2539         sparc-linux configured glibc.
2540         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2541         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2542         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2543         atomic_compare_and_exchange_val_24_acq instead of
2544         atomic_compare_and_exchange_val_acq.
2545         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2546         instead of atomic_exchange_rel.
2547         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2548         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2549         file.
2550         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2551         file.
2552         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2553         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2554         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2555         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2556         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2557         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2558         New file.
2559         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2560         New file.
2561         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2562         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2563         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2564         file.
2565         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2566         file.
2567         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2569 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2571         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2572         mutex initializers.
2574 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2576         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2577         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2578         THREAD_COPY_POINTER_GUARD): Define.
2579         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2580         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2582 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2584         * version.c: Update copyright year.
2586 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2588         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2589         .eh_frame section, use cfi_* directives.
2590         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2592 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2594         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2595         now.
2597 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2599         * sysdeps/pthread/sigaction.c: Removed.
2600         * sigaction.c: New file.
2601         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2603 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2605         * Makefile (tests): Add tst-signal7.
2606         * tst-signal7.c: New file.
2608 2005-12-27  Roland McGrath  <roland@redhat.com>
2610         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2611         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2612         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2613         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2614         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2615         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2616         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2617         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2618         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2619         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2620         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2622 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2624         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2625         and __prev field to pthread_mutex_t.
2626         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2627         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2628         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2629         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2630         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2631         to pthread_mutex_t.
2633 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2635         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2636         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2637         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2638         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2639         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2640         and PTHREAD_MUTEXATTR_FLAG_BITS.
2641         * descr.h (struct pthread): Add robust_list field and define
2642         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2643         * pthread_mutexattr_getrobust.c: New file.
2644         * pthread_mutexattr_setrobust.c: New file.
2645         * pthread_mutex_consistent.c: New file.
2646         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2647         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2648         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2649         Adjust pthread_mutex_t initializers.
2650         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2651         field to pthread_mutex_t.
2652         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2653         and __prev field to pthread_mutex_t.
2654         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2655         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2656         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2657         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2658         * pthread_mutexattr_gettype.c: Likewise.
2659         * pthread_mutexattr_setpshared.c: Likewise.
2660         * pthread_mutexattr_settype.c: Likewise.
2661         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2662         Initialize mutex kind according to robust flag.
2663         * pthread_mutex_lock.c: Implement local robust mutex.
2664         * pthread_mutex_timedlock.c: Likewise.
2665         * pthread_mutex_trylock.c: Likewise.
2666         * pthread_mutex_unlock.c: Likewise.
2667         * pthread_create.c (start_thread): Mark robust mutexes which remained
2668         locked as dead.
2669         * tst-robust1.c: New file.
2670         * tst-robust2.c: New file.
2671         * tst-robust3.c: New file.
2672         * tst-robust4.c: New file.
2673         * tst-robust5.c: New file.
2674         * tst-robust6.c: New file.
2675         * tst-robust7.c: New file.
2676         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
2677         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2678         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
2679         tst-robust5, tst-robust6, and tst-robust7.
2681         * tst-typesizes.c: New file.
2682         * Makefile (tests): Add tst-typesizes.
2684         * tst-once3.c: More debug output.
2686 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
2688         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
2689         missing after last change.
2691         * version.c: Update copyright year.
2693 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
2695         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
2696         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
2697         * pthread_mutex_trylock.c: Likewise.
2698         * pthread_mutex_timedlock.c: Likewise.
2699         * pthread_mutex_unlock.c: Likewise.
2701 2005-12-22  Roland McGrath  <roland@redhat.com>
2703         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
2704         so that #include_next's search location is not reset to the -I..
2705         directory where <nptl/...> can be found.
2707 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
2709         [BZ #1913]
2710         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2711         Fix unwind info.  Remove useless branch prediction prefix.
2712         * tst-cancel24.cc: New file.
2713         * Makefile: Add rules to build and run tst-cancel24.
2715 2005-12-21  Roland McGrath  <roland@redhat.com>
2717         * libc-cancellation.c: Use <> rather than "" #includes.
2718         * pt-cleanup.c: Likewise.
2719         * pthread_create.c: Likewise.
2720         * pthread_join.c: Likewise.
2721         * pthread_timedjoin.c: Likewise.
2722         * pthread_tryjoin.c: Likewise.
2723         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
2724         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2725         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2726         * unwind.c: Likewise.
2728 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2730         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
2731         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
2732         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2733         THREAD_COPY_POINTER_GUARD): Define.
2735 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
2737         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
2738         rather than one.
2739         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2740         THREAD_COPY_POINTER_GUARD): Define.
2741         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
2742         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
2743         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2744         THREAD_COPY_POINTER_GUARD): Define.
2745         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
2746         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
2747         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
2748         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
2749         Use PTR_DEMANGLE for B0 if defined.
2751 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
2753         * pthread_create.c (__pthread_create_2_1): Use
2754         THREAD_COPY_POINTER_GUARD if available.
2755         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
2756         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2757         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
2758         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
2759         * sysdeps/x86_64/tls.h: Likewise.
2761 2005-12-15  Roland McGrath  <roland@redhat.com>
2763         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
2765 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
2767         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
2768         sysdeps/generic.
2769         * errno-loc.c: New file.
2771 2005-12-12  Roland McGrath  <roland@redhat.com>
2773         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
2774         adjustments before choosing stack size.  Update minimum stack size
2775         calculation to match allocate_stack change.
2777 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
2779         * allocatestack.c (allocate_stack): Don't demand that there is an
2780         additional full page available on the stack beside guard, TLS, the
2781         minimum stack.
2783 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
2785         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2786         (__cleanup_fct_attribute): Use __regparm__ not regparm.
2788         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
2789         compiling 32-bit code we must define __cleanup_fct_attribute.
2791 005-11-24  Jakub Jelinek  <jakub@redhat.com>
2793         [BZ #1920]
2794         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
2795         __attribute__ instead of __attribute.
2796         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2797         (__cleanup_fct_attribute): Likewise.
2799 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
2801         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
2802         a write barrier before writing libgcc_s_getcfa.
2804 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
2806         * sysdeps/unix/sysv/linux/configure: Removed.
2808 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
2810         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
2811         optional init_array/fini_array support.
2813 2005-10-24  Roland McGrath  <roland@redhat.com>
2815         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
2816         versioned_symbol use.
2818 2005-10-16  Roland McGrath  <roland@redhat.com>
2820         * init.c (__pthread_initialize_minimal_internal): Even when using a
2821         compile-time default stack size, apply the minimum that allocate_stack
2822         will require, and round up to page size.
2824 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
2826         * Makefile ($(test-modules)): Remove static pattern rule.
2828 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2829             Ulrich Drepper  <drepper@redhat.com>
2831         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
2832         alignment in callback function.
2833         * Makefile: Add rules to build and run tst-align3.
2834         * tst-align3.c: New file.
2836 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
2838         * allocatestack.c (setxid_signal_thread): Add
2839         INTERNAL_SYSCALL_DECL (err).
2841 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
2843         * allocatestack.c (setxid_signal_thread): Need to use
2844         atomic_compare_and_exchange_bool_acq.
2846 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
2847             Jakub Jelinek  <jakub@redhat.com>
2849         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
2850         CANCEL_RESTMASK.
2851         (struct pthread): Move specific_used field to avoid padding.
2852         Add setxid_futex field.
2853         * init.c (sighandler_setxid): Reset setxid flag and release the
2854         setxid futex.
2855         * allocatestack.c (setxid_signal_thread): New function.  Broken
2856         out of the bodies of the two loops in __nptl_setxid.  For undetached
2857         threads check whether they are exiting and if yes, don't send a signal.
2858         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
2859         * pthread_create.c (start_thread): For undetached threads, check
2860         whether setxid bit is set.  If yes, wait until signal has been
2861         processed.
2863         * allocatestack.c (STACK_VARIABLES): Initialize them.
2864         * pthread_create.c (__pthread_create_2_1): Initialize pd.
2866 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
2868         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
2869         waiters, awake all waiters on the associated mutex.
2871 2005-09-22  Roland McGrath  <roland@redhat.com>
2873         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
2874         ../sysdeps/x86_64/hp-timing.h).
2876 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
2878         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
2879         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2880         (lll_futex_wake_unlock): Define.
2881         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
2882         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2883         (lll_futex_wake_unlock): Define.
2884         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
2885         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2886         (lll_futex_wake_unlock): Define.
2887         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
2888         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2889         (lll_futex_wake_unlock): Define.
2890         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
2891         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2892         (lll_futex_wake_unlock): Define.
2893         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
2894         lll_futex_wake_unlock.
2895         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2896         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2897         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2898         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2899         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2900         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2902 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2904         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2905         Fix typo in register name.
2907 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
2909         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2910         Use __sigfillset.  Document that sigfillset does the right thing wrt
2911         to SIGSETXID.
2913 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
2915         [BZ #1102]
2916         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
2917         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
2918         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
2919         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
2920         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
2921         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
2922         in the structure.
2923         * Makefile (tests): Add tst-initializers1.
2924         (CFLAGS-tst-initializers1.c): Set.
2925         * tst-initializers1.c: New test.
2927 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
2929         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
2930         Make sure __flags are located at offset 48 from the start of the
2931         structure.
2933 2005-07-02  Roland McGrath  <roland@redhat.com>
2935         * Makeconfig: Comment fix.
2937 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
2939         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
2940         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
2941         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
2942         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
2943         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
2944         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2945         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
2946         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
2947         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
2948         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
2950 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
2952         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
2953         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2954         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
2955         fields.
2956         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2957         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
2958         field.  Put in sysinfo field unconditionally.
2959         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2960         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
2961         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2962         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
2963         fields.
2964         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2965         * pthread_create.c (__pthread_create_2_1): Use
2966         THREAD_COPY_STACK_GUARD macro.
2967         * Makefile: Add rules to build and run tst-stackguard1{,-static}
2968         tests.
2969         * tst-stackguard1.c: New file.
2970         * tst-stackguard1-static.c: New file.
2972 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
2974         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2975         Invoke CGOTSETUP and CGOTRESTORE.
2976         (CGOTSETUP, CGOTRESTORE): Define.
2978 2005-05-29  Richard Henderson  <rth@redhat.com>
2980         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
2981         (tf_write, tf_writev): Use it.
2982         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
2983         the system minimum.
2985 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
2987         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2988         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
2989         __librt_*_asynccancel@local.
2991 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
2993         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
2994         all occurrences of JUMPTARGET.  Instead append @local to labels.
2996 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
2998         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
2999         size/alignment of struct pthread rather than tcbhead_t.
3000         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3001         Likewise.
3002         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3003         Likewise.
3004         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3005         Likewise.
3007 2005-05-19  Richard Henderson  <rth@redhat.com>
3009         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3010         __sync_val_compare_and_swap, not explicit _si variant.
3011         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3013 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3015         [BZ #915]
3016         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3018 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3020         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3021         .eh_frame section, use cfi_* directives.
3023 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3025         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3026         of "" includes.
3028 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3030         [BZ #1075]
3031         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3032         aio_write blocks.
3034 2005-04-27  Roland McGrath  <roland@redhat.com>
3036         * Makefile (tests): Remove tst-clock2.
3038         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3039         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3040         translating to the kernel clockid_t for our own process/thread clock.
3042         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3044 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3046         * old_pthread_cond_init.c: Include <errno.h>.
3047         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3048         process shared or uses clock other than CLOCK_REALTIME.
3049         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3051 2005-04-13  David S. Miller  <davem@davemloft.net>
3053         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3054         * sysdeps/sparc/sparc64/clone.S: New file.
3056 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3058         [BZ #1102]
3059         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3060         __inline instead of inline.
3061         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3063 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3065         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3066         functionally equivalent, but shorter instructions.
3067         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3068         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3069         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3070         Likewise.
3071         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3072         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3073         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3074         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3075         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3076         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3077         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3078         Likewise.
3079         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3080         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3081         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3082         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3083         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3085 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3087         * sysdeps/mips/Makefile: New file.
3088         * sysdeps/mips/nptl-sysdep.S: New file.
3089         * sysdeps/mips/tcb-offsets.sym: New file.
3090         * sysdeps/mips/pthread_spin_lock.S: New file.
3091         * sysdeps/mips/pthread_spin_trylock.S: New file.
3092         * sysdeps/mips/pthreaddef.h: New file.
3093         * sysdeps/mips/tls.h: New file.
3094         * sysdeps/mips/jmpbuf-unwind.h: New file.
3095         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3096         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3097         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3098         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3099         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3100         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3101         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3102         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3103         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3104         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3106 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3108         [BZ #1112]
3109         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3110         variable to scerr.
3112 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3114         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3116 2005-02-25  Roland McGrath  <roland@redhat.com>
3118         * alloca_cutoff.c: Correct license text.
3119         * tst-unload.c: Likewise.
3120         * sysdeps/pthread/allocalim.h: Likewise.
3121         * sysdeps/pthread/pt-initfini.c: Likewise.
3122         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3123         * sysdeps/pthread/bits/sigthread.h: Likewise.
3124         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3125         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3127 2005-02-16  Roland McGrath  <roland@redhat.com>
3129         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3130         Use unsigned int * for ptr_nthreads.
3132 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3134         [BZ #721]
3135         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3136         gcc4.
3138 2005-02-07  Richard Henderson  <rth@redhat.com>
3140         [BZ #787]
3141         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3142         argument.
3144 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3146         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3147         order of arguments in invocation of atomic_add_zero.
3149 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3151         [BZ #737]
3152         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3153         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3154         at least gotntpoff relocation and addition.
3155         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3156         Likewise.
3157         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3158         Likewise.
3159         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3160         Likewise.
3162 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3164         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3165         entry for static tls deallocation fix.
3166         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3167         also contains information whether the memory pointed to is static
3168         TLS or not.
3169         * sysdeps/i386/tls.h: Likewise.
3170         * sysdeps/ia64/tls.h: Likewise.
3171         * sysdeps/powerpc/tls.h: Likewise.
3172         * sysdeps/s390/tls.h: Likewise.
3173         * sysdeps/sh/tls.h: Likewise.
3174         * sysdeps/sparc/tls.h: Likewise.
3175         * sysdeps/x86_64/tls.h: Likewise.
3177 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3179         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3181 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3183         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3184         %esp.
3185         * Makefile (tests): Add tst-align2.
3186         * tst-align2.c: New test.
3187         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3188         -mpreferred-stack-boundary=4.
3190 2004-12-18  Roland McGrath  <roland@redhat.com>
3192         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3193         New file removed withdrawn for the moment.
3195 2004-12-17  Richard Henderson  <rth@redhat.com>
3197         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3198         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3200 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3202         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3203         Increased PTHREAD_STACK_MIN.
3205         * tst-context1.c (stacks): Use bigger stack size.
3207 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3209         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3210         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3212 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3214         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3215         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3216         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3218 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3220         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3222 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3224         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3225         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3227         * tst-getpid1.c: If child crashes, report this first.  Print which
3228         signal.
3230 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3232         * init.c (__pthread_initialize_minimal_internal): Also unblock
3233         SIGSETXID.
3235 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3237         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3238         _POSIX_THREAD_CPUTIME): Define to 0.
3239         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3240         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3241         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3242         __timer_signal_thread_tclk): Remove.
3243         (init_module): Remove their initialization.
3244         (thread_cleanup): Remove their cleanup assertions.
3245         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3246         __timer_signal_thread_tclk): Remove.
3247         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3248         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3249         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3251 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3253         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3254         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3256         * Makefile (tests): Add tst-getpid2.
3257         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3258         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3259         * tst-getpid2.c: New test.
3261 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3263         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3265 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3267         * Makefile (tests): Add tst-getpid1.
3268         * tst-getpid1.c: New file.
3269         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3270         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3272 2004-12-02  Roland McGrath  <roland@redhat.com>
3274         * Makefile (libpthread-nonshared): Variable removed.
3275         ($(objpfx)libpthread_nonshared.a): Target removed.
3276         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3277         These are now handled by generic magic from
3278         libpthread-static-only-routines being set.
3280 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3282         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3283         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3284         _POSIX_THREAD_PRIO_PROTECT): Define.
3285         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3286         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3287         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3289 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3291         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3292         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3293         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3294         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3295         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3296         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3297         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3299 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3301         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3303         * Makefile (libpthread-routines): Add pthread_setschedprio.
3304         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3305         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3306         * pthread_setschedprio.c: New file.
3308 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3310         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3311         * pthread_cancel.c (pthread_create): Likewise.
3313         * Makefile (libpthread-routines): Add vars.
3314         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3315         * init.c (__default_stacksize, __is_smp): Remove.
3316         * vars.c: New file.
3317         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3318         and define a wrapper macro.
3319         (PTHREAD_STATIC_FN_REQUIRE): Define.
3320         * allocatestack.c (__find_thread_by_id): Undefine.
3321         * pthread_create (__pthread_keys): Remove.
3322         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3323         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3324         PTHREAD_STATIC_FN_REQUIRE.
3326 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3328         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3329         parameter to REGISTER macro.
3331 2004-11-17  Roland McGrath  <roland@redhat.com>
3333         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3334         Make sure SIGCANCEL is blocked as well.
3336 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3338         * sysdeps/pthread/setxid.h: New file.
3339         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3340         (struct xid_command): Add forward decl.
3341         (struct pthread_functions): Change return type of __nptl_setxid hook
3342         to int.
3343         * pthreadP.h (__nptl_setxid): Change return type to int.
3344         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3345         calling thread, return its return value and set errno on failure.
3346         * descr.h (struct xid_command): Change id type to long array.
3348         * Makefile: Add rules to build and test tst-setuid1 and
3349         tst-setuid1-static.
3350         * tst-setuid1.c: New test.
3351         * tst-setuid1-static.c: New test.
3353 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3355         * Makefile (tests): Add tst-exit3.
3356         * tst-exit3.c: New test.
3358 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3360         * Makefile (tests): Add tst-exit2.
3361         * tst-exit2.c: New file.
3363 2004-11-09  Roland McGrath  <roland@redhat.com>
3365         [BZ #530]
3366         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3367         here, before calling clone.
3368         * pthread_create.c (start_thread): Don't do it here.
3370 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3372         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3374 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3376         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3377         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3378         assembler warning.
3380 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3382         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3383         if sched_priority is not between minprio and maxprio.
3385 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3387         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3388         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3390         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3391         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3393 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3395         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3396         not-cancelable I/O functions.
3398 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3400         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3401         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3402         make sure 2 is stored in the futex and we looked at the old value.
3403         Fix a few other problems to return the correct value.
3405 2004-10-14  Richard Henderson  <rth@redhat.com>
3407         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3408         make gcc4 happy.
3410 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3412         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3413         of pthread-functions.h and pthreaddef.h.
3414         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3416         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3417         Change __data.__nwaiters from int to unsigned int.
3419         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3420         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3422         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3423         before return type.
3425         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3426         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3428 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3430         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3431         test fails, remove message queue.
3432         (tf_msgsnd): Likewise.
3434 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3436         * tst-clock1.c: Change #ifdef to #if defined.
3437         * tst-clock2.c: Likewise.
3438         * tst-cond11.c: Likewise.
3440         * sysdeps/pthread/timer_create.c (timer_create): Use
3441         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3442         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3443         THREAD_CPUTIME.
3445 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3447         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3448         _POSIX_THREAD_CPUTIME): Define to 0.
3450 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3452         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3453         and _POSIX_THREAD_CPUTIME to zero.
3454         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3455         * tst-barrier2.c: Fix testing for POSIX feature.
3456         * tst-clock1.c: Likewise.
3457         * tst-clock2.c: Likewise.
3458         * tst-cond11.c: Likewise.
3459         * tst-cond4.c: Likewise.
3460         * tst-cond6.c: Likewise.
3461         * tst-flock2.c: Likewise.
3462         * tst-mutex4.c: Likewise.
3463         * tst-mutex9.c: Likewise.
3464         * tst-rwlock12.c: Likewise.
3465         * tst-rwlock4.c: Likewise.
3466         * tst-signal1.c: Likewise.
3467         * tst-spin2.c: Likewise.
3468         * sysdeps/pthread/posix-timer.h: Likewise.
3469         * sysdeps/pthread/timer_create.c: Likewise.
3470         * sysdeps/pthread/timer_routines.c: Likewise.
3472 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3474         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3475         (__lll_mutex_timedlock_wait): Address futex correctly.
3477         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3478         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3479         make sure 2 is stored in the futex and we looked at the old value.
3480         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3481         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3482         which might very well made the code not working at all before.
3483         [BZ #417]
3485 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3487         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3488         allow SIGSETXID to be sent.
3489         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3490         for SIGSETXID to be defined.
3491         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3492         SIGSETXID cannot be blocked.
3494         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3495         Add __extension__ to long long types.
3496         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3497         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3498         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3499         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3500         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3501         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3502         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3504 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3506         * descr.h (struct pthread): Add stopped_start field.
3507         * sysdeps/pthread/createthread.c (create_thread): Set
3508         start_stopped flag in descriptor for new thread appropriately.
3509         * pthread_create.c (start_thread): Only take lock to be stopped on
3510         startup if stopped_start flag says so.
3512 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3514         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3515         is created detached and if yes, do not try to free the stack in case
3516         the thread creation failed.
3517         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3518         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3519         case there has been no error.  [BZ #405]
3521         * pthread_create.c (start_thread): Don't wait for scheduler data
3522         etc to be set at the beginning of the function.  The cancellation
3523         infrastructure must have been set up.  And enable async
3524         cancellation before potentially going to sleep.  [BZ #401]
3526 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3528         * Versions: Remove exports for pthread_set*id_np functions.
3529         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3530         for now.
3531         * Makefile: Don't build pthread_set*id code for now.
3533 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3535         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3536         internal use.
3537         * allocatestack.c (__nptl_setxid): New function.
3538         * descr.h (struct xid_command): Define type.
3539         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3540         (sighandler_setxid): New function.
3541         (__pthread_initialize_minimal): Register sighandler_setxid for
3542         SIGCANCEL.
3543         * pt-allocrtsig.c: Update comment.
3544         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3545         Declare __nptl_setxid.
3546         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3547         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3548         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3549         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3550         and pthread_setresuid_np.
3551         * pthread_setgid_np.c: New file.
3552         * pthread_setuid_np.c: New file.
3553         * pthread_setegid_np.c: New file.
3554         * pthread_seteuid_np.c: New file.
3555         * pthread_setregid_np.c: New file.
3556         * pthread_setreuid_np.c: New file.
3557         * pthread_setresgid_np.c: New file.
3558         * pthread_setresuid_np.c: New file.
3559         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3560         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3561         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3562         and pthread_setresuid_np.
3563         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3564         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3565         pthread_setregid, and pthread_setresgid.
3567 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3569         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3570         ENOMEM when out of memory.
3572 2004-09-10  Roland McGrath  <roland@redhat.com>
3574         [BZ #379]
3575         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3576         code, since we don't try to use the broken CLONE_STOPPED any more.
3577         * pthread_create.c (start_thread): Likewise.
3579 2004-09-15  Richard Henderson  <rth@redhat.com>
3581         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3583 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3585         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3586         (__libc_unwind_longjmp): Delete macro and declare as function.
3587         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3588         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3589         nptl directory.
3590         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3591         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3592         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3594 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3596         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3597         for __USE_XOPEN2K.
3598         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3599         types also for __USE_XOPEN2K.
3600         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3601         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3602         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3603         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3604         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3605         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3606         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3607         [BZ #320]
3609 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3611         * sysdeps/pthread/pthread.h
3612         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3613         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3614         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3615         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3616         [BZ #375]
3618 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3620         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3621         PSEUDO to be used with . prefix.
3623         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3624         Use atomic_increment instead of atomic_exchange_and_add.
3625         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3626         Likewise.
3627         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3628         Likewise.
3629         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3630         Likewise.
3632         * allocatestack.c (allocate_stack): Use atomic_increment_val
3633         instead of atomic_exchange_and_add.
3634         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3635         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3636         Likewise.
3637         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3638         Likewise.
3640         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3641         the initialization function might throw.
3643 2005-09-05  Richard Henderson  <rth@redhat.com>
3645         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3646         Move definition inside libpthread, libc, librt check.  Provide
3647         definition for rtld.
3649 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3651         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3652         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3653         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3654         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3655         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3656         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3657         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3658         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3659         * unwind.c: Use it.
3661         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3662         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3663         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3664         Likewise.
3665         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3666         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3667         this is the last waiter, signal pthread_cond_destroy caller and
3668         avoid using the pthread_cond_t structure after unlock.
3669         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3670         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3671         Read clock type from the least significant bits of __nwaiters instead
3672         of __clock.
3673         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3674         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
3676 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
3678         [BZ #342]
3679         * Makefile (tests): Add tst-cond20 and tst-cond21.
3680         * tst-cond20.c: New test.
3681         * tst-cond21.c: New test.
3682         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3683         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
3684         it unsigned int.
3685         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3686         Likewise.
3687         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3688         (pthread_cond_t): Likewise.
3689         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3690         Likewise.
3691         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3692         Likewise.
3693         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3694         Likewise.
3695         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
3696         (cond_nwaiters): New.
3697         (clock_bits): New.
3698         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
3699         if there are waiters not signalled yet.
3700         Wait until all already signalled waiters wake up.
3701         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
3702         __nwaiters.  If pthread_cond_destroy has been called and this is the
3703         last waiter, signal pthread_cond_destroy caller and avoid using
3704         the pthread_cond_t structure after unlock.
3705         (__pthread_cond_wait): Increment __nwaiters in the beginning,
3706         decrement it when leaving.  If pthread_cond_destroy has been called
3707         and this is the last waiter, signal pthread_cond_destroy caller.
3708         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3709         Likewise.  Read clock type from the least significant bits of
3710         __nwaiters instead of __clock.
3711         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
3712         whether clock ID can be encoded in COND_CLOCK_BITS bits.
3713         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
3714         clock type just from the last COND_CLOCK_BITS bits of value.
3715         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
3716         instead of __clock, just from second bit of condattr's value.
3718 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
3720         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
3721         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
3722         != 64.
3723         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3725 2004-08-15  Roland McGrath  <roland@frob.com>
3727         * pthread_atfork.c: Update copyright terms including special exception
3728         for these trivial files, which are statically linked into executables
3729         that use dynamic linking for the significant library code.
3731 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3733         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
3734         pthread_rwlock_rdlock.
3735         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
3736         Decrease __nr_readers_queued after reacquiring lock.
3737         * sysdeps/pthread/pthread_rwlock_timedrdlock
3738         (pthread_rwlock_timedrdlock): Likewise.
3739         Reported by Bob Cook <bobcook47@hotmail.com>.
3741 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
3743         * tst-rwlock14.c (tf): Read main thread handle from *ARG
3744         before pthread_barrier_wait.
3746 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
3748         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3749         Remove unnecessary exception handling data.
3751 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
3753         [BZ #284]
3754         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
3755         instead of clockid_t.
3757 2004-07-21  Roland McGrath  <roland@redhat.com>
3759         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
3761 2004-07-19  Roland McGrath  <roland@redhat.com>
3763         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
3765 2004-07-02  Roland McGrath  <roland@redhat.com>
3767         * configure: Don't exit.
3769 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3771         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3772         (__pthread_cond_timedwait): Check for invalid nanosecond in
3773         timeout value.
3775 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
3777         * Makefile: Add rules to build and run tst-fini1.
3778         * tst-fini1.c: New file.
3779         * tst-fini1mod.c: New file.
3781 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
3783         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
3784         if no cancellation support is needed.
3785         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3786         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3787         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3788         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3789         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3790         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3791         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3792         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3793         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3795         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
3796         only if not already defined.
3798 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
3800         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
3801         constraint "m" instead of "0" for futex.
3803         * shlib-versions: Add powerpc64-.*-linux.*.
3805 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
3807         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
3808         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
3809         for valid tv_nsec.
3810         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
3811         1 billion and 64-bit tv_nsec which is valid when truncated to 32
3812         bits.
3814 2004-06-29  Roland McGrath  <roland@redhat.com>
3816         * Banner: NPTL no longer has its own version number.
3817         * Makefile (nptl-version): Variable removed.
3818         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
3819         using $(version), the glibc version number.
3821 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3823         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
3824         Fix branch offset for a PLT entry.
3825         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
3826         Likewise.
3827         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3828         Likewise.
3829         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
3830         Likewise.
3831         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
3832         Likewise.
3834 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3836         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
3837         unconditionally.
3839 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3841         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3842         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
3843         instead of tv_sec.
3844         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
3845         (pthread_rwlock_timedrdlock): Likewise.
3847 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
3849         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
3850         Set __r7 to val, not mutex.
3852 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
3854         * Makefile: Add rules to build tst-rwlock14.
3855         * tst-rwlock14.c: New file.
3857 2004-06-24  Boris Hu  <boris.hu@intel.com>
3859         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
3860         check.
3861         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3863 2004-06-19  Andreas Jaeger  <aj@suse.de>
3865         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
3866         assembler in last patch.
3868 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
3870         * sysdeps/pthread/pthread_cond_timedwait.c
3871         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
3872         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3873         (__pthread_cond_timedwait): Check for invalid nanosecond in
3874         timeout value.
3875         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3876         * tst-cond19.c: New file.
3877         * Makefile: Add rules to build and run tst-cond19.
3879 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
3881         * tst-context1.c (GUARD_PATTERN): Defined.
3882         (tst_context_t): Define struct containing ucontext_t & guard words.
3883         (ctx): Declare as an array of tst_context_t.
3884         (fct): Verify uc_link & guard words are still valid.
3885         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
3887 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3889         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3890         Add __data.__futex field, reshuffle __data.__clock.
3891         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
3892         (__pthread_cond_signal): Increment __futex at the same time as
3893         __wakeup_seq or __total_seq.  Pass address of __futex instead of
3894         address of low 32-bits of __wakeup_seq to futex syscall.
3895         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
3896         (__pthread_cond_wait): Likewise.  Pass __futex value from before
3897         releasing internal lock to FUTEX_WAIT.
3898         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3899         (__pthread_cond_timedwait): Likewise.
3900         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
3901         (FUTEX_CMP_REQUEUE): Define.
3902         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
3903         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
3904         Pass __futex value from before the unlock and __futex address instead
3905         of address of low 32-bits of __wakeup_seq to futex syscall.
3906         Fallback to FUTEX_WAKE all on any errors.
3908 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
3910         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
3911         comment typo.
3912         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
3913         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
3914         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
3915         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
3916         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
3918 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3920         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
3921         Add memory clobber to inline assembly.
3922         (__lll_mutex_trylock): Likewise.
3923         (__lll_mutex_cond_trylock): Likewise.
3925 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3927         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
3928         Pass val argument as 6th system call argument in %r7.
3930 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
3932         * Makefile (tests): Add tst-cond16.
3933         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
3934         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
3935         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3936         Add __data.__futex field, reshuffle __data.__clock.
3937         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
3938         (__pthread_cond_signal): Increment __futex at the same time as
3939         __wakeup_seq or __total_seq.  Pass address of __futex instead of
3940         address of low 32-bits of __wakeup_seq to futex syscall.
3941         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
3942         (__pthread_cond_wait): Likewise.  Pass __futex value from before
3943         releasing internal lock to FUTEX_WAIT.
3944         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
3945         (__pthread_cond_timedwait): Likewise.
3946         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
3947         (FUTEX_CMP_REQUEUE): Define.
3948         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
3949         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
3950         Pass __futex value from before the unlock and __futex address instead
3951         of address of low 32-bits of __wakeup_seq to futex syscall.
3952         Fallback to FUTEX_WAKE all on any errors.
3953         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
3954         Define.
3955         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
3956         internally.  Return non-zero if error, zero if success.
3957         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
3958         Add __data.__futex field, reshuffle __data.__clock.
3959         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
3960         Define.
3961         (lll_futex_requeue): Add val argument, return 1 unconditionally
3962         for the time being.
3963         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3964         Add __data.__futex field, reshuffle __data.__clock.
3965         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
3966         Define.
3967         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
3968         internally.  Return non-zero if error, zero if success.
3969         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3970         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
3971         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
3972         Define.
3973         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
3974         internally.  Return non-zero if error, zero if success.
3975         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3976         Add __data.__futex field, reshuffle __data.__clock.
3977         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
3978         Define.
3979         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
3980         internally.  Return non-zero if error, zero if success.
3981         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3982         Add __data.__futex field, reshuffle __data.__clock.
3983         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3984         Add __data.__futex field, reshuffle __data.__clock.
3985         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
3986         Increment __futex at the same time as __wakeup_seq or __total_seq.
3987         Pass address of __futex instead of address of low 32-bits of
3988         __wakeup_seq to futex syscall.
3989         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
3990         Pass __futex value from before releasing internal lock
3991         to FUTEX_WAIT.
3992         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3993         Likewise.  Avoid unnecessary shadowing of variables.
3994         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
3995         Set __futex to 2 * __total_seq.  Pass __futex value from before the
3996         unlock and __futex address instead of address of low 32-bits of
3997         __wakeup_seq to futex_requeue macro, adjust for new return value
3998         meaning.
3999         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4000         (__pthread_cond_signal): Increment __futex at the same time as
4001         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4002         address of low 32-bits of __wakeup_seq to futex syscall.
4003         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4004         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4005         releasing internal lock to FUTEX_WAIT.
4006         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4007         (__pthread_cond_timedwait): Likewise.
4008         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4009         (FUTEX_CMP_REQUEUE): Define.
4010         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4011         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4012         Pass __futex value from before the unlock and __futex address instead
4013         of address of low 32-bits of __wakeup_seq to futex syscall.
4014         Fallback to FUTEX_WAKE all on any errors.
4016 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4018         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4019         Add nop to align the end of critical section.
4020         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4022 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4024         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4025         Add __broadcast_seq field.
4026         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4027         all waiters as woken with woken_seq and bump broadcast counter.
4028         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4029         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4030         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4031         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4033 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4035         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4036         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4037         Reported by Kaz Kojima.
4039 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4041         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4043 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4045         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4046         __broadcast_seq with bc_seq after acquiring internal lock instead of
4047         before it.
4049 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4051         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4052         compilation.
4053         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4054         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4055         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4056         (pthread_cond_t): Add __data.__broadcast_seq field.
4057         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4058         (FRAME_SIZE): Define.
4059         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4060         Comment typo fixes.
4061         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4062         Define.
4063         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4064         typo fixes.
4065         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4066         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4067         fixes.
4069 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4071         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4072         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4073         Add __broadcast_seq field.
4074         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4075         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4076         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4077         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4078         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4079         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4080         all waiters as woken with woken_seq and bump broadcast counter.
4081         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4082         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4083         __broadcast_seq field.
4084         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4085         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4086         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4087         * pthread_cond_init.c: Initialize __broadcast_seq field.
4088         * Makefile (tests): Add tst-cond17 and tst-cond18.
4089         Add .NOTPARALLEL goal.
4090         * tst-cond16.c: New file.  From Jakub.
4091         * tst-cond17.c: New file.  From Jakub.
4092         * tst-cond18.c: New file.  From Jakub.
4094 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4096         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4097         unwind info.
4099         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4100         Parametrize frame size.  Correct some unwind info.
4101         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4103 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4105         * tst-stack3.c: Note testing functionality beyond POSIX.
4107 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4109         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4110         Change conditional from ifdef to if.
4112 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4114         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4115         SYSDEP_CANCEL_ERROR): Define.
4116         (PSEUDO): Use it.
4118 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4120         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4122 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4124         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4126 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4128         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4129         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4130         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4131         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4133 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4135         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4136         thread has all signals blocked.
4138 2004-04-18  Andreas Jaeger  <aj@suse.de>
4140         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4141         (SEM_VALUE_MAX): Add missing brace.
4143 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4145         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4146         in rt subdir.
4147         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4148         * sysdeps/pthread/tst-mqueue8x.c: New test.
4149         * tst-cancel4.c: Update comment about message queues.
4151         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4152         return it_value { 0, 0 }.
4153         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4154         like SIGEV_SIGNAL.
4155         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4156         assertion for SIGEV_NONE.
4157         (thread_attr_compare): Compare all attributes, not just a partial
4158         subset.
4160 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4162         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4164 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4166         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4167         Just use a plain number.
4168         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4169         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4170         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4171         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4172         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4173         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4174         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4176 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4178         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4179         frame info.
4180         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4182 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4184         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4185         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4186         of calling sigwaitinfo.
4188 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4190         * allocatestack.c (allocate_stack): Set reported_guardsize
4191         unconditionally.
4192         * pthread_getattr_np.c (pthread_getattr_np): Use
4193         reported_guardsize instead of guardsize.
4194         * descr.h (struct pthread): Add reported_guardsize field.
4196 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4198         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4200 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4202         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4204 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4206         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4207         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4208         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4209         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4210         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4211         Define.
4212         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4213         (_POSIX_MESSAGE_PASSING): Define.
4214         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4215         (_POSIX_MESSAGE_PASSING): Define.
4216         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4217         (_POSIX_MESSAGE_PASSING): Define.
4219 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4221         * tst-context1.c (fct): Check whether correct stack is used.
4223 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4225         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4226         matching constraints for asm mem parameters.
4228         * tst-clock2.c (tf): Don't define unless needed.
4230 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4232         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4233         $(gnulib).
4235 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4237         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4238         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4239         * pthreadP.h: Declare __nptl_deallocate_tsd.
4240         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4241         Adjust caller.
4243         * Makefile (tests): Add tst-tsd5.
4244         * tst-tsd5.c: New file.
4246 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4248         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4249         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4250         is SHLIB_COMPAT check.
4251         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4252         (__pthread_attr_getaffinity_old): Likewise.
4253         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4254         (__pthread_getaffinity_old): Likewise.
4255         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4256         (__pthread_setaffinity_old): Likewise.
4258 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4260         * allocatestack.c (_make_stacks_executable): Call
4261         _dl_make_stack_executable first.
4263 2004-03-24  Roland McGrath  <roland@redhat.com>
4265         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4266         constraint instead of "0".
4268 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4270         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4271         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4273         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4274         code to avoid warning.
4276 2004-03-24  Andreas Jaeger  <aj@suse.de>
4278         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4279         (__pthread_attr_setaffinity_old): Remove const.
4281 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4283         * sysdeps/unix/sysv/linux/smp.h: New file.
4284         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4285         * init.c: Define __is_smp.
4286         (__pthread_initialize_minimal_internal): Call is_smp_system to
4287         initialize __is_smp.
4288         * pthreadP.h: Declare __is_smp.
4289         Define MAX_ADAPTIVE_COUNT is necessary.
4290         * pthread_mutex_init.c: Add comment regarding __spins field.
4291         * pthread_mutex_lock.c: Implement adaptive mutex type.
4292         * pthread_mutex_timedlock.c: Likewise.
4293         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4294         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4295         Add __spins field.
4296         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4297         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4298         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4299         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4300         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4301         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4302         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4303         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4304         lll_mutex_cond_trylock.
4305         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4306         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4307         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4308         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4309         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4310         Define BUSY_WAIT_NOP.
4311         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4312         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4314         * tst-mutex5.c: Add support for testing adaptive mutexes.
4315         * tst-mutex7.c: Likewise.
4316         * tst-mutex5a.c: New file.
4317         * tst-mutex7a.c: New file.
4318         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4320         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4321         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4322         vgettimeofday call might destroy the content.
4324         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4325         @pause in the loop.
4327         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4328         No need to restrict type of ret.  Make it int.  Add comment.
4330         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4331         Remove unnecessary setne instruction.
4333 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4335         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4336         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4337         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4338         If realloc fails, break out of the loop.
4340 2004-03-20  Andreas Jaeger  <aj@suse.de>
4342         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4343         (__pthread_setaffinity_old): Fix interface.
4344         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4345         (__pthread_getaffinity_old): Likewise.
4347         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4348         (__pthread_setaffinity_new): Remove duplicate declaration.
4350 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4352         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4353         the return value to a safe register.
4354         (CDISABLE): Set the function argument correctly.
4356 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4358         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4359         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4360         Rewrite so that only one locked memory operation per round is needed.
4361         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4362         (pthread_barrier_wait): After wakeup, release lock only when the
4363         last thread stopped using the barrier object.
4364         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4365         (__pthread_cond_wait): Don't store mutex address if the current
4366         value is ~0l.  Add correct cleanup support and unwind info.
4367         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4368         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4369         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4370         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4371         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4372         Add correct cleanup support and unwind info.
4373         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4374         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4375         information for syscall wrappers.
4377 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4379         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4380         cpusetsize field, remove next.
4381         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4382         parameter for size of the CPU set.
4383         (pthread_setaffinity_np): Likewise.
4384         (pthread_attr_getaffinity_np): Likewise.
4385         (pthread_attr_setaffinity_np): Likewise.
4386         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4387         interface change, keep compatibility code.
4388         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4389         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4390         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4391         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4392         __pthread_getaffinity_np.
4393         * Versions: Add version for changed interfaces.
4394         * tst-attr3.c: Adjust test for interface change.
4395         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4396         increasing buffer sizes.
4397         * pthread_attr_destroy.c: Remove unused list handling.
4398         * pthread_attr_init.c: Likewise.
4400 2004-03-17  Roland McGrath  <roland@redhat.com>
4402         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4403         first argument to clock_getres so we ever enable kernel timers.
4405 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4407         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4409 2004-03-12  Richard Henderson  <rth@redhat.com>
4411         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4412         oldvalue from CENABLE to CDISABLE.
4414 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4416         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4417         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4418         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4419         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4421 2004-03-11  Richard Henderson  <rth@redhat.com>
4423         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4424         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4425         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4427 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4429         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4430         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4431         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4433 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4435         * forward.c (__pthread_cond_broadcast_2_0,
4436         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4437         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4438         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4440 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4442         * sysdeps/sh/tcb-offsets.sym: Add PID.
4443         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4444         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4446 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4448         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4449         include <sysdep-cancel.h>, vfork is no cancellation point.
4450         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4451         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4452         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4454 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4456         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4457         libc_hidden_def.
4458         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4459         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4460         Likewise.
4461         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4462         Likewise.
4463         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4464         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4465         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4466         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4467         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4469         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4470         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4471         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4472         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4473         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4474         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4476         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4477         a local register for saving old PID.  Negate PID in parent upon exit.
4479         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4480         tcb-offsets.h.
4481         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4482         before syscall, set to the old value in the parent afterwards.
4483         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4484         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4485         tcb-offsets.h.
4486         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4487         before syscall, set to the old value in the parent afterwards.
4488         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4489         * sysdeps/s390/tcb-offsets.sym: Add PID.
4491         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4492         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4493         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4494         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4495         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4496         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4498 2004-03-10  Andreas Schwab  <schwab@suse.de>
4500         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4501         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4502         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4504 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4506         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4507         * tst-cancel21.c (do_one_test): Likewise.
4508         Reported by Gordon Jin <gordon.jin@intel.com>.
4510 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4512         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4513         if non-zero and set to INT_MIN if zero.
4514         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4515         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4516         (SAVE_PID, RESTORE_PID): Define.
4517         (__vfork): Use it.
4518         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4519         Use relative path to avoid including NPTL i386/vfork.S.
4520         (SAVE_PID, RESTORE_PID): Define.
4521         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4522         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4523         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4524         tst-vfork2x.
4525         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4526         * tst-vfork1.c: New test.
4527         * tst-vfork2.c: New test.
4528         * tst-vfork1x.c: New test.
4529         * tst-vfork2x.c: New test.
4531 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4533         * sysdeps/i386/tcb-offsets.sym: Add PID.
4534         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4535         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4536         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4538 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4540         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4542 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4544         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4545         _rtld_global_ro.
4547 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4549         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4550         _rtld_global_ro.
4552         * tst-once4.c: Remove unnecessary macro definition.
4554         * tst-mutex7.c (do_test): Limit thread stack size.
4555         * tst-once2.c (do_test): Likewise.
4556         * tst-tls3.c (do_test): Likewise.
4557         * tst-tls1.c (do_test): Likewise.
4558         * tst-signal3.c (do_test): Likewise.
4559         * tst-kill6.c (do_test): Likewise.
4560         * tst-key4.c (do_test): Likewise.
4561         * tst-join4.c (do_test): Likewise.
4562         * tst-fork1.c (do_test): Likewise.
4563         * tst-context1.c (do_test): Likewise.
4564         * tst-cond2.c (do_test): Likewise.
4565         * tst-cond10.c (do_test): Likewise.
4566         * tst-clock2.c (do_test): Likewise.
4567         * tst-cancel10.c (do_test): Likewise.
4568         * tst-basic2.c (do_test): Likewise.
4569         * tst-barrier4.c (do_test): Likewise.
4571 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4573         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4575 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4577         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4578         (__pthread_cond_timedwait): Optimize wakeup test.
4579         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4580         (__pthread_cond_wait): Likewise.
4581         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4582         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4583         Likewise.
4585 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4587         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4588         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4589         the atomic instruction needed.
4590         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4591         (__lll_mutex_lock_wait): Likewise.
4593 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4595         * Makefile (tests): Add tst-cond14 and tst-cond15.
4596         * tst-cond14.c: New file.
4597         * tst-cond15.c: New file.
4599 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4601         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4602         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4603         needs to be implemented differently to be useful.
4605 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4607         * pthread_attr_setschedparam.c: Don't test priority against limits
4608         here.  Set ATTR_FLAG_SCHED_SET flag.
4609         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4610         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4611         from parent thread to child.  If attribute is used and scheduling
4612         parameters are not inherited, copy parameters from attribute or
4613         compute them.  Check priority value.
4614         * pthread_getschedparam.c: If the parameters aren't known yet get
4615         them from the kernel.
4616         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4617         ATTR_FLAG_POLICY_SET flag for thread.
4618         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4619         and ATTR_FLAG_POLICY_SET.
4621         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4623         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4624         fail if stack address hasn't been set.  Just return 0.
4626 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4628         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4629         libpthread for the files in this list.
4630         (CFLAGS-tst-unload): Removed.
4631         * tst-unload.c (do_test): Don't use complete path for
4632         LIBPHREAD_SO.
4634         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4635         tst-_res1mod2.
4637 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4639         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4640         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4641         operation per round is needed.
4642         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4643         (__lll_mutex_lock_wait): Likewise.
4645 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4647         * tst-cancel9.c (cleanup): Don't print to stderr.
4649 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4651         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4653 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4655         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4656         (__syscall_error_handler2): Call CDISABLE.
4657         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4658         (__syscall_error_handler2): Call CDISABLE.
4660         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4661         Release lock before the loop, don't reacquire it.
4663         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4665 2004-02-19  Andreas Schwab  <schwab@suse.de>
4667         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4668         Fix last change.
4670 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
4672         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4673         (pthread_barrier_wait): After wakeup, release lock only when the
4674         last thread stopped using the barrier object.
4675         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
4676         (pthread_barrier_wait): Likewise.
4677         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4678         Likewise.
4679         * Makefile (tests): Add tst-barrier4.
4680         * tst-barrier4.c: New file.
4682         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4683         (__pthread_cond_timedwait): Perform timeout test while holding
4684         internal lock to prevent wakeup race.
4685         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4686         * sysdeps/pthread/pthread_cond_timedwait.c
4687         (__pthread_cond_timedwait): Likewise.
4688         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4689         (__pthread_cond_timedwait): Likewise.
4691 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
4693         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
4694         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
4695         * Makefile (tests): Add tst-rwlock13.
4696         * tst-rwlock13.c: New test.
4698 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
4700         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4701         (__condvar_tw_cleanup): Little optimization.
4702         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4704 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
4706         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
4707         libpthread as "lib" parameter to SHLIB_COMPAT.
4708         (__novmx_siglongjmp): Fix typo in function name.
4709         (__novmx_longjmp): Fix typo in function name.
4711 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4713         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
4714         __builtin_expect.
4716         * sysdeps/generic/pt-longjmp.c: Moved to...
4717         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
4719 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
4721         * Makefile (libpthread-routines): Add pt-cleanup.
4722         * pt-longjmp.c: Removed.
4723         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
4724         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
4725         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
4726         Version longjmp, siglongjmp for GLIBC_2.3.4.
4727         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
4729 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4731         * sysdeps/pthread/pthread_cond_timedwait.c
4732         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
4733         Reuse code.  Add __builtin_expects.
4735         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4736         (__pthread_cond_timedwait): Get internal lock in case timeout has
4737         passed before the futex syscall.
4738         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4740 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
4742         * allocatestack.c: Pretty printing.
4744         * sysdeps/pthread/createthread.c (create_thread): Don't add
4745         CLONE_DETACHED bit if it is not necessary.
4747 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
4749         * pthread_getattr_np.c: Include ldsodefs.h.
4751 2004-01-16  Richard Henderson  <rth@redhat.com>
4753         * allocatestack.c: Don't declare __libc_stack_end.
4754         * init.c (__pthread_initialize_minimal_internal): Likewise.
4755         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
4757 2004-01-15  Richard Henderson  <rth@redhat.com>
4759         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
4760         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
4761         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
4762         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
4763         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
4764         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
4765         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
4766         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
4768 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
4770         * init.c (pthread_functions): Make array const.
4772 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
4774         * allocatestack.c (__make_stacks_executable): Change interface.
4775         Check parameters.  Pass parameter on to libc counterpart.
4776         * pthreadP.h: Change declaration.
4778 2004-01-13  Richard Henderson  <rth@redhat.com>
4780         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
4781         prototype form.
4782         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
4783         Likewise.
4785         * sysdeps/alpha/Makefile: New file.
4786         * sysdeps/alpha/tcb-offsets.sym: New file.
4787         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4788         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
4790         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
4791         on powerpc version.
4793 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
4795         * Makefile (tests): Add tst-backtrace1.
4796         * tst-backtrace1.c: New test.
4798 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
4800         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
4801         register as second parameter to the REGISTER macro.
4802         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
4803         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
4804         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
4805         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
4806         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
4807         of thread register as second parameter to REGISTER macro in 64 case.
4809 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
4811         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
4812         (CFLAGS-getpid.o): Defined.
4813         (CFLAGS-getpid.os): Defined.
4815 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
4817         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
4818         returned for main thread does not overlap with any other VMA.
4819         Patch by Jakub Jelinek.
4821 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
4823         * tst-raise1.c: Include stdio.h.
4825 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
4827         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
4828         setting with __ASSUME_TGKILL || defined __NR_tgkill.
4829         If pid is 0, set it to selftid.
4830         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
4831         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
4832         != 0, return self->tid without doing a syscall.
4833         * descr.h (struct pthread): Move pid field after tid.
4835         * Makefile (tests): Add tst-raise1.
4836         * tst-raise1.c: New file.
4838 2003-12-23  Roland McGrath  <roland@redhat.com>
4840         * tst-oddstacklimit.c: New file.
4841         * Makefile (tests): Add it.
4842         (tst-oddstacklimit-ENV): New variable.
4844         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
4845         value up to page size for __default_stacksize.
4847 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
4849         * Makefile (tests): Add tst-eintr5.
4850         * tst-eintr5.c: New file.
4852         * eintr.c (eintr_source): Prevent sending signal to self.
4854         * tst-eintr2.c (tf1): Improve error message.
4856 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
4858         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
4859         * sysdeps/unix/sysv/linux/getpid.c: New file.
4860         * pthread_cancel.c: Add comment explaining use of PID field.
4861         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4862         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
4863         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
4864         temporarily to signal the field must not be relied on and updated
4865         by getpid().
4866         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
4867         temporarily negative.
4868         * sysdeps/unix/sysv/linux/raise.c: Likewise.
4870 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
4872         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
4873         (eintr_source): If ARG != NULL, use pthread_kill.
4874         * tst-eintr1.c: Adjust for this change.
4875         * tst-eintr2.c: Likewise.
4876         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
4877         * tst-eintr3.c: New file.
4878         * tst-eintr4.c: New file.
4880 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
4882         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
4883         if CANCELSTATE_BITMASK is set.
4884         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
4885         Likewise.
4887         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
4888         (tests-reverse): Add tst-cancel23.
4889         * tst-cancel22.c: New test.
4890         * tst-cancel23.c: New test.
4892 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
4894         * tst-eintr1.c: Better error messages.
4896         * Makefile (tests): Add tst-eintr2.
4897         * tst-eintr2.c: New file.
4899 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
4901         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
4902         (CFLAGS-tst-cancelx21.c): Set.
4903         * tst-cancel21.c: New test.
4904         * tst-cancelx21.c: New test.
4906         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
4907         comparison operand.
4908         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
4909         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
4910         * pt-longjmp.c: Include jmpbuf-unwind.h.
4911         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
4912         _JMPBUF_UNWINDS.  Adjust compared pointers.
4913         * init.c (__pthread_initialize_minimal_internal): Initialize
4914         pd->stackblock_size.
4915         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
4916         * sysdeps/alpha/jmpbuf-unwind.h: New file.
4917         * sysdeps/i386/jmpbuf-unwind.h: New file.
4918         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
4919         * sysdeps/s390/jmpbuf-unwind.h: New file.
4920         * sysdeps/sh/jmpbuf-unwind.h: New file.
4921         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
4922         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
4923         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
4924         (_JMPBUF_CFA_UNWINDS): Remove.
4925         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
4927 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
4929         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
4930         (CFLAGS-tst-cancelx20.c): Set.
4931         * tst-cancel20.c: New test.
4932         * tst-cancelx20.c: New test.
4934 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
4936         * init.c (__pthread_initialize_minimal_internal): Don't treat
4937         architectures with separate register stack special here when
4938         computing default stack size.
4940 2003-12-17  Roland McGrath  <roland@redhat.com>
4942         * Makefile (tst-cancelx7-ARGS): New variable.
4943         Reportd by Greg Schafer <gschafer@zip.com.au>.
4945 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
4947         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
4948         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
4949         (tst-stack3-ENV): Set.
4950         ($(objpfx)tst-stack3-mem): New.
4951         * tst-stack3.c: New test.
4953 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
4955         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
4956         Add unwind directives.  Drop unused .regstk directive.
4957         (_fini_EPILOG_BEGINS): Add unwind directives.
4959 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
4961         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
4962         Assume parameter is a pointer.
4963         (lll_futex_wake): Likewise.
4964         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
4965         Likewise.
4966         (lll_futex_wake): Likewise.
4967         Reported by Boris Hu.
4968         * sysdeps/unix/sysv/linux/unregister-atfork.c
4969         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
4971         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
4973 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
4975         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
4976         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
4977         __rtld_lock_initialize for ld.so lock.
4978         Patch in part by Adam Li <adam.li@intel.com>.
4980 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
4982         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
4983         in $(gnulib).  Also, remove stale comment.
4985 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
4987         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
4988         advantage of new syscall stub and optimize accordingly.
4990         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
4991         from SYS_futex, to match expectations of
4992         sysdep.h:DO_INLINE_SYSCALL.
4993         (lll_futex_clobbers): Remove.
4994         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
4995         (lll_futex_wake): Likewise.
4996         (lll_futex_requeue): Likewise.
4997         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
4998         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
4999         Jelinek).
5000         (__lll_mutex_lock): Likewise.
5001         (__lll_mutex_cond_lock): Likewise.
5002         (__lll_mutex_timed_lock): Likewise.
5003         (__lll_mutex_unlock): Likewise.
5004         (__lll_mutex_unlock_force): Likewise.
5006         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5007         comes before the include of <sysdep.h>.
5008         (THREAD_SELF_SYSINFO): New macro.
5009         (THREAD_SYSINFO): Likewise.
5010         (INIT_SYSINFO): New macro.
5011         (TLS_INIT_TP): Call INIT_SYSINFO.
5013         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5015         * sysdeps/pthread/createthread.c (create_thread): Use
5016         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5017         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5018         THREAD_SELF_SYSINFO instead of open code.
5019         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5020         (THREAD_SYSINFO): Likewise.
5022         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5024         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5026 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5028         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5029         instead of .init.  Patch by David Mosberger.
5031 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5033         * sysdeps/pthread/configure.in: Remove broken declaration in C
5034         cleanup handling check.
5036 2003-11-30  Andreas Jaeger  <aj@suse.de>
5038         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5039         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5040         Likewise.
5042 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5044         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5045         * pthread_attr_destroy.c: Include shlib-compat.h.
5046         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5047         is set in iattr->flags.
5048         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5050 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5052         * Makefile (distribute): Add tst-cleanup4aux.c.
5054         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5055         include.
5057 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5059         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5060         pthread_cond_signal.
5062         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5063         store mutex address if the current value is ~0l.
5064         * sysdeps/pthread/pthread_cond_timedwait.c
5065         (__pthread_cond_timedwait): Likewise.
5066         * sysdeps/pthread/pthread_cond_broadcast.c
5067         (__pthread_cond_broadcast): Don't use requeue for pshared
5068         condvars.
5070         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5071         (__pthread_cond_wait): Don't store mutex address if the current
5072         value is ~0l.
5073         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5074         (__pthread_cond_timedwait): Likewise.
5075         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5076         (__pthread_cond_broadcast): Don't use requeue for pshared
5077         condvars.
5079         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5080         element with ~0l for pshared condvars, with NULL otherwise.
5082         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5083         (__pthread_cond_wait): Don't store mutex address if the current
5084         value is ~0l.
5085         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5086         (__pthread_cond_timedwait): Likewise.
5087         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5088         (__pthread_cond_broadcast): Don't use requeue for pshared
5089         condvars.
5091         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5092         * tst-cond12.c: New file.
5093         * tst-cond13.c: New file.
5095 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5097         * sysdeps/pthread/configure.in: Make missing forced unwind support
5098         fatal.
5100 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5102         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5104 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5106         * Makefile: Add magic to clean up correctly.
5108 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5110         * unwind.c (FRAME_LEFT): Define.
5111         (unwind_stop): Handle old style cleanups here.
5112         (__pthread_unwind): Handle old style cleanups only if
5113         !HAVE_FORCED_UNWIND.
5114         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5115         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5116         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5117         ($(objpfx)tst-cleanupx4): Likewise.
5118         * tst-cleanup4.c: New test.
5119         * tst-cleanup4aux.c: New.
5120         * tst-cleanupx4.c: New test.
5122 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5124         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5125         lll_mutex_*lock macros to skip atomic operations on some archs.
5127 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5129         * sysdeps/pthread/tst-timer.c (main): Initialize
5130         sigev2.sigev_value as well.
5132 2003-10-15  Roland McGrath  <roland@redhat.com>
5134         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5135         is missing.
5136         * sysdeps/pthread/configure: Regenerated.
5138 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5140         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5141         locking macros.  No distinction between normal and mutex locking
5142         anymore.
5143         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5144         Merge bits from lowlevelmutex.S we still need.
5145         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5146         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5147         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5148         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5149         new mutex implementation.
5150         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5151         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5152         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5153         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5154         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5155         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5156         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5157         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5158         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5159         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5160         symbol for entry point to avoid cancellation.
5162 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5164         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5165         changes.
5166         (SAVE_OLDTYPE_0): Fix a typo.
5168 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5170         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5171         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5173 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5175         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5176         correct offset.
5178 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5180         * Makefile (tests): Add tst-cancel19.
5181         * tst-cancel19.c: New test.
5183 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5185         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5186         restoring of the old cancellation type.
5188 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5190         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5192 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5194         * sysdeps/pthread/malloc-machine.h: New file
5196 2003-09-24  Roland McGrath  <roland@redhat.com>
5198         * allocatestack.c (__make_stacks_executable): Don't ignore return
5199         value from _dl_make_stack_executable.
5201 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5203         * allocatestack.c (__make_stacks_executable): Also change
5204         permission of the currently unused stacks.
5206         * allocatestack.c (change_stack_perm): Split out from
5207         __make_stacks_executable.
5208         (allocate_stack): If the required permission changed between the time
5209         we started preparing the stack and queueing it, change the permission.
5210         (__make_stacks_executable): Call change_stack_perm.
5212         * Makefile: Build tst-execstack-mod locally.
5213         * tst-execstack-mod.c: New file.
5215 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5217         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5219 2003-09-23  Roland McGrath  <roland@redhat.com>
5221         * tst-execstack.c: New file.
5222         * Makefile (tests): Add it.
5223         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5224         (LDFLAGS-tst-execstack): New variable.
5226         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5227         whether to use PROT_EXEC for stack mmap.
5228         (__make_stacks_executable): New function.
5229         * pthreadP.h: Declare it.
5230         * init.c (__pthread_initialize_minimal_internal): Set
5231         GL(dl_make_stack_executable_hook) to that.
5233 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5235         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5236         recommendation from AMD re avoidance of lock prefix.
5238 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5240         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5241         lll_futex_timed_wait instead of lll_futex_wait.
5242         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5243         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5244         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5245         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5246         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5247         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5248         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5249         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5250         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5251         Completely revamp the locking macros.  No distinction between
5252         normal and mutex locking anymore.
5253         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5254         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5255         __lll_lock_timedwait): Fix prototypes.
5256         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5257         __lll_lock_timedwait): Likewise.
5258         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5259         macros, add __builtin_expect.
5260         (lll_mutex_timedlock): Likewise.  Fix return value.
5261         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5262         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5263         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5264         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5265         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5266         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5267         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5268         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5270 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5272         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5273         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5274         operation if possible.
5276         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5277         like jumping over the lock prefix.
5279 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5281         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5282         locking macros.  No distinction between normal and mutex locking
5283         anymore.
5284         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5285         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5286         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5287         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5288         locking.  Merge bits from lowlevelmutex.S we still need.
5289         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5290         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5291         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5292         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5293         * Makefile (routines): Remove libc-lowlevelmutex.
5294         (libpthread-rountines): Remove lowlevelmutex.
5295         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5296         for new mutex implementation.
5297         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5298         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5299         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5300         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5301         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5302         Likewise.
5303         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5304         Likewise.
5305         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5306         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5307         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5308         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5309         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5310         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5311         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5312         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5313         Likewise.
5314         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5315         Likewise.
5316         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5317         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5318         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5319         Don't use requeue.
5320         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5321         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5323 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5325         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5326         in parameters of asm with output parameters.
5328         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5329         type of DECR parameter to int.
5330         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5332 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5334         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5335         guardsize for each thread.
5337 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5339         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5340         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5341         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5343         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5344         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5345         NULL.
5346         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5347         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5348         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5349         (pthread_getaffinity_np): Add hidden_def.
5351         * Makefile (tests): Add tst-attr3.
5352         * tst-attr3.c: New test.
5354         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5356 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5358         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5359         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5361 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5363         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5364         * tst-align.c: Include tst-stack-align.h.
5365         (tf, do_test): Use TEST_STACK_ALIGN macro.
5367 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5369         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5370         variable.
5372 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5374         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5375         stack-related values for the initial thread.
5377 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5379         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5381 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5383         * pthread_mutex_lock.c: Minor code rearrangements.
5385 2003-09-05  Roland McGrath  <roland@redhat.com>
5387         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5388         Instead, include ../nptl_db/db_info.c to do its magic.
5389         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5390         (__pthread_pthread_key_2ndlevel_size): Likewise.
5391         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5392         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5393         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5394         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5395         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5396         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5397         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5398         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5399         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5400         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5401         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5402         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5403         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5404         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5405         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5406         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5407         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5409 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5411         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5412         of pthread_t to be compatible with LT.
5413         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5414         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5415         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5416         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5417         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5418         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5419         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5421 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5423         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5425 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5427         * unwind-forcedunwind.c: Move to...
5428         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5429         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5430         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5431         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5432         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5433         * unwind.c: Include jmpbuf-unwind.h.
5434         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5436 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5438         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5439         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5440         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5441         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5442         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5443         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5444         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5445         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5446         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5447         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5448         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5449         function.
5450         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5451         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5452         * Makefile (tests): Add tst-stack2.
5453         * tst-stack2.c: New test.
5454         * tst-stack1.c: Include limits.h and sys/param.h.
5455         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5457         * pthread_condattr_setpshared.c: Include errno.h.
5458         (pthread_condattr_setpshared): Return EINVAL if pshared
5459         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5461         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5462         defined symbol for entry point to avoid cancellation.
5463         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5464         Likewise.
5465         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5466         Likewise.
5467         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5468         Likewise.
5469         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5470         Likewise.
5471         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5472         Likewise.
5473         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5474         __close_nocancel, __read_nocancel, __write_nocancel,
5475         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5476         libpthread.so or librt.so, define to corresponding function
5477         without _nocancel suffix.
5478         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5479         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5480         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5482         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5484 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5486         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5487         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5489         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5490         in subsections has a symbol associated with it.
5492         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5493         defined symbol for entry point to avoid cancellation.
5494         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5496 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5498         * Makefile (tests): Add tst-tls5.
5499         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5500         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5501         ($(objpfx)tst-tls5): New.
5502         ($(objpfx)tst-tls6.out): Likewise.
5503         (tests): Depend on $(objpfx)tst-tls6.out.
5504         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5505         (do_test): Check pthread_self () return value alignment.
5506         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5507         (tf): Check pthread_self () return value alignment.
5508         * tst-tls5.c: New test.
5509         * tst-tls5.h: New.
5510         * tst-tls5mod.c: New.
5511         * tst-tls5moda.c: New.
5512         * tst-tls5modb.c: New.
5513         * tst-tls5modc.c: New.
5514         * tst-tls5modd.c: New.
5515         * tst-tls5mode.c: New.
5516         * tst-tls5modf.c: New.
5517         * tst-tls6.sh: New test.
5519         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5520         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5521         * init.c (pthread_functions): Initialize them.
5522         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5523         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5524         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5525         pthread_cond_timedwait@@GLIBC_2.3.2.
5527 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5529         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5530         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5531         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5532         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5533         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5534         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5536         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5538         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5539         _POSIX_THREAD_PRIORITY_SCHEDULING.
5540         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5542 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5544         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5545         nested function, use static inline function from libio.h.
5546         Code by Richard Henderson.
5548         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5549         weak.
5551 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5553         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5554         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5555         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5556         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5557         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5558         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5559         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5560         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5561         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5562         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5563         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5564         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5565         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5566         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5567         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5568         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5569         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5570         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5571         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5572         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5573         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5574         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5575         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5576         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5577         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5578         * sysdeps/sparc/tls.h: New file.
5579         * sysdeps/sparc/tcb-offsets.sym: New file.
5580         * sysdeps/sparc/Makefile: New file.
5581         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5582         * init.c [__sparc__] (__NR_set_tid_address): Define.
5584 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5586         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5587         _IO_release_lock): Define.
5589 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5591         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5592         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5594 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5596         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5597         (__pthread_cleanup_class): Add missing return types of member
5598         functions.
5600 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5602         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5603         (lll_mutex_unlock_force): Add memory barrier between store and futex
5604         syscall.
5606 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5608         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5609         tempmsg in first loop.
5611 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5613         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5614         _POSIX_THREAD_PRIORITY_SCHEDULING.
5615         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5617 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5619         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5620         (__rtld_lock_default_lock_recursive,
5621         __rtld_lock_default_unlock_recursive): Define.
5622         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5623         __rtld_lock_unlock_recursive): Define using
5624         GL(_dl_rtld_*lock_recursive).
5625         * init.c (__pthread_initialize_minimal_internal): Initialize
5626         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5627         Lock GL(_dl_load_lock) the same number of times as
5628         GL(_dl_load_lock) using non-mt implementation was nested.
5630         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5631         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5633 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5635         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5636         PIPE_BUF.
5638 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5640         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5642 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5644         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5645         to first syscall error check.  Move syscall error check for tkill
5646         into __ASSUME_CLONE_STOPPED #ifdef.
5648 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5650         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5651         is not defined, do explicit synchronization.
5652         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5653         is not defined also unlock pd->lock for non-debugging case in case
5654         it is necessary.
5655         * pthread_create.c (start_thread): Always get and release pd->lock
5656         if __ASSUME_CLONE_STOPPED is not defined.
5657         (start_thread_debug): Removed.  Adjust users.
5658         * allocatestack.c (allocate_stack): Always initialize lock if
5659         __ASSUME_CLONE_STOPPED is not defined.
5660         * Makefile (tests): Add tst-sched1.
5661         * tst-sched1.c: New file.
5663         * sysdeps/pthread/createthread.c (do_clone): Only use
5664         sched_setschduler and pass correct parameters.
5666 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5668         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
5669         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
5670         PTHREAD_STACK_MIN in comments.
5672 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5674         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5675         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
5676         argument.
5677         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
5678         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
5679         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
5680         (__pthread_cleanup_upto): Fix prototype.
5681         (_longjmp_unwind): Adjust caller.
5682         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
5683         Change second argument to const struct pointer.
5684         * tst-sem8.c (main): Remove unused s2 and s3 variables.
5685         * tst-sem9.c (main): Likewise.
5686         * unwind.c: Include string.h for strlen prototype.
5688 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
5690         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5691         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
5692         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
5693         Define HAVE_CMOV.
5694         Patch by Nicholas Miell <nmiell@attbi.com>.
5696 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
5698         * init.c (__pthread_initialize_minimal_internal): Initialize
5699         GL(dl_init_static_tls).
5700         * pthreadP.h (__pthread_init_static_tls): New prototype.
5701         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
5702         New functions.
5703         * Makefile (tests): Add tst-tls4.
5704         (modules-names): Add tst-tls4moda and tst-tls4modb.
5705         ($(objpfx)tst-tls4): Link against libdl and libpthread.
5706         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
5707         tst-tls4modb.so.
5708         * tst-tls4.c: New file.
5709         * tst-tls4moda.c: New file.
5710         * tst-tls4modb.c: New file.
5712 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
5714         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
5715         before __timer_dealloc.
5716         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
5717         Don't call list_unlink.
5719 2003-07-29  Roland McGrath  <roland@redhat.com>
5721         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
5723 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
5725         * tst-cancel17.c (do_test): Check if aio_cancel failed.
5726         Don't reuse struct aiocb A if it failed.
5727         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
5728         not just one byte, as that does not block.
5730 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
5732         * sysdeps/pthread/unwind-resume.c: New file.
5733         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
5734         unwind-resume in csu subdir.
5735         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
5736         exceptions.
5737         (librt-sysdep_routines, librt-shared-only-routines): Add
5738         rt-unwind-resume.
5739         * sysdeps/pthread/rt-unwind-resume.c: New file.
5740         * unwind-forcedunwind.c: New file.
5741         * Makefile (libpthread-routines): Add unwind-forcedunwind.
5742         (libpthread-shared-only-routines): Likewise.
5743         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
5744         * pthreadP.h (pthread_cancel_init): New prototype.
5745         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
5747         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
5748         attr argument const struct pthread_attr *.
5750         * res.c (__res_state): Return __resp.
5751         * descr.h: Include resolv.h.
5752         (struct pthread): Add res field.
5753         * pthread_create.c: Include resolv.h.
5754         (start_thread): Initialize __resp.
5755         * Makefile (tests): Add tst-_res1.
5756         (module-names): Add tst-_res1mod1, tst-_res1mod2.
5757         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
5758         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
5759         libpthread.
5760         * tst-_res1.c: New file.
5761         * tst-_res1mod1.c: New file.
5762         * tst-_res1mod2.c: New file.
5764 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
5766         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
5768         * Makefile: Define various *-no-z-defs variables for test DSOs
5769         which has undefined symbols.
5771 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
5773         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
5774         Retry if the stwcx fails to store once_control.
5776 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
5778         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
5779         pthread_attr_setaffinity.
5780         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
5781         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
5782         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
5783         * pthread_attr_destroy.c: Free cpuset element if allocated.
5784         * pthread_create.c: Pass iattr as additional parameter to
5785         create_thread.
5786         * sysdeps/pthread/createthread.c: If attribute is provided and
5787         a new thread is created with affinity set or scheduling parameters,
5788         start thread with CLONE_STOPPED.
5789         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
5790         pthread_attr_setaffinity.
5791         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5792         cpuset element.
5794 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
5796         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
5798 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
5800         * sysdeps/pthread/configure.in: Require CFI directives also for
5801         ppc and s390.
5803 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
5805         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5806         Add cfi directives.
5808 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5810         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
5811         CLEANUP_JMP_BUF.
5812         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
5813         registers as variables.  Call __pthread_mutex_unlock_usercnt.
5814         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5815         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
5816         not self pointer in __writer.  Compare with TID to determine
5817         deadlocks.
5818         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5819         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
5820         Likewise.
5821         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
5822         Likewise.
5823         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
5824         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5825         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
5826         macros also when compiling librt.
5828 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
5830         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
5831         -fasynchronous-unwind-tables.
5832         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
5833         (PSEUDO): Add cfi directives.
5834         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
5835         Likewise.
5836         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5837         Likewise.
5839 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
5841         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
5842         __pthread_unregister_cancel): Add prototypes and hidden_proto.
5843         * unwind.c (__pthread_unwind_next): Add hidden_def.
5844         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
5845         Likewise.
5846         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
5847         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5848         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
5849         Likewise.
5850         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
5851         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
5852         Likewise.
5853         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
5854         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
5855         __pthread_unregister_cancel and __pthread_unwind_next.
5857 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
5859         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
5860         different symbol for the cancellation syscall wrapper and
5861         non-cancellation syscall wrapper.
5862         (PSEUDO_END): Define.
5864 2003-07-05  Richard Henderson  <rth@redhat.com>
5866         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
5867         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
5868         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
5869         return actual return value from the syscall, not 0.
5871 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
5873         * descr.h (struct pthread): Add pid field.
5874         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
5875         (__reclaim_stacks): Likewise.
5876         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
5877         also check for PID of the signal source.
5878         (__pthread_initialize_minimal_internal): Also initialize pid field
5879         of initial thread's descriptor.
5880         * pthread_cancel.c: Use tgkill instead of tkill if possible.
5881         * sysdeps/unix/sysv/linux/fork.c: Likewise.
5882         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
5883         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5884         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5886 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
5888         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
5889         Fix use of parameter.
5890         (__libc_cleanup_pop): Likewise.
5892 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
5894         * init.c (sigcancel_handler): Change parameters to match handler
5895         for SA_SIGACTION.  Check signal number and code to recognize
5896         invalid invocations.
5898 2003-07-03  Roland McGrath  <roland@redhat.com>
5900         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
5901         Apply sizeof (struct pthread) bias to r13 value.
5903 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
5905         * sysdeps/pthread/configure.in: Require CFI directives.
5907         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
5908         definition.
5909         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
5910         libpthread compilation.
5911         * unwind.c (__pthread_unwind): Add hidden_def.
5912         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
5914 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
5916         * libc-cancellation.c (__libc_cleanup_routine): Define.
5917         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
5918         (__pthread_cleanup_pop): Define.
5920 2003-07-01  Richard Henderson  <rth@redhat.com>
5922         * sysdeps/alpha/elf/pt-initfini.c: New file.
5923         * sysdeps/alpha/pthread_spin_lock.S: New file.
5924         * sysdeps/alpha/pthread_spin_trylock.S: New file.
5925         * sysdeps/alpha/pthreaddef.h: New file.
5926         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
5927         * sysdeps/alpha/tls.h: New file.
5928         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
5929         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
5930         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
5931         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
5932         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
5933         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
5934         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
5935         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
5936         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
5937         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
5939 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
5941         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
5942         cleanup support and unwind info.
5944 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
5946         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5947         Use correct cleanup handler registration.  Add unwind info.
5948         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
5949         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
5950         * tst-once3.c: Add cleanup handler and check it is called.
5951         * tst-once4.c: Likewise.
5952         * tst-oncex3.c: New file.
5953         * tst-oncex4.c: New file.
5954         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
5956 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
5958         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
5960 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
5962         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
5963         (tf_msgsnd): Likewise.
5965         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
5966         premature returns a bit more.
5968 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
5970         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
5971         definition to the front.
5973         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
5974         the cleanup functions to make the names unique.  Fix dwarf opcode
5975         un unwind table.
5976         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
5977         functions to make the names unique.  Fix CFA offset for two blocks.
5979 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
5981         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
5982         missing closing braces.
5983         Patch by Christophe Saout <christophe@saout.de>.
5985 2003-06-24  Roland McGrath  <roland@redhat.com>
5987         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
5989 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
5991         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
5992         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
5994         * pthreadP.h: Declare __find_thread_by_id.
5995         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
5996         * pthread_clock_gettime.c: Allow using other thread's clock.
5997         * pthread_clock_settime.c: Likewise.
5998         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
5999         * Makefile: Add rules to build and run tst-clock2.
6000         * tst-clock2.c: New file.
6002 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6004         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6005         to use exception-based cleanup handler.
6006         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6008         * tst-cond8.c (ch): Announce that we are done.
6010         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6012         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6013         Also test aio_suspend with timeout value.
6015 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6017         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6018         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6019         attribute_hidden.
6021         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6022         (__pthread_mutex_lock_internal): Likewise.
6023         (__pthread_mutex_unlock_internal): Likewise.
6024         (__pthread_mutex_unlock_usercnt): Declare.
6025         * pthread_mutex_destroy.c: Always fail if used in any way.
6026         * pthread_mutex_init.c: Update comment.
6027         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6028         * pthread_mutex_timedlock.c: Adjust __nusers.
6029         * pthread_mutex_trylock.c: Adjust __nusers.
6030         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6031         and public interfaces are wrapper with pass additional parameter.
6032         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6033         parameter zero.
6034         * tst-mutex8.c: New file.
6035         * Makefile (tests): Add tst-mutex8.
6036         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6037         __pthread_mutex_unlock_usercnt.
6038         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6039         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6040         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6041         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6042         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6043         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6044         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6045         Add __nusers.
6046         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6047         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6048         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6049         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6050         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6052         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6053         * pthread_mutex_timedlock.c: Likewise.
6054         * pthread_mutex_trylock.c: Adjust __nusers.
6055         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6056         * tst-mutex9.c: New file.
6057         * Makefile (tests): Add tst-mutex9.
6058         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6059         * sysdeps/ia64/tls.h: Likewise.
6060         * sysdeps/powerpc/tls.h: Likewise.
6061         * sysdeps/s390/tls.h: Likewise.
6062         * sysdeps/sh/tls.h: Likewise.
6063         * sysdeps/x86_64/tls.h: Likewise.
6064         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6065         Change type of __owner.
6066         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6067         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6068         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6069         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6070         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6072 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6074         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6075         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6077         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6078         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6079         instead of nr to lll_futex_wake.  Only set errno and return -1
6080         if err < 0.
6082         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6083         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6084         return actual return value from the syscall, not 0.
6086 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6088         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6089         find a random value.
6090         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6091         errno==EIDRM.
6093         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6094         compat_timer_settime.
6095         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6096         compat_timer_gettime.
6097         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6098         compat_timer_getoverrun.
6099         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6100         compat_timer_delete.
6102         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6103         error-checking mutex detect busy mutexes.
6105 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6107         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6108         Add ax to clobber list.
6109         (lll_mutex_cond_lock): Likewise.
6110         (lll_mutex_unlock): Likewise.
6111         (lll_lock): Likewise.
6112         (lll_unlock): Likewise.
6114         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6115         * tst-cancel18.c: New file.
6116         * tst-cancelx18.c: New file.
6118         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6119         and tcdrain.
6121         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6122         * tst-cancel17.c: New file.
6123         * tst-cancelx17.c: New file.
6125         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6126         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6127         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6129         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6131 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6133         * sysdeps/pthread/createthread.c (create_thread): Set
6134         header.multiple_threads unconditionally.
6135         * allocatestack.c (allocate_stack): Likewise.
6136         * descr.h (struct pthread): Add header.multiple_threads
6137         unconditionally.
6138         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6139         Define for librt.  #error if neither libpthread, libc nor librt.
6140         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6141         Likewise.
6142         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6143         CDISABLE): Likewise.
6144         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6145         CDISABLE): Likewise.
6146         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6147         CDISABLE): Likewise.
6148         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6149         CDISABLE): Likewise.  Access header.multiple_threads outside of
6150         libc and libpthread.
6151         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6152         Likewise.
6153         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6154         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6156 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6158         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6159         Also test early cancellation before the thread reaches the cancellation
6160         point.
6162         * Makefile: Compile forward.c with exceptions.
6164         * sysdeps/unix/sysv/linux/sleep.c: New file.
6166 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6168         * Makefile: Add CFLAGS definition to compile function wrappers
6169         duplicated from libc with exceptions.
6170         * tst-cancel4.c: Also check cancellation handlers.
6172         * Makefile: Add rules to build and run tst-cancel16 and
6173         tst-cancelx16.  Add missing CFLAGS definitions.
6174         * tst-cancel16.c: New file.
6175         * tst-cancelx16.c: New file.
6177 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6179         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6180         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6181         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6182         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6184         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6185         (LIBC_CANCEL_RESET): Likewise.
6186         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6187         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6188         librt-cancellation.
6189         (CFLAGS-libcrt-cancellation.c): Define.
6190         * sysdeps/pthread/librt-cancellation.c: New file.
6191         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6192         macros also when compiling librt.
6193         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6194         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6195         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6196         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6197         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6198         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6199         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6201         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6202         compat_timer_create.
6204 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6206         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6208         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6209         __register_atfork.
6210         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6211         Add libc_hidden_def.
6213 2003-06-13  Roland McGrath  <roland@redhat.com>
6215         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6216         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6218 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6220         * allocatestack.c (queue_stack): Always inline.
6221         * ptreadhP.h (__do_cancel): Likewise.
6223 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6225         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6226         a typo.
6228 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6230         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6231         (__pthread_cond_signal): Remove incorrect second addition for
6232         cond_lock!=0.
6234 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6236         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6237         (__pthread_cond_signal): Use correct futex pointer in
6238         __lll_mutex_lock_wait call.
6240         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6241         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6243 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6245         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6246         cancelable.
6247         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6248         Likewise.
6250         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6251         hand-written CFI generation code.  Since ENTRY/END also initiated
6252         CFI frames this caused two CFI sets to be generated.
6254 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6256         * cleanup_routine.c: New file.
6257         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6258         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6259         cleanup handling.
6260         * Makefile (libpthread-routines): Add cleanup_routine.
6261         Add more CFLAGS variables to compile with exceptions.  Add comments
6262         why which file needs unwind tables.
6263         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6264         tests.
6265         * tst-cancelx1.c: New file.
6266         * tst-cancelx2.c: New file.
6267         * tst-cancelx3.c: New file.
6268         * tst-cancelx4.c: New file.
6269         * tst-cancelx5.c: New file.
6270         * tst-cancelx6.c: New file.
6271         * tst-cancelx7.c: New file.
6272         * tst-cancelx8.c: New file.
6273         * tst-cancelx9.c: New file.
6274         * tst-cancelx10.c: New file.
6275         * tst-cancelx11.c: New file.
6276         * tst-cancelx12.c: New file.
6277         * tst-cancelx13.c: New file.
6278         * tst-cancelx14.c: New file.
6279         * tst-cancelx15.c: New file.
6280         * tst-cleanupx0.c: New file.
6281         * tst-cleanupx0.expect: New file.
6282         * tst-cleanupx1.c: New file.
6283         * tst-cleanupx2.c: New file.
6284         * tst-cleanupx3.c: New file.
6286         * tst-cleanup0.c: Make standard compliant.
6287         * tst-cleanup1.c: Likewise.
6289         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6290         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6291         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6292         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6293         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6294         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6295         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6296         CLEANUP_JMP_BUF.
6297         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6298         * tst-cancel12.c: New file.
6299         * tst-cancel13.c: New file.
6300         * tst-cancel14.c: New file.
6301         * tst-cancel15.c: New file.
6302         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6303         and tst-cancel15.
6305         * tst-cancel1.c: Add some comments.
6307         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6308         timeout correctly.
6310 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6312         * Makefile (CFLAGS-pthread_cancel.c): Define.
6314 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6316         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6317         Change type of __writer element to int.
6318         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6319         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6320         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6321         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6322         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6323         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6324         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6325         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6326         Compare with TID to determine deadlocks.
6327         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6328         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6329         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6330         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6331         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6332         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6333         Likewise.
6334         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6335         Likewise.
6336         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6337         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6338         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6339         Likewise.
6340         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6341         Likewise.
6342         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6343         * Makefile (tests): Add tst-rwlock12.
6344         * tst-rwlock12.c: New file.
6346 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6348         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6349         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6350         Remove bogus hidden_proto.
6351         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6352         Likewise.
6353         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6354         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6355         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6356         ___lll_mutex_timedlock): Likewise.
6358 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6361         (__pthread_cond_signal): Add some code to eventually handle
6362         cond_lock!=0.
6364 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6366         * Makefile (tests): Add tst-exec4.
6367         (tst-exec4-ARGS): Define.
6368         * tst-exec4.c: New file.
6370 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6372         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6373         Also fail if tv_nsec < 0.
6374         (__lll_timedwait_tid): Likewise.
6375         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6376         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6377         Likewise.
6378         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6379         Likewise.
6380         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6381         Likewise.
6382         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6383         Likewise.
6384         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6385         Likewise.
6386         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6387         Likewise.
6389         * Makefile (tests): Add tst-sem8 and tst-sem9.
6390         * tst-sem8.c: New file.
6391         * tst-sem9.c: New file.
6392         * sem_open.c: Fix creation of in_use record if the file exists but
6393         no internal record.
6395         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6396         definitions.
6398         * sysdeps/pthread/timer_create.c (timer_create): In case
6399         evp==NULL, assign timer ID to sival_ptr.
6401         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6402         struct pthread_unwind_buf *.
6403         (struct pthread): Likewise for cleanup_jmp_buf element.
6405         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6406         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6407         * unwind.c (__pthread_unwind_next): Likewise.
6409 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6411         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6412         (lll_futex_timed_wait): Use int for futex value parameter.
6413         (lll_futex_wake): Likewise.
6414         (lll_futex_requeue): Likewise.
6416         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6417         Replace one memory operation with one register operation.
6419         * tst-join4.c (do_test): Fix error message.
6421         * tst-rwlock6.c (do_test): Use correct format specifier.
6423         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6424         (__lll_mutex_lock_wait): Replace one memory operation with one
6425         register operation.
6426         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6427         (__lll_mutex_lock_wait): Likewise.
6429         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6430         (__lll_mutex_cond_lock): Add one to value parameter of
6431         __lll_lock_wait to reflect reality in the futex syscall.
6432         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6433         (lll_mutex_cond_lock): Likewise.
6435 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6437         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6438         New function.
6439         (lll_mutex_cond_lock): Define.
6441 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6443         * Makefile (tests): Add tst-signal6.
6444         * tst-signal6.c: New file.
6446         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6447         (__lll_mutex_unlock_force): New function
6448         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6450         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6451         (__lll_mutex_unlock_force): New function.
6452         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6454         * tst-rwlock7.c (do_test): Use correct format specifier.
6456         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6457         Find break parameter in correct asm argument.
6459 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6461         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6462         Remove out4.
6463         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6464         error occured.
6465         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6466         Add __mutex.
6467         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6468         lll_futex_requeue, lll_mutex_unlock_force): Define.
6470 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6472         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6473         (pthread_cond_t): Add __mutex.
6474         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6475         lll_futex_requeue, lll_mutex_unlock_force): Define.
6477 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6479         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6480         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6481         Add __mutex field.
6482         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6483         Define.
6484         (lll_futex_wait, lll_futex_wake): Define.
6485         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6486         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6487         FUTEX_REQUEUE instead of FUTEX_WAIT.
6488         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6489         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6490         mutex which was used in condvar structure.  Call
6491         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6492         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6494         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6495         include tcb-offsets.h.  Read wakeup value in locked region.
6496         Use the value of gbr register as THREAD_ID.
6497         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6498         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6499         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6501         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6502         macros.
6504 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6506         * sysdeps/pthread/pthread_cond_broadcast.c
6507         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6509 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6511         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6512         typo in register name.
6513         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6514         correctly.  Actually use requeue.  Little optimization.
6515         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6516         mutex address early.  Handle cancellation state as 32-bit value.
6517         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6518         Remove unnecessary label.
6520 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6522         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6523         instead of FUTEX_WAIT.
6524         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6525         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6526         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6527         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6528         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6529         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6530         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6531         of __pthread_mutex_lock_internal.
6532         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6533         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6534         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6535         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6536         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6537         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6538         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6539         Add pthread_mutex_cond_lock.
6540         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6541         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6542         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6543         lll_mutex_cond_lock.
6544         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6545         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6546         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6547         Add __mutex field.
6548         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6549         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6551         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6552         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6554         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6555         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6556         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6557         macro don't define aliases.
6559         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6560         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6561         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6562         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6563         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6564         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6565         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6566         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6567         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6569 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6571         * sem_open.c: Fix one endless loop.  Implement correct semantics
6572         wrt opening the same semaphore more then once.
6573         * sem_close.c: Adjust for sem_open change.
6574         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6575         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6576         * Makefile (tests): Add tst-sem7.
6577         * tst-sem7.c: New file.
6579 2003-05-16  Roland McGrath  <roland@redhat.com>
6581         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6582         uninitialized variable braino.
6584 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6586         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6587         test for syscall availability.
6589         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6590         __no_posix_timers to -1 if the syscalls don't exist.
6592         * pthread_join.c (pthread_join): Set tid field of the joined
6593         thread to -1.  This isn't necessary but helps to recognize some
6594         error conditions with almost no cost.
6596         * allocatestack.c (FREE_P): Also negative values indicate an
6597         unused stack.
6599         * unwind.c: Include <unistd.h>.
6601 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6603         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6605 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6607         * Makefile (crti-objs, crtn-objs): New variables.
6608         (omit-deps, extra-objs): Add crtn.
6609         ($(objpfx)libpthread.so): Depend on both crti and crtn
6610         and links to them in multidir.
6611         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6613 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6615         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6616         (lll_mutex_unlock): Use atomic_exchange_rel.
6618 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6620         * cond-perf.c (cons): Add missing locking around setting of alldone.
6622 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6624         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6625         related macros.
6626         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6628 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6630         * tst-sem6.c: New file.
6631         * Makefile (tests): Add tst-sem6.
6633         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6634         Use atomic_exchange_rel instead of atomic_exchange.
6635         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6636         Likewise.
6638         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6639         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6640         vsyscall is possible.
6642         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6643         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6644         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6645         pthread_setaffinity_np.
6646         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6647         and pthread_setaffinity_np.
6648         * Makefile (libpthread-routines): Add pthread_getaffinity and
6649         pthread_setaffinity.
6651         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6652         use it in case mmap to allocate the stack fails.
6653         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6654         ARCH_MAP_FLAGS here.
6655         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6656         ARCH_RETRY_MMAP.
6658 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6660         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6661         handler implementation.  It is now lockless in fork().
6662         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6663         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6664         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6665         declare the __fork_*_lists.
6666         (struct fork_handler): Include pointers to all three functions.
6667         Add next, refcntr and need_signal elements.
6668         (__fork_handlers): New declaration.
6669         (__register_atfork_malloc): Remove declaration.
6670         (HAVE_register_atfork_malloc): Remove definition.
6671         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
6672         __pthread_child_handler variable.
6673         (__libc_pthread_init): Use __register_atfork instead of explicitly
6674         adding to the list.
6675         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
6676         and lll_futex_wake.
6677         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6679         * unwind.c (unwind_cleanup): Print error message and then abort.  This
6680         function must never be reached.
6682         * cond-perf.c: New file.
6684 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
6686         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
6688 2003-05-04  Roland McGrath  <roland@redhat.com>
6690         * Makefile ($(objpfx)../libc.so): New target.
6692 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
6694         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6695         (pthread_condattr_t): Size is only an int, don't use long for
6696         alignment.
6697         (pthread_mutexattr_t): Likewise.
6698         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6699         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6700         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6702 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
6704         * sysdeps/i386/tls.h: Define THREAD_ID.
6705         * sysdeps/ia64/tls.h: Likewise.
6706         * sysdeps/powerpc/tls.h: Likewise.
6707         * sysdeps/s390/tls.h: Likewise.
6708         * sysdeps/sh/tls.h: Likewise.
6709         * sysdeps/x86_64/tls.h: Likewise.
6710         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
6711         record ownership.
6712         * pthread_mutex_timedlock.c: Likewise.
6713         * pthread_mutex_trylock.c: Likewise.
6714         * pthread_mutex_unlock.c: Likewise.
6715         * pthread_rwlock_trywrlock.c: Likewise.
6716         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
6717         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6718         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6719         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6721         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
6722         flag.
6724 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
6726         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6727         (__SIZEOF_PTHREAD_COND_T): Define to 48.
6728         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
6729         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6730         Make __align long long instead of long.
6731         (pthread_rwlock_t): Formatting.
6732         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
6733         (pthread_rwlock_t): Formatting.
6734         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6735         (pthread_cond_t): Make __align long long instead of long.
6736         (pthread_rwlock_t): Move __flags field to the same position as in
6737         linuxthreads.
6739 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
6741         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
6742         * tst-rwlock7.c (do_test): Likewise.
6744 2003-04-26  Roland McGrath  <roland@redhat.com>
6746         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
6748 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
6750         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
6751         sizeof (struct pthread).
6752         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
6753         1 struct pthread.
6754         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
6755         to 0.
6756         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
6757         struct pthread.
6758         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
6759         to 32-bit bytes.
6760         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
6761         tcbp.
6762         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
6763         unneccessarily.
6764         (NO_TLS_OFFSET): Define.
6765         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
6766         add TLS_TCB_SIZE unnecessarily.
6768 2003-04-22  Roland McGrath  <roland@redhat.com>
6770         * Makeconfig (shared-thread-library): Reverse link order to work
6771         around linker bug.
6773 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
6775         * semaphore.h: Fix typo in comment.
6777 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
6779         * sysdeps/pthread/sigfillset.c: New file.
6781         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
6782         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
6783         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
6784         * sysdeps/pthread/sigaction.c: Likewise.
6785         * sysdeps/pthread/sigprocmask.c: New file.
6786         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
6787         __SIGRTMIN+1.
6788         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
6789         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
6790         in this case.
6792 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
6794         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6795         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
6797         * sysdeps/unix/sysv/linux/unregister-atfork.c
6798         (__unregister_atfork): Don't free memory not allocated dynamically.
6800         * semaphore.h: Remove __THROW marker from cancellation points.
6801         * nptl/sysdeps/pthread/pthread.h: Likewise.
6803 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
6805         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
6806         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
6807         __THROW.
6809 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
6811         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
6813 2003-04-15  Roland McGrath  <roland@redhat.com>
6815         * forward.c (__pthread_unwind): Tweak to avoid warning.
6817 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
6819         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
6821 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
6823         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
6824         overflow CFA advance instructions.
6825         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6827 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
6829         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
6830         * sysdeps/i386/pthread_spin_lock.c: Likewise.
6831         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
6832         defined.
6834         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
6835         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
6836         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
6837         DW_CFA_advance_loc for .Laddl-.Lsubl.
6839 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
6841         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
6842         position-independent unwind data for static libraries.
6843         Add missing unwind info.  Add comments.
6845         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
6846         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6847         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6848         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6850 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
6852         * Makefile: Make sure all cancellation points are compiled with
6853         exception and asynchronous unwind tables.
6855         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
6856         which mishandles loading of global object addresses in PIC.
6857         (THREAD_SETMEM_NC): Likewise.
6859 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
6861         * pthread.h: Define new data structure for cleanup buffer.  Declare
6862         new cleanup handler interfaces.
6863         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
6864         (struct pthread): Add cleanup_jmp_buf pointer.  Define
6865         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
6866         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
6867         it.  Declare old cleanup handler installation functions.
6868         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
6869         handling.
6870         * cleanup_defer.c: Likewise.
6871         * cleanup_compat.c: New file.  Old cleanup code.
6872         * cleanup_def_compat.c: New file.  Old cleanup code.
6873         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
6874         if own thread descriptor.
6875         * unwind.c: New file.
6876         * forward.c: Add __pthread_unwind.
6877         * init.c (pthread_functions): Add __pthread_unwind.
6878         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
6879         Add ptr___pthread_unwind.
6880         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
6881         and unwind function.
6882         * Makefile (libpthread-routines): Add cleanup_compat,
6883         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
6884         table generation if necessary.
6885         * version.c: Record whether unwind support is compiled in.
6886         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
6887         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
6888         handler interfaces.
6889         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
6890         complication to generate unwind information for syscall wrappers.
6891         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6892         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
6893         __cleanup_fct_attribute.
6895         * Makefile: Add rules to build and run tst-cleanup0.
6896         * tst-cleanup0.c: New file.
6897         * tst-cleanup0.expect: New file.
6899         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
6900         caller.  Optimize to avoid often unecessary local variable.
6902 2003-04-11  Roland McGrath  <roland@redhat.com>
6904         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
6905         sets variable `multidir'; include that.
6906         (generated): Add it.
6907         ($(objpfx)$(multidir)/crti.o): New target.
6908         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
6910 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
6912         * tst-attr2.c (do_test): Add cast to avoid warning.
6913         * tst-mutex4.c (do_test): Likewise.
6915 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
6917         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
6918         in child.
6920 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
6922         * Makefile (tests): Add tst-detach1.
6923         * tst-detach1.c: New file.
6925 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
6927         * sysdeps/pthread/pthread.h: Remove duplicate
6928         pthread_cleanup_{push,pop} definitions.
6930         * tst-barrier2.c: Eliminate warnings.
6931         * tst-cancel4.c: Likewise.
6932         * tst-cond4.c: Likewise.
6933         * tst-cond6.c: Likewise.
6934         * tst-detach1.c: Likewise.
6935         * tst-rwlock4.c: Likewise.
6936         * tst-rwlock6.c: Likewise.
6937         * tst-rwlock7.c: Likewise.
6938         * tst-sem3.c: Likewise.
6939         * tst-spin2.c: Likewise.
6940         * tst-umask1.c: Likewise.
6942 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
6944         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
6946 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
6948         * descr.h (struct pthread): Move cancelhandling member to the front.
6950 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
6952         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
6953         malloc_parent, and malloc_child statically.
6954         (__register_atfork_malloc): New function.
6955         (free_mem): Don't free any of the malloc_* variables on the list.
6956         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
6957         Define HAVE_register_atfork_malloc.
6959 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
6961         * sysdeps/pthread/createthread.c (create_thread): Add some more
6962         comments explaining when to set multiple_threads and when not.
6964         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
6965         THREAD_ATOMIC_BIT_SET if not already defined.
6966         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
6967         THREAD_ATOMIC_BIT_SET:
6968         * sysdeps/x86_64/tls.h: Likewise.
6969         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
6970         THREAD_ATOMIC_CMPXCHG_VAL.
6971         (_pthread_cleanup_pop_restore): Likewise.
6972         * cancellation.c (__pthread_enable_asynccancel): Likewise.
6973         (__pthread_enable_asynccancel_2): Likewise.
6974         (__pthread_disable_asynccancel): Likewise.
6975         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
6976         (__libc_disable_asynccancel): Likewise.
6977         * init.c (sigcancel_handler): Likewise.
6978         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
6979         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
6981 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
6983         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
6984         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
6985         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
6986         * Makefile (tests): Add tst-cancel11.
6987         * tst-cancel11.c: New file.
6989 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
6991         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
6992         round, not the first.  Use specific_used flag instead of local
6993         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
6994         (__free_tcb): Don't call deallocate_tsd here.
6995         (start_thread): Call deallocate_tsd here.
6996         * pthread_setspecific.c: Set specific_used flag really only when
6997         needed.
6998         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
6999         * tst-tsd3.c: New file.
7000         * tst-tsd4.c: New file.
7002 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7004         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7005         Use atomic_exchange_and_add instead of __lll_add.
7006         (__lll_mutex_timedlock): Likewise.
7007         Patch by Ian Wienand.
7009 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7011         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7012         (SINGLE_THREAD_P): Fix typo.
7013         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7015 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7017         * Makefile (tests): Add tst-align.
7018         * tst-align.c: New file.
7019         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7021         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7022         function correctly.
7024         * tst-tsd2.c: Add casts to avoid warnings.
7026 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7028         * descr.h (struct pthread): Move most often used elements to the front.
7030 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7032         * Makefile (libpthread-routines): Add pthread_atfork.
7033         (libpthread-static-only-routines): Add pthread_atfork.
7035 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7037         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7038         of TLS_DTV_AT_TP.
7039         (INSTALL_DTV): Add parens.
7040         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7041         Use passed descr instead of THREAD_SELF.
7042         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7043         (__lll_mutex_timedlock_wait): Correct expected value after
7044         spurious wakeup.
7045         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7046         Release lock before waking up the waiters.
7047         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7048         criteria.  Reorderstruct passed to cleanup handler.  Fix
7049         handling of cancellation and failung pthread_mutex_unlock call.
7050         Use __pthread_enable_asynccancel_2 instead of
7051         __pthread_enable_asynccancel.
7052         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7053         Return result of lock re-get if it fails.
7054         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7055         for __pthread_cleanup_push.
7056         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7057         completely broken rwlock implementation.
7058         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7059         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7060         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7061         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7062         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7063         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7064         versioned_symbol macro.
7065         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7066         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7068 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7070         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7071         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7072         and __helper_tid.
7073         (struct timer): Remove th and bar field.
7074         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7075         debugging code.  Create only one helper thread.
7076         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7077         helper thread.
7078         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7079         Renamed.  Define statically.  Use thread info from siginfo.
7080         (__helper_once): New variable.
7081         (__helper_tid): New variable.
7082         (__reset_helper_control): New function.
7083         (__start_helper_thread): New function.
7085         * pthread_create.c (start_thread): Don't use setjmp inside
7086         __builtin_expect to work around gcc bug.
7088         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7089         timer_delete syscall fails, but not with ENOSYS, set
7090         __no_posix_timers.
7092         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7093         (timer_settime): Fix typo.
7094         * sysdeps/unix/sysv/linux/timer_getoverr.c
7095         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7097 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7099         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7100         offset of cleanupbuf.__prev.
7102 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7104         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7105         of included file.
7107 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7109         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7110         NULL provide default definition to syscall.
7112 2003-03-25  Roland McGrath  <roland@redhat.com>
7114         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7115         (timer_id2ptr): Fix typo.
7117 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7119         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7120         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7121         * sysdeps/ia64/pthreaddef.h: Likewise.
7122         * sysdeps/powerpc/pthreaddef.h: Likewise.
7123         * sysdeps/s390/pthreaddef.h: Likewise.
7124         * sysdeps/sh/pthreaddef.h: Likewise.
7125         * sysdeps/x86_64/pthreaddef.h: Likewise.
7126         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7127         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7128         being changed.
7129         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7130         SIGTIMER is not unblocked.
7131         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7132         RT signal taken.
7133         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7134         be send.
7135         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7136         pass pointer through as ID.
7137         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7138         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7139         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7140         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7141         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7142         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7143         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7144         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7145         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7146         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7147         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7148         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7149         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7150         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7151         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7152         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7153         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7154         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7155         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7156         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7157         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7158         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7159         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7160         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7161         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7162         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7163         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7164         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7165         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7166         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7167         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7168         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7169         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7171         * pthreadP.h: Remove FRAME_LEFT definition.
7172         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7173         already left frame.  Programs which have this problem are not POSIX
7174         compliant.
7175         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7177 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7179         * sysdeps/pthread/tst-timer.c: Check return values of the
7180         functions we test.
7182 2003-03-23  Roland McGrath  <roland@redhat.com>
7184         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7185         * tst-tls3mod.c: Likewise.
7186         * tst-tls1.c: Likewise.
7187         * tst-tls2.c: Likewise.
7189         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7190         undefined behavior.
7192         * tst-join5.c (tf1, tf2): Add a cast.
7194         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7196         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7197         Don't test anything.
7198         * tst-cond4.c: Likewise.
7199         * tst-cond6.c: Likewise.
7200         * tst-flock2.c: Likewise.
7201         * tst-mutex4.c: Likewise.
7202         * tst-rwlock4.c: Likewise.
7203         * tst-signal1.c: Likewise.
7204         * tst-spin2.c: Likewise.
7205         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7207         * tst-mutex4.c: Use test-skeleton.c.
7208         * tst-spin2.c: Likewise.
7209         * tst-sysconf.c: Likewise.
7210         * tst-barrier2.c: Likewise.
7211         * tst-cond4.c: Likewise.
7212         * tst-cond6.c: Likewise.
7213         * tst-rwlock4.c: Likewise.
7214         * tst-unload.c: Likewise.
7215         * tst-flock2.c (do_test): Use return instead of exit.
7217 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7219         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7221 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7223         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7224         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7225         instead of __lll_compare_and_swap.
7226         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7227         Likewise.
7228         Removed definition if __lll_compare_and_swap.
7230         * cancellation.c: Adjust for new form of compare&exchange macros.
7231         * cleanup_defer.c: Likewise.
7232         * init.c: Likewise.
7233         * libc-cancellation.c: Likewise.
7234         * old_pthread_cond_broadcast.c: Likewise.
7235         * old_pthread_cond_signal.c: Likewise.
7236         * old_pthread_cond_timedwait.c: Likewise.
7237         * old_pthread_cond_wait.c: Likewise.
7238         * pthread_cancel.c: Likewise.
7239         * pthread_create.c: Likewise.
7240         * pthread_detach.c: Likewise.
7241         * pthread_join.c: Likewise.
7242         * pthread_key_delete.c: Likewise.
7243         * pthread_setcancelstate.c: Likewise.
7244         * pthread_setcanceltype.c: Likewise.
7245         * pthread_timedjoin.c: Likewise.
7246         * pthread_tryjoin.c: Likewise.
7247         * sysdeps/pthread/createthread.c: Likewise.
7249 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7251         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7252         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7253         definitions.  Replace uses with calls to atomic_* functions.
7254         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7255         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7256         __lll_test_and_set calls with atomic_exchange_and_add and
7257         atomic_exchange calls respectively.
7258         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7259         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7260         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7261         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7262         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7263         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7264         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7266         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7267         returns the old value.
7269 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7271         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7272         int for variable OLDVAL and correct inline assembler contraint.
7273         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7274         type int for variable OLD.
7276         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7277         only for s390-32.
7278         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7279         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7280         instead of multiple_threads field in the TCB.
7282 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7284         * sysdeps/i386/i686/bits/atomic.h: Removed.
7285         * sysdeps/i386/i586/bits/atomic.h: Removed.
7286         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7287         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7288         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7289         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7290         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7291         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7292         * atomic.h: Removed.  Moved to glibc.
7294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7295         support for clock selection.
7297         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7298         signalling waiters.
7300 2003-03-18  Roland McGrath  <roland@redhat.com>
7302         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7303         Add __lll_rel_instr first.  Add memory clobber.
7304         (lll_mutex_unlock): Use __lll_test_and_set.
7305         From Paul Mackerras <paulus@samba.org>.
7307         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7308         unconditionally.
7309         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7310         (SINGLE_THREAD_P):  Add `header.' prefix.
7311         From Paul Mackerras <paulus@samba.org>.
7313         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7314         pthread_timedjoin_np to ...
7315         (libpthread: GLIBC_2.3.3): ... here.
7316         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7318         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7319         Avoid shadowing VAL variable.
7321         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7322         New macro.
7324 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7326         * Makefile (tests): Add tst-cond11.
7327         * tst-cond11.c: New file.
7329         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7330         struct passed to cleanup handler to eliminate one more
7331         instruction.
7332         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7334         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7335         (pthrad_cond_t): Replace __unused field with __clock.
7337         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7338         waken all waiters in cleanup handler.
7339         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7340         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7342         * pthread_condattr_getclock.c: New file.
7343         * pthread_condattr_setclock.c: New file.
7344         * sysdeps/pthread/pthread.h: Declare these new functions.
7345         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7346         * Makefile (libpthread-routines): Add the new functions.
7347         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7348         Renamed field to value.  Document use of the bits.
7349         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7350         change.
7351         * pthread_condattr_setpshared.c: Likewise.
7352         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7353         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7354         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7355         Add __clock field.
7356         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7357         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7358         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7359         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7361         Implement clock selection.
7362         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7363         * pthread-errnos.sym: Add ENOSYS.
7364         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7365         _POSIX_CLOCK_SELECTION.
7366         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7368         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7369         invalid .size directive.
7371 2003-03-17  Roland McGrath  <roland@redhat.com>
7373         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7374         Formatting tweaks.
7376 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7378         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7379         Use __lll_add instead of spelling it out.  Use protected symbol names.
7380         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7381         Use __lll_add.
7382         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7383         Renamed from lll_compare_and_swap.  Use new name where necessary.
7384         (__lll_add): Defined.
7385         (__lll_dec_if_positive): Defined.
7386         (__lll_test_and_set): Defined.
7387         * sysdeps/ia64/pthread_spin_init.c: Removed.
7388         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7389         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7390         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7391         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7392         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7393         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7394         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7395         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7396         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7397         __sync_lock_release_si.
7398         Patch by Jakub Jelinek.
7400         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7401         Fix timeout handling.
7402         (__lll_timedwait_tid): Likewise.
7403         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7404         Patch by Jakub Jelinek.
7406         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7408 2003-03-17  Roland McGrath  <roland@redhat.com>
7410         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7411         * sysdeps/pthread/pthread_spin_init.c: New file.
7412         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7413         * sysdeps/powerpc/Makefile: New file.
7414         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7415         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7416         * sysdeps/powerpc/pthreaddef.h: New file.
7417         * sysdeps/powerpc/tcb-offsets.sym: New file.
7418         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7419         * sysdeps/powerpc/tls.h: New file.
7420         * sysdeps/powerpc/bits/atomic.h: New file.
7421         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7422         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7423         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7425         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7426         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7427         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7428         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7429         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7430         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7431         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7432         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7433         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7434         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7435         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7436         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7437         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7438         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7439         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7441         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7442         not gettimeofday.
7443         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7444         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7445         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7446         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7447         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7449 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7451         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7452         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7453         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7454         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7455         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7457 2003-03-16  Roland McGrath  <roland@redhat.com>
7459         * tst-fork4.c: Include <string.h>.
7460         * tst-signal2.c: Likewise.
7461         * tst-mutex5.c (do_test): exit -> return.
7462         * tst-mutex2.c: Include <stdlib.h>.
7464 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7466         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7467         (__lll_mutex_timedlock_wait): Correct expected value after
7468         spurious wakeup.  Otherwise we would never wait again.
7470         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7471         zone versus inline asm stupidity.  Use correct instructions.
7473         * tst-rwlock6.c: Add some more status output.
7475 2003-03-15  Roland McGrath  <roland@redhat.com>
7477         * sysdeps/pthread/configure.in: New file.
7478         * sysdeps/pthread/configure: New file (generated).
7480 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7482         * allocatestack.c (allocate_stack): Store the exact stack size of
7483         user allocated stacks.
7485 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7487         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7488         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7489         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7490         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7491         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7492         Use `header.' prefix.
7493         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7495 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7497         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7498         __builtin_frame_address, use stack pointer.
7500         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7501         instead of __builtin_frame_pointer.
7503 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7505         * tst-basic1.c (do_test): Add cast to avoid warning.
7506         * tst-basic2.c (do_test): Likewise.
7508         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7509         amount of stack correction.
7511         * tst-fork4.c: Use test-skeleton.c.
7513 2003-03-14  Roland McGrath  <roland@redhat.com>
7515         * init.c: Fix typo "#eli" for "#else".
7517 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7519         * allocatestack.c (__stack_user): Use hidden_data_def.
7520         * pthread_create.c (__pthread_keys): Likewise.
7522         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7524 2003-03-14  Roland McGrath  <roland@redhat.com>
7526         * tst-fork4.c: New file.
7527         * Makefile (tests): Add it.
7529         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7530         we always define the padding space.
7531         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7532         stopped supporting its own extensions fully.
7533         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7534         struct also called `header', so `header.multiple_threads' is the field
7535         name to use on all machines.
7536         * allocatestack.c (allocate_stack): Use `header.' prefix.
7537         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7538         * pthread_create.c (__pthread_create_2_1): Likewise.
7539         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7540         (THREAD_SELF): Likewise.
7541         * sysdeps/x86_64/tls.h: Likewise.
7542         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7543         (SINGLE_THREAD_P): Likewise.
7544         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7545         (SINGLE_THREAD_P): Likewise.
7546         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7547         (SINGLE_THREAD_P): Likewise.
7549         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7550         value directly.
7552 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7554         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7555         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7557         * pthread_create.c (start_thread): setjmp is expected to return 0.
7559         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7560         (THREAD_GETMEM_NC): Likewise.
7562 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7564         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7565         and the size of the stack which must be allocated is a multiple,
7566         allocate one more page.
7567         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7568         MULTI_PAGE_ALIASING.
7570 2003-03-13  Roland McGrath  <roland@redhat.com>
7572         * pthread_create.c (start_thread): Set EXITING_BIT after the
7573         event-reporting (and destructors), not before.
7575 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7577         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7578         lll_futex_wake): Declare register variables as long int instead of
7579         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7580         Make syscall arguments clobbered by the syscall.
7581         (lll_futex_wait): Define using lll_futex_timed_wait.
7583         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7584         to void *.
7586         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7587         PPID if [! NDEBUG].
7589         * allocatestack.c (nptl_ncreated): Only declare if
7590         COLORING_INCREMENT != 0.
7592         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7593         (__libc_enable_asynccancel_2): Remove prototype.
7595         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7596         ctid to match kernel.
7598 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7600         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7601         libc_multiple_threads.
7602         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7603         __libc_multiple_threads to...
7604         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7606         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7607         versioning.
7608         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7609         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7611         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7612         (__pthread_once_internal): Define.
7614         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7615         macros instead of .symver directly.
7616         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7617         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7619         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7620         * sysdeps/x86_64/tcb-offsets.sym: New file.
7621         * sysdeps/x86_64/Makefile: New file.
7623         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7624         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7625         to access own pthread_t in TCB.
7626         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7627         Likewise.
7628         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7629         Likewise.
7630         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7632 2003-03-12  Roland McGrath  <roland@redhat.com>
7634         * pthread-errnos.sym: New file.
7635         * Makefile (gen-as-const-headers): New variable, list that file.
7636         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7637         header <pthread-errnos.h> instead of defining errno values here.
7638         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7639         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7640         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7641         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7642         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7643         Likewise.
7644         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7645         Likewise.
7646         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7647         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7648         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7649         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7650         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7651         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7652         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7653         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7654         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7655         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7656         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7657         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7658         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7659         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7660         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7661         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7662         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7663         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7664         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7665         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7666         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7667         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7668         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
7669         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
7670         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
7671         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7672         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7674         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
7675         CLONE_CHILD_SETTID worked.
7677 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7679         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
7680         file.
7681         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
7682         file.
7684         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7685         (pthread_cond_t): Add padding.
7687         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
7688         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
7689         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
7691         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
7692         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
7693         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
7694         (__pthread_rwlock_timedrdlock): Likewise.
7695         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
7696         (__pthread_rwlock_wrlock): Likewise.
7697         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
7698         (__pthread_rwlock_rdlock): Likewise.
7700         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
7702         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
7703         result of lock re-get if it fails.
7705 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7707         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
7708         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7709         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7710         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7711         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7712         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7713         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7714         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7715         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7716         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7718         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
7719         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
7721         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
7722         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
7723         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
7724         (create_thread): Likewise.
7725         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
7726         * init.c (__pthread_initialize_minimal_internal): Initialize
7727         __libc_multiple_threads_ptr if necessary.
7728         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
7729         __pthread_multiple_threads and __libc_multiple_threads_ptr.
7730         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
7731         __libc_multiple_threads.
7732         (__libc_pthread_init): Return pointer to __libc_pthread_init if
7733         necessary.
7735         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
7736         (THREAD_SETMEM_NC): Likewise.
7738         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
7739         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
7740         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
7741         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
7743         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
7744         Eliminate one entire instruction.
7746         * cancellation.c (__pthread_enable_asynccancel_2): New function.
7747         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
7748         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7749         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
7750         instead of __pthread_enable_asynccancel.
7751         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7752         (__pthread_cond_wait): Likewise.
7753         * sysdeps/pthread/pthread_cond_timedwait.c
7754         (__pthread_cond_timedwait): Likewise.
7755         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
7757         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7758         (__condvar_cleanup): Wake up all waiters in case we got signaled
7759         after being woken up but before disabling asynchronous
7760         cancellation.
7761         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
7762         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
7763         (__condvar_cleanup): Likewise.
7765         * init.c (__NR_set_tid_address): If already defined, don't redefine.
7766         Make it an error if architecture has no #if case.  Add x86-64.
7768         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
7769         pt-initfini.s generation.
7771         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
7772         (TLS_INIT_TP): Fix typo.
7774 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7776         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
7777         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
7779         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
7780         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7781         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
7782         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
7783         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
7784         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7785         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7786         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7788 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7790         * sysdeps/pthread/pthread_cond_timedwait.c
7791         (__pthread_cond_timedwait): Return the result of the final
7792         locking.  If it succeeds, the regular function return value.
7794         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
7795         Return result of the final locking.
7796         * version.c (__nptl_main): Work around problems with the strange
7797         INTERNAL_SYSCALL macro on ppc32.
7798         * init.c (__pthread_initialize_minimal_internal): Unblock
7799         SIGCANCEL in case the parent blocked it.
7800         Reported by Paul Mackerras <paulus@samba.org>.
7802         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
7803         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
7804         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
7806 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7808         * sysdeps/pthread/pthread_cond_timedwait.c
7809         (__pthread_cond_timedwait): Unlock and fail if
7810         __pthread_mutex_unlock_internal failed.
7812         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
7813         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
7814         Use ARCH_CLONE.
7815         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
7816         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
7817         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
7818         ALLOCATE_STACK): New macros.
7819         (TLS_TPADJ): New macro.
7820         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
7821         (allocate_stack): Handle TLS_DTV_AT_TP and
7822         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
7823         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
7824         Don't set PD->self.
7825         * init.c [__ia64__] (__NR_set_tid_address): Define.
7827         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
7828         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
7829         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
7830         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
7831         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
7832         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
7833         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
7834         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
7835         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
7836         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
7837         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
7838         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
7839         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
7840         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
7841         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
7842         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
7843         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
7844         * sysdeps/ia64/bits/atomic.h: New file.
7845         * sysdeps/ia64/Makefile: New file.
7846         * sysdeps/ia64/pthread_spin_init.c: New file.
7847         * sysdeps/ia64/pthread_spin_lock.c: New file.
7848         * sysdeps/ia64/pthread_spin_trylock.c: New file.
7849         * sysdeps/ia64/pthread_spin_unlock.c: New file.
7850         * sysdeps/ia64/pthreaddef.h: New file.
7851         * sysdeps/ia64/tcb-offsets.sym: New file.
7852         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
7853         * sysdeps/ia64/tls.h: New file.
7855         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
7856         to syscall instead of no arguments.
7858 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
7860         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
7861         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
7862         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
7863         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
7865         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
7866         unused code.
7868         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
7870         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
7871         lowlevelbarrier.sym.
7872         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
7873         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
7874         Include lowlevelbarrier.h and don't define offsets locally.
7875         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
7877         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
7878         (__lll_mutex_lock_wait): Reverse order of first two parameters.
7879         (__lll_mutex_timedlock_wait): Likewise.
7880         (lll_mutex_lock): Adjust asm for that.
7881         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
7882         (lll_lock): Adjust asm for operand order change.
7883         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
7884         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
7886         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
7887         Reverse order of parameters.
7888         (__lll_timedwait_tid): Remove regparms attribute.
7889         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
7890         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
7892         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7893         (__lll_timedwait_tid): Remove one unnecessary instruction.
7895         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
7896         __lll_mutex_timedlock_wait only for NOT_IN_libc.
7897         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
7898         lowlevelmutex.S.
7900         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
7901         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
7902         for NOT_IN_libc.
7903         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
7904         lowlevellock.S.
7906         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
7907         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
7908         for libc.so.
7909         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
7910         define LOCK here (if UP is not defined).  The actual code is in
7911         lowlevelmutex.S.
7913         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
7914         LOCK is already defined.  Don't define lll_unlock_wake_cb and
7915         __lll_timedwait_tid for libc.so.
7916         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
7917         define LOCK here (if UP is not defined).  The actual code is in
7918         lowlevellock.S.
7920         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
7921         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
7922         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
7923         instead of lowlevelsem.h.
7924         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7925         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7926         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7928         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
7929         lowlevelrwlock.sym.
7930         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
7931         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
7932         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
7934         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
7935         register loading.
7936         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
7937         last changed.  D'oh.
7939         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
7941         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
7942         of __libc_locking_needed.
7943         (lll_trylock): Initialize %eax to zero.
7945         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
7946         pthread_cond_t definition.
7948 2003-03-10  Roland McGrath  <roland@redhat.com>
7950         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
7951         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
7952         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
7953         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
7954         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
7956         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
7957         Instead of setting PD->multiple_threads, set globals
7958         __pthread_multiple_threads and __libc_multiple_threads.
7959         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7960         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
7961         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
7963         * descr.h (struct pthread): Conditionalize first member on
7964         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
7965         containing an anonymous tcbhead_t.  Move `list' member out.
7966         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
7967         * allocatestack.c: Remove use of `header.data.' prefix.
7968         * pthread_create.c: Likewise.
7969         * init.c (__pthread_initialize_minimal_internal): Likewise.
7970         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7971         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
7972         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
7973         * sysdeps/x86_64/tls.h: Likewise.
7974         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7975         (SINGLE_THREAD_P): Likewise.
7976         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7977         (SINGLE_THREAD_P): Likewise.
7978         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
7979         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
7981 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
7983         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
7985         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
7986         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
7988         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
7989         leftovers from the ia32 code.
7991         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
7992         memory load.
7993         (clear_once_control): Don't load %esi.
7995         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
7996         handling.
7998         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8000         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8001         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8003         * Makefile (tests): Add tst-cond10.
8004         * tst-cond10.c: New file.
8006 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8008         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8009         * tst-signal3.c (do_test): Likewise.
8010         * tst-sem5.c (do_test): Likewise.
8011         * tst-kill6.c (do_test): Likewise.
8012         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8014         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8015         of inc/dec.
8016         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8017         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8018         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8019         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8020         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8021         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8022         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8023         Likewise.
8024         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8025         Likewise.
8026         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8027         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8028         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8029         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8030         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8031         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8032         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8033         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8035         * allocatestack.c (allocate_stack): If mprotect() fails free the
8036         TLS memory.
8038 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8040         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8042         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8043         lll_wake_tid.  This was used only to work around kernel limits in
8044         the early days.
8045         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8046         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8047         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8048         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8050         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8051         (__pthread_initialize_minimal_internal): Change initialization of
8052         __static_tls_align_m1 appropriately.
8053         * pthreadP.h (__static_tls_align_m1): Renamed from
8054         __static_tls_align.
8055         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8056         instead of __static_tls_align-1.
8058 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8060         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8062         * pthread_create.c: Define __pthread_keys using nocommon
8063         attribute, not by placing it explicitly in bss.
8064         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8066         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8067         Use it in mmap call to allocate stacks.
8069         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8071         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8072         result of the thread function.
8074 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8076         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8077         version is just fine.
8079         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8080         (__pthread_child_handler): Renamed from pthread_child_handler,
8081         exported, and marked hidden.  Change all users.
8082         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8083         free __pthread_child_handler from child list.
8085 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8087         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8089         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8090         Fix handling of cancellation and failing pthread_mutex_unlock call.
8091         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8092         (__pthread_cond_wait): Likewise.
8094         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8095         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8096         lll_futex_timed_wait call.
8097         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8098         (pthread_rwlock_timedwrlock): Likewise.
8100         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8101         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8102         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8104         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8105         check of lll_futex_wake return value.
8107 2003-03-03  Roland McGrath  <roland@redhat.com>
8109         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8111         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8112         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8113         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8115 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8117         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8118         error for CPU clocks.
8120         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8121         _POSIX_MONOTONIC_CLOCK.
8122         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8124         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8125         recent kernels.
8127 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8129         * descr.h (struct pthread): Move cleanup field to the front.
8131 2003-03-01  Roland McGrath  <roland@redhat.com>
8133         * sem_open.c (sem_open): Braino fix.
8135 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8137         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8139         __pthread_cleanup_pop functionality.
8140         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8142         * descr.h (struct pthread): Move tid field to the front now that
8143         it is often used.
8145         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8146         (__lll_mutex_timedlock_wait): Remove.
8147         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8148         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8149         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8150         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8151         (lll_unlock_wake_cb): Don't save and restore %esi.
8152         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8153         %esi.
8154         (__lll_timedwait_tid): Add alignment.
8155         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8156         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8157         %esi.
8158         (__lll_timedwait_tid): Removed.
8159         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8160         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8161         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8162         (pthread_barrier_wait): Don't save, load, and restore %esi for
8163         last thread.
8164         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8165         (__pthread_cond_signal): Don't save, load, and restore %esi.
8166         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8167         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8168         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8169         Don't save, load, and restore %esi.
8171 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8173         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8174         Release lock before waking up the waiters.
8176         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8178         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8179         (reader_thread): Likewise.
8181         * sysdeps/pthread/pthread_rwlock_unlock.c
8182         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8183         to wake up readers if there are none.
8185         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8186         Release internal lock before wake threads.
8188 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8190         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8191         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8192         predefined.
8193         * tst-rwlock9.c: Likewise.
8194         * tst-rwlock10.c: New file.
8195         * tst-rwlock11.c: New file.
8197         * Makefile (tests): Add tst-dlsym1.
8198         * tst-dlsym1.c: New file.
8200         * init.c (__pthread_initialize_minimal_internal): Set
8201         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8202         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8204 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8206         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8208         * tst-cond2.c: Fix sychronization with child.
8210         * tst-rwlock8.c (reader_thread): Remove unused variable.
8212         * Makefile: Add rules to build and run tst-tls3.
8213         * tst-tls3.c: New file.
8214         * tst-tls3mod.c: New file.
8216         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8217         * tst-rwlock8.c: New file.
8218         * tst-rwlock9.c: New file.
8219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8220         complete broken rwlock implementation.
8221         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8222         Likewise.
8223         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8224         Likewise.
8225         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8226         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8227         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8228         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8229         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8230         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8231         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8233 2003-02-23  Roland McGrath  <roland@redhat.com>
8235         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8237 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8239         * Makefile (tests): Add tst-context1.
8240         * tst-context1.c: New file.
8242         * Makefile (tests): Add tst-tls1 and tst-tls2.
8243         * tst-tls1.c: New file.
8244         * tst-tls2.c: New file.
8246         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8247         for failed cmpxchg.
8249         * pthread_create.c (start_thread): Set EXITING_BIT early.
8251         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8252         (THREAD_GETMEM_NC): Likewise.
8254 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8256         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8257         off 3 more bytes by using offset-less instructions when possible.
8259         * Makefile: Add dependency for $(objpfx)version.d.
8261         * eintr.c (eintr_source): Add unnecessary return but the compiler
8262         insists.
8264         * tst-kill3.c: Include <unistd.h>.
8266 2003-02-21  Roland McGrath  <roland@redhat.com>
8268         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8270 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8272         * Makefile (tests): Add tst-eintr1.
8273         (distribute): Add eintr.c.
8274         * tst-eintr1.c: New file.
8275         * eintr.c: New file.
8277         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8279         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8280         Disallow sending SIGCANCEL.
8282         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8283         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8284         * tst-kill1.c: New file.
8285         * tst-kill2.c: New file.
8286         * tst-kill3.c: New file.
8287         * tst-kill5.c: New file.
8288         * tst-kill6.c: New file.
8289         * tst-basic7.c: Renamed to...
8290         * tst-kill4.c: ...this.
8292 2003-02-21  Roland McGrath  <roland@redhat.com>
8294         * Makefile (install-lib-ldscripts): New variable.
8296 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8298         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8299         * pthread_cancel.c: Use INVALID_TD_P.
8300         * pthread_detach.c: Likewise.
8301         * pthread_getschedparam.c: Likewise.
8302         * pthread_setschedparam.c: Likewise.
8303         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8304         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8305         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8306         * pthread_timedjoin.c: Likewise.
8308         * tst-basic7.c: Include <signal.h>.
8310         * pthread_join.c (pthread_join): Limited checking for invalid
8311         descriptors.
8312         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8314 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8316         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8317         beginning of the loop.  Clear the entire first block of TSD.
8318         * Makefile (tests): Add tst-key4.
8319         * tst-key4.c: New file.
8321 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8323         * Makefile (tests): Add tst-basic7.
8324         * tst-basic7.c: New file.
8326         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8327         Add some more __builtin_expect.
8329         * pthreadP.h: Define dummy version of DEBUGGING_P.
8331 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8333         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8334         _POSIX_THREAD_PRIORITY_SCHEDULING.
8335         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8336         _XOPEN_REALTIME_THREADS.
8337         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8339         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8340         kernel returns EINVAL for PID <= 0, work around it.
8342         * Makefile (tests): Add tst-signal5.
8343         * tst-signal5.c: New file.
8345         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8346         and LOGIN_NAME_MAX.
8348         * tst-cancel1.c (tf): Block all signals.
8350         * Makefile (tests): Add tst-basic6.
8351         * tst-basic6.c: New file.
8353         * tst-basic1.c: Add test for process ID.
8355         * Makefile (tests): Add tst-cancel10.
8356         * tst-cancel10.c: New file.
8358         * Makefile (tests): Add tst-signal4.
8359         * tst-signal4.c: New file.
8361         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8362         __sigismember instead of sigismember.  Add __builtin_expect.
8364 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8366         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8367         pthread_setcancelstate, and pthread_rwlock_setpshared.
8369         * tst-cancel7.c (do_test): Make sure the pid file exists before
8370         canceling the thread.
8372         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8373         pthread_rwlock_timedrdlock tests.
8374         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8375         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8376         Check for invalid tv_nsec field.
8377         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8378         Likewise.
8380         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8381         recursive mutex of overflow.
8383         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8385         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8386         going into an endless loop.
8387         * Makefile (tests): Add tst-cancel9.
8388         * tst-cancel9.c: New file.
8390         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8392 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8394         * tst-mutex5.c (do_test): Add more timedlock tests.
8396         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8397         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8399         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8400         use INLINE_SYSCALL.  Error number is returned, not -1.
8402         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8403         and __deallocate_stack with internal_function.
8404         * pthread_create.c: Adjust definitions appropriately.
8405         * allocatestack.c: Likewise.
8407         * pthread_join.c: Add one more __builtin_expect.
8408         * pthread_timedjoin.c: Likewise.
8410         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8411         not data of sequence number does not match.
8412         Add one __builtin_expect.
8414         * Makefile (tests): Add tst-clock1.
8415         * tst-clock1.c: New file.
8417         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8418         negative arguments.
8419         * Makefile (tests): Add tst-basic5.
8420         * tst-basic5.c: New file.
8422 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8424         * Makefile (tests): Add tst-basic4.
8425         * tst-basic4.c: New file.
8427         * pthreadP.h: Add declaraction for __nptl_nthreads.
8428         * pthread_create.c: Define __nptl_nthreads
8429         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8430         after thread is done.  If then zero, call exit(0).
8431         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8432         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8433         * init.c (pthread_functions): Initialize ptr_nthreads.
8434         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8435         (__reclaim_stacks): Decrement __nptl_nthreads.
8436         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8437         Define.
8438         * Makefile (tests): Add tst-basic3.
8439         * tst-basic3.c: New file.
8441         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8442         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8443         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8444         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8445         if asynchronous canceling is enabled.
8446         * pthread_join.c (pthread_join): When recognizing circular joins,
8447         take into account the other thread might be already canceled.
8448         * Makefile (tests): Add tst-join5.
8449         * tst-join5.c: New file.
8451         * Makefile (tests): Add tst-join4.
8452         * tst-join4.c: New file.
8454 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8456         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8458 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8460         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8461         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8462         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8463         warning.
8464         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8465         to avoid warning.
8466         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8467         error if lll_futex_wake failed.
8469 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8471         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8472         handling of cancellation and failung pthread_mutex_unlock call.
8473         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8474         * Makefile (tests): Add tst-cond8 and tst-cond9.
8475         * tst-cond8.c: New file.
8476         * tst-cond9.c: New file.
8478         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8480         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8481         non-standard initializers with __USE_GNU.
8483         * Makefile (tests): Add tst-cleanup3.
8484         * tst-cleanup3.c: New file.
8486 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8488         * Makefile (tests): Add tst-attr1 and tst-attr2.
8489         * tst-attr1.c: New file.
8490         * tst-attr2.c: New file.
8492         * Makefile: Add rules to build and run tst-atfork2 test.
8493         * tst-atfork2.c: New file.
8494         * tst-atfork2mod.c: New file.
8496         * sysdeps/unix/sysv/linux/unregister-atfork.c
8497         (__unregister_atfork): Free the memory allocated for the handlers
8498         after removing them from the lists.
8500         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8501         cleanup function.
8503         * tst-atfork1.c (do_test): Wait for the child we forked.
8504         Report error in child.
8506         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8508         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8510 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8512         * Makefile (tests): Add tst-cancel8.
8513         * tst-cancel8.c: New file.
8515         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8516         clearing of control variable.
8517         * Makefile (tests): Add tst-once3 and tst-once4.
8518         * tst-once3.c: New file.
8519         * tst-once4.c: New file.
8521 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8523         * sysdeps/sh/Makefile: New file.
8524         * sysdeps/sh/bits/atomic.h: New file.
8525         * sysdeps/sh/pthread_spin_init.c: New file.
8526         * sysdeps/sh/pthread_spin_lock.c: New file.
8527         * sysdeps/sh/pthread_spin_trylock.S: New file.
8528         * sysdeps/sh/pthread_spin_unlock.S: New file.
8529         * sysdeps/sh/pthreaddef.h: New file.
8530         * sysdeps/sh/tcb-offsets.sym: New file.
8531         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8532         * sysdeps/sh/tls.h: New file.
8533         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8534         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8535         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8536         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8537         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8538         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8539         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8540         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8541         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8542         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8543         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8544         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8545         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8546         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8547         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8548         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8549         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8550         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8551         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8552         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8553         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8554         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8555         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8556         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8557         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8558         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8559         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8560         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8561         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8562         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8564 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8566         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8567         according to POSIX.
8569         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8571 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8573         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8574         (TLS_GET_FS): New #define.
8575         (TLS_SET_FS): New #define.
8576         Correct value of __NR_set_thread_area.
8578         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8580 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8582         * Makefile (tests): Add tst-popen1.
8583         * tst-popen1.c: New file.
8585         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8586         but inactive generalization.
8587         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8588         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8589         Minor optimization, remove one instruction.
8590         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8592 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8594         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8596 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8598         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8599         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8600         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8601         * sysdeps/pthread/pthread_cond_signal.c: New file.
8602         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8603         * sysdeps/pthread/pthread_cond_wait.c: New file.
8604         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8605         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8606         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8607         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8608         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8609         * sysdeps/s390/Makefile: New file.
8610         * sysdeps/s390/bits/atomic.h: New file.
8611         * sysdeps/s390/pthread_spin_init.c: New file.
8612         * sysdeps/s390/pthread_spin_lock.c: New file.
8613         * sysdeps/s390/pthread_spin_trylock.c: New file.
8614         * sysdeps/s390/pthread_spin_unlock.c: New file.
8615         * sysdeps/s390/pthreaddef.h: New file.
8616         * sysdeps/s390/tcb-offsets.sym: New file.
8617         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8618         * sysdeps/s390/tls.h: New file.
8619         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8620         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8621         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8622         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8623         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8624         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8625         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8626         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8627         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8628         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8629         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8630         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8631         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8632         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8633         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8634         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8635         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8636         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8637         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8638         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8639         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8640         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8641         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8643 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8645         * atomic.h: Add a couple more default implementations.
8646         (atomic_compare_and_exchange_acq): Use
8647         __arch_compare_and_exchange_32_acq in return value definition.  It
8648         always exists.
8649         (atomic_bit_set): Renamed from atomic_set_bit.
8650         Add missing atomic_ prefixes.
8652         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8653         thread library is available, use correct value to mark initialized
8654         once variable.
8656 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8658         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8659         __sysconf to determine pagesize.
8661         * pthread_create.c: Include <atomic.h>.
8662         * allocatestack.c (allocate_stack): Implement coloring of the
8663         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8664         size minus one.  Adjust users.
8665         * sysdeps/i386/i686/Makefile: New file.
8667 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
8669         * allocatestack.c: Improve comment throughout the file.
8671         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8672         (__lll_lock_wait): Add branch prediction.
8673         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8674         (__lll_lock_wait): Likewise.
8675         (lll_unlock_wake_cb): Removed.
8677 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
8679         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
8680         _POSIX_THREAD_PRIORITY_SCHEDULING.
8682 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
8684         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8685         Fix return type of ptr___pthread_getspecific.
8687 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
8689         * Makefile (tests): Add tst-umask1.
8690         (tst-umask1-ARGS): Define.
8691         * tst-umask1.c: New file.
8693 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
8695         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
8696         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
8697         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
8698         pthread_rwlock_unlock.
8699         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
8700         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
8701         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
8702         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
8703         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8704         New file.
8705         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
8706         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8707         New file.
8708         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
8709         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
8710         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
8711         New file.
8712         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
8713         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
8714         New file.
8715         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
8716         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
8717         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
8718         New file.
8719         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
8720         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
8721         New file.
8722         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
8724         * Makefile (libpthread-routines): Remove lowlevelcond and
8725         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
8726         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
8727         and pthread_cond_broadcast.
8728         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
8729         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
8730         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
8731         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
8732         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
8733         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
8734         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
8735         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
8736         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
8737         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
8738         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
8739         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
8740         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
8741         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
8742         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
8743         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
8744         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
8745         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
8746         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
8747         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
8748         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
8749         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
8750         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
8751         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
8752         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
8753         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
8754         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
8755         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
8756         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
8757         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
8758         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
8760         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
8761         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
8762         of the code is moved to ...
8763         * sysdeps/pthread/createthread.c: ...here.  New file.
8765 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
8767         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
8768         (__new_sem_post): Clear %eax before returning.
8769         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
8771         * Makefile (tests): Add tst-cleanup2.
8772         * tst-cleanup2.c: New file.
8774         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
8775         Interpret first parameter correctly.
8777 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
8779         * Makefile (headers): Add bits/semaphore.h.
8781 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
8783         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
8784         if not SHARED.
8786 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
8788         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
8789         must be used and mapping failed.
8790         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
8792         * Makefile (CFLAGS-pthread_self.os): Define this, not
8793         CFLAGS-pthread_self.c.
8795 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8797         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
8798         lll_unlock_wake_cb.
8800         * Makefile (libpthread-routines): Add version.  Add rules to build
8801         version.os and banner.h.
8802         * version.c: New file.
8804 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
8806         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
8807         the alias unconditional.
8808         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
8810 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8812         * Makefile (CFLAGS-pthread_self.c): New definition.
8814 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8816         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
8817         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
8818         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
8819         * init.c (__pthread_initialize_minimal_internal): Likewise.
8821 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
8823         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
8825         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
8826         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8827         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8828         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
8829         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8830         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8832 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8834         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
8835         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
8836         * tst-cancel-wrappers.sh: Remove all exceptions.
8838 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
8840         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
8841         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
8843         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
8844         Use __libc_pthread_functions array if SHARED.
8846         * pthreadP.h: Move pthread_cond_2_0_t definition to...
8847         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
8849         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
8850         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
8851         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
8852         __libc_ptf_call instead of __libc_maybe_call.
8853         (PTF): New #define.
8854         (__libc_cleanup_region_start): Wrap function name with PTF call.
8855         (__libc_cleanup_region_end): Likewise.
8856         (__libc_cleanup_end): Likewise.
8858         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
8859         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
8860         * pthread_key_create.c: Add __pthread_key_create_internal alias.
8861         * pthreadP.h: Add prototypes.
8863         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
8864         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
8865         __pthread_rwlock_unlock aliases.
8866         * pthreadP.h: Add prototypes for new aliases.
8868         * pthreadP.h (struct pthead_functions): Moved to...
8869         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
8870         * init.c (pthread_functions): Add initializers for new elements.
8872         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
8873         __pthread_cleanup_pop_restore aliases.
8874         * pthreadP.h: Add prototypes.
8876         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
8877         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
8878         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
8879         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
8880         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8881         * pthreadP.h: Adjust prototypes and callers.
8883 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
8885         * Makefile (tests): Add tst-cancel7.
8886         (tst-cancel7-ARGS): New variable.
8887         * tst-cancel7.c: New file.
8889         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
8890         around gcc defficiencies.
8891         * old_pthread_cond_signal.c: Likewise.
8892         * old_pthread_cond_timedwait.c: Likewise.
8893         * old_pthread_cond_wait.c: Likewise.
8895         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
8897 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
8899         * Makefile (tests): Add tst-cond7.
8900         * tst-cond7.c: New file.
8902         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
8903         (condvar_cleanup): Get condvar address from the right place.
8905         * atomic.h: Correct definitions of atomic_full_barrier,
8906         atomic_read_barrier, atomic_write_barrier.
8908         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
8909         race-free.
8910         * old_pthread_cond_signal.c: Likewise.
8911         * old_pthread_cond_timedwait.c: Likewise.
8912         * old_pthread_cond_wait.c: Likewise.
8914 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
8916         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
8918 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
8920         * pthreadP.h (pthread_cond_2_0_t): New type.
8921         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
8922         Use new type for the 2.0 condvar function prototypes.
8923         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
8924         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
8925         parameter.
8926         * old_pthread_cond_destroy.c: Likewise.
8927         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
8928         * old_pthread_cond_signal.c: Likewise.
8929         * old_pthread_cond_timedwait.c: Likewise.
8930         * old_pthread_cond_wait.c: Likewise.
8932         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
8933         (__pthread_cond_wait): Don't save cancellation mode and seq value
8934         in same location.
8936         * herrno.c (__h_errno_location): Don't define as weak.
8938 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
8940         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
8941         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
8942         and pthread_cond_wait.
8943         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
8944         Renamed to...
8945         (__pthread_cond_broadcast_2_0): ... this.
8946         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
8947         Renamed to...
8948         (__pthread_cond_destroy_2_0): ... this.
8949         * old_pthread_cond_init.c (__old_pthread_cond_init):
8950         Renamed to...
8951         (__pthread_cond_init_2_0): ... this.
8952         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
8953         Renamed to...
8954         (__pthread_cond_signal_2_0): ... this.
8955         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
8956         Renamed to...
8957         (__pthread_cond_wait_2_0): ... this.
8958         * pthread_cond_destroy.c: Include shlib-compat.h.
8959         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
8960         * pthread_cond_init.c: Include shlib-compat.h.
8961         (pthread_cond_init): Change strong_alias into versioned_symbol.
8962         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
8963         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
8964         fields.
8965         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
8966         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
8967         __pthread_cond_wait_2_0): New prototypes.
8968         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
8969         __old_pthread_cond_init, __old_pthread_cond_signal,
8970         __old_pthread_cond_wait): Removed.
8971         * init.c: Include shlib-compat.h.
8972         (pthread_functions): Guard ptr___pthread_attr_init_2_0
8973         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
8974         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
8975         ptr___pthread_cond_*_2_0 fields.
8976         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
8977         pthread_cond_*@GLIBC_2.0 compatibility symbols.
8979         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
8980         LIBC_SIGACTION was not yet defined.
8981         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
8982         [!defined LIBC_SIGACTION] (__sigaction): New function and
8983         libc_hidden_weak.
8984         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
8985         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
8987 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
8989         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
8991 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
8993         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8994         New, larger type definition.
8995         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
8996         implementation.
8997         * Versions [libpthread]: Add definitions for new pthread_cond_*
8998         interfaces for version GLIBC_2.3.2.
8999         * pthread_cond_init.c: Update initialization for new type definition.
9000         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9001         pthread_cond_timedwait, pthread_cond_signal, and
9002         pthread_cond_broadcast.  Add old_pthread_cond_init,
9003         old_pthread_cond_destroy, old_pthread_cond_wait,
9004         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9005         old_pthread_cond_broadcast.
9006         * old_pthread_cond_broadcast.c: New file.
9007         * old_pthread_cond_destroy.c: New file.
9008         * old_pthread_cond_init.c: New file.
9009         * old_pthread_cond_signal.c: New file.
9010         * old_pthread_cond_timedwait.c: New file.
9011         * old_pthread_cond_wait.c: New file.
9012         * pthreadP.h: Add prototypes for the compatibility interfaces.
9014         * pthread_cond_destroy.c: Don't include <errno.h>.
9016 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9018         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9019         unnecessary zero offset when addressing MUTEX.
9021 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9023         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9024         __register_atfork.
9025         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9026         for __register_atfork.
9028 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9030         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9031         instead of ASSEMBLER test macro.
9033         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9034         __libc_current_sigrtmax): Add libc_hidden_def.
9036         * sysdeps/pthread/list.h: Remove assert.h include.
9038 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9040         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9041         __pthread_initialize_minimal_internal not
9042         __pthread_initialize_minimal.
9044 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9046         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9047         __pthread_initialize_minimal as hidden.
9049         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9050         constructor.
9052 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9054         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9055         $(common-objpfx)format.lds, include that into the output script.
9056         Fix comment.
9057         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9059 2002-12-28  Andreas Jaeger  <aj@suse.de>
9061         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9062         nsec resolution changes.
9063         (xstat64_conv): Likewise.
9064         (xstat32_conv): Likewise.
9065         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9066         struct kernel_stat.
9067         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9068         structs stat and stat64.
9069         * time/time.h (__timespec_defined): Define for __USE_MISC.
9070         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9072 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9074         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9075         argument.
9076         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9077         (pthread_exit): Use strong_alias to avoid warnings.
9078         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9079         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9080         ptr___pthread_attr_init_2_*.
9081         * init.c (pthread_functions): Adjust.
9083 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9085         * forward.c: Make all functions available by default again.  It
9086         caused too much trouble.
9088         * pt-siglongjmp.c: Removed.
9090 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9092         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9093         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9094         * sysdeps/i386/Makefile: New file.
9095         * sysdeps/i386/tcb-offsets.sym: New file.
9096         * sysdeps/pthread/tcb-offsets.h: New file.
9097         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9098         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9100         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9101         __register_atfork...
9102         (GLIBC_2.3.2): ...here.
9104 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9106         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9107         pthread_attr_setstackaddr with __attribute_deprecated__.
9109 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9111         * pt-system.c (system): Remove cancellation handling.
9112         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9113         cancellation routines.
9115 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9117         * descr.h: Include <dl-sysdep.h>.
9118         (struct pthread): Move header.data.list to the back of the struct.
9119         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9120         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9121         (SYSINFO_OFFSEET): Likewise.
9123 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9125         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9126         Define.
9127         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9128         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9129         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9130         (USE_DL_SYSINFO): Undef.
9132 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9134         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9135         $(common-objpfx)libc.so.
9136         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9137         it is bigger than pipe buffer size even on arches with bigger
9138         page size.
9139         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9141 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9143         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9144         correct errno access for case that USE___THREAD is not defined.
9146 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9148         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9149         Patch by Marijn Ros <marijn@mad.scientist.com>.
9151 2002-12-22  Roland McGrath  <roland@redhat.com>
9153         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9155 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9157         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9159 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9161         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9162         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9163         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9165         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9166         of int $0x80.
9167         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9168         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9169         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9170         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9171         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9172         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9173         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9174         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9176         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9177         sysenter.
9178         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9180         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9182         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9183         in new TCB.
9184         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9185         that sysinfo is properly initialized.
9186         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9187         to 1 only for ld.so.
9189         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9190         RTLD_CORRECT_DYNAMIC_WEAK.
9192 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9194         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9195         Use return 0 as 6th argument to FORWARD4.
9196         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9198 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9200         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9201         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9202         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9203         (INIT_SYSINFO): New #define.
9204         (TLS_TP_INIT): Use INIT_SYSINFO.
9205         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9206         At test to make sure SYSINFO_OFFSET value is correct.
9207         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9209 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9211         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9212         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9213         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9214         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9215         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9216         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9217         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9219 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9221         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9222         macro instead of using int $0x80 directly.
9224         * sysdeps/pthread/bits/stdio-lock.h: New file.
9225         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9226         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9227         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9228         * Makefile (routines): Add libc-lowlevelmutex.
9230         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9231         __i686.get_pc_thunk.dx.
9233 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9235         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9236         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9237         ($(objpfx)tst-cancel-wrappers.out): New rule.
9238         * tst-cancel-wrappers.sh: New test.
9239         * tst-locale1.c: Include signal.h.
9240         (uselocale): Test static linking of __libc_current_sigrt*.
9242 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9244         * Makefile (tests): Add tst-cancel6.
9245         * tst-cancel6.c: New file
9247 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9249         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9250         Define meaningfully for assembler as well.
9251         * pthreadP.h (struct pthread_functions): Remove
9252         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9253         and ptr_pthread_attr_init_2_1 fields.
9254         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9255         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9256         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9257         (FORWARD3): Define using FORWARD4.
9258         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9259         versions.
9260         * pt-system.c: Remove duplicate stdlib.h include.
9262 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9264         * sem_init.c: Define sem_init@GLIBC_2.0.
9265         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9266         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9268         * flockfile.c: Moved to...
9269         * sysdeps/pthread/flockfile.c: ...here.  New file.
9270         * funlockfile.c: Moved to...
9271         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9272         * ftrylockfile.c: Moved to...
9273         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9275 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9277         * libc-cancellation.c: Guard both function with
9278         #if !defined NOT_IN_libc.
9279         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9280         automatically provided pthread wrappers.
9281         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9282         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9283         nor in libpthread.
9284         * pt-open.c: Removed.
9285         * pt-fcntl.c: Removed.
9286         * pt-fsync.c: Removed.
9287         * pt-lseek.c: Removed.
9288         * pt-msgrcv.c: Removed.
9289         * pt-msgsnd.c: Removed.
9290         * pt-msync.c: Removed.
9291         * pt-nanosleep.c: Removed.
9292         * pt-open64.c: Removed.
9293         * pt-pause.c: Removed.
9294         * pt-pread.c: Removed.
9295         * pt-pread64.c: Removed.
9296         * pt-pwrite.c: Removed.
9297         * pt-pwrite64.c: Removed.
9298         * pt-read.c: Removed.
9299         * pt-recv.c: Removed.
9300         * pt-recvfrom.c: Removed.
9301         * pt-recvmsg.c: Removed.
9302         * pt-send.c: Removed.
9303         * pt-sendto.c: Removed.
9304         * pt-sigtimedwait.c: Removed.
9305         * pt-sigwait.c: Removed.
9306         * pt-wait.c: Removed.
9307         * pt-waitpid.c: Removed.
9308         * pt-write.c: Removed.
9309         * pt-accept.c: Removed.
9310         * pt-close.c: Removed.
9311         * pt-connect.c: Removed.
9312         * pt-lseek64.c: Removed.
9313         * pt-sendmsg.c: Removed.
9314         * pt-tcdrain.c: Removed.
9316 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9318         * init.c (__pthread_initialize_minimal_internal): Renamed from
9319         __pthread_initialize_minimal.  Make old name an alias.  This
9320         converts a normal relocation into a relative relocation.
9322         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9324         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9325         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9326         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9327         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9328         pt-sigwaitinfo, pt-waitid, and pt-writev.
9329         * pt-creat.c: Removed.
9330         * pt-poll.c: Removed.
9331         * pt-pselect.c: Removed.
9332         * pt-readv.c: Removed.
9333         * pt-select.c: Removed.
9334         * pt-sigpause.c: Removed.
9335         * pt-sigsuspend.c: Removed.
9336         * pt-sigwaitinfo.c: Removed.
9337         * pt-waitid.c: Removed.
9338         * pt-writev.c: Removed.
9340         * init.c (pthread_functions): New variable.
9341         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9342         (or NULL) to __libc_pthread_init.
9343         * forward.c: Rewrite to use __libc:pthread_functions array to get
9344         function addresses.
9345         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9346         prototype.
9347         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9348         Take new parameter.  Copy content of variable pointed to by it
9349         to __libc_pthread_init.
9351         * pthreadP.h (struct pthread_functions): New type.
9352         (__libc_pthread_init): Declare.
9354         * pthread_attr_destroy.c: Add namespace protected alias.
9355         * pthread_attr_getdetachstate.c: Likewise.
9356         * pthread_attr_getinheritsched.c: Likewise.
9357         * pthread_attr_getschedparam.c: Likewise.
9358         * pthread_attr_getschedpolicy.c: Likewise.
9359         * pthread_attr_getscope.c: Likewise.
9360         * pthread_attr_setdetachstate.c: Likewise.
9361         * pthread_attr_setinheritsched.c: Likewise.
9362         * pthread_attr_setschedparam.c: Likewise.
9363         * pthread_attr_setschedpolicy.c: Likewise.
9364         * pthread_attr_setscope.c: Likewise.
9365         * pthread_cond_broadcast.c: Likewise.
9366         * pthread_cond_destroy.c: Likewise.
9367         * pthread_cond_init.c: Likewise.
9368         * pthread_cond_signal.c: Likewise.
9369         * pthread_cond_wait.c: Likewise.
9370         * pthread_condattr_destroy.c: Likewise.
9371         * pthread_condattr_init.c: Likewise.
9372         * pthread_equal.c: Likewise.
9373         * pthread_exit.c: Likewise.
9374         * pthread_getschedparam.c: Likewise.
9375         * pthread_self.c: Likewise.
9376         * pthread_setcancelstate.c: Likewise.
9377         * pthread_setschedparam.c: Likewise.
9378         * pthread_mutex_destroy.c: Likewise.
9379         * pthread_mutex_init.c: Likewise.
9380         * pthreadP.h: Add prototypes for the aliases.
9382         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9383         multiple_threads member in correct TCB to 1.
9385         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9386         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9387         member of thread decriptor, otherwise return unconditionally 1.
9389 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9391         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9392         regular Linux version.  Remove file.
9393         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9394         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9395         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9396         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9397         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9398         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9399         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9400         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9401         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9402         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9403         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9404         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9405         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9406         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9407         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9408         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9409         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9410         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9411         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9412         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9413         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9414         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9415         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9416         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9417         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9418         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9419         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9420         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9421         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9422         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9424 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9426         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9427         * sysdeps/unix/sysv/linux/open.c: Removed.
9428         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9429         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9430         * sysdeps/unix/sysv/linux/msync.c: Removed.
9431         * sysdeps/unix/sysv/linux/read.c: Removed.
9432         * sysdeps/unix/sysv/linux/close.c: Removed.
9433         * sysdeps/unix/sysv/linux/creat.c: Removed.
9434         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9435         * sysdeps/unix/sysv/linux/pause.c: Removed.
9436         * sysdeps/unix/sysv/linux/select.c: Removed.
9437         * sysdeps/unix/sysv/linux/write.c: Removed.
9439 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9441         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9442         element in TCB to see whether locking is needed.
9444         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9445         MULTIPLE_THREADS_OFFSET value is correct.
9447         * sysdeps/unix/sysv/linux/close.c: New file.
9448         * sysdeps/unix/sysv/linux/connect.S: New file.
9449         * sysdeps/unix/sysv/linux/creat.c: New file.
9450         * sysdeps/unix/sysv/linux/fsync.c: New file.
9451         * sysdeps/unix/sysv/linux/llseek.c: New file.
9452         * sysdeps/unix/sysv/linux/lseek.c: New file.
9453         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9454         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9455         * sysdeps/unix/sysv/linux/msync.c: New file.
9456         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9457         * sysdeps/unix/sysv/linux/open.c: New file.
9458         * sysdeps/unix/sysv/linux/open64.c: New file.
9459         * sysdeps/unix/sysv/linux/pause.c: New file.
9460         * sysdeps/unix/sysv/linux/poll.c: New file.
9461         * sysdeps/unix/sysv/linux/pread.c: New file.
9462         * sysdeps/unix/sysv/linux/pread64.c: New file.
9463         * sysdeps/unix/sysv/linux/pselect.c: New file.
9464         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9465         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9466         * sysdeps/unix/sysv/linux/readv.c: New file.
9467         * sysdeps/unix/sysv/linux/recv.S: New file.
9468         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9469         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9470         * sysdeps/unix/sysv/linux/select.c: New file.
9471         * sysdeps/unix/sysv/linux/send.S: New file.
9472         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9473         * sysdeps/unix/sysv/linux/sendto.S: New file.
9474         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9475         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9476         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9477         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9478         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9479         * sysdeps/unix/sysv/linux/system.c: New file.
9480         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9481         * sysdeps/unix/sysv/linux/wait.c: New file.
9482         * sysdeps/unix/sysv/linux/waitid.c: New file.
9483         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9484         * sysdeps/unix/sysv/linux/writev.c: New file.
9485         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9487         * pt-readv.c: Fix comment.
9489 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9491         * tst-cleanup1.c: Include stdlib.h.
9493         * tst-cancel5.c: New test.
9494         * Makefile (tests): Add tst-cancel5.
9495         (tst-cancel5): Link against libc.so libpthread.so in that order.
9497 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9499         * forward.c (test_loaded): Prevent recursive calls.
9501         * Makefile (routines): Add libc-cancellation.
9502         * libc-cancellation.c: New file.
9503         * descr.h (struct pthread): Add multiple_threads field.
9504         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9505         new thread descriptor to 1.
9506         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9507         Initialize multiple_thread field after successful thread creation.
9508         * cancellation.c (__do_cancel): Move to pthreadP.h.
9509         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9510         (__pthread_disable_asynccancel): Add internal_function attribute.
9511         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9512         * pthread_setcancelstate.c: Likewise.
9513         * pthread_setcanceltype.c: Likewise.
9514         * pthread_exit.c: Likewise.
9515         * pthreadP.h (CANCELLATION_P): Likewise.
9516         (__do_cancel): Define as static inline.
9517         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9518         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9519         declarations.
9520         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9521         fields.  Define MULTIPLE_THREADS_OFFSET.
9522         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9523         declaration.
9524         * sysdeps/unix/sysv/linux/accept.S: New file.
9525         * sysdeps/unix/sysv/linux/read.c: New file.
9526         * sysdeps/unix/sysv/linux/write.c: New file.
9527         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9528         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9529         initialization of __libc_locking_needed.
9530         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9531         __libc_locking_needed, use multiple_threads field in TCB.
9532         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9534 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9536         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9537         version.
9538         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9540         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9541         access to __libc_locking_needed for PIC.
9543 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9545         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9546         declare for libc.so.
9547         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9548         expression.
9549         (__libc_lock_lock): Put into statement expression.
9550         (__libc_lock_unlock): Remove trailing semicolon.
9551         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9553 2002-12-12  Roland McGrath  <roland@redhat.com>
9555         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9556         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9558 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9560         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9561         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9562         Initialize __libc_locking_needed.
9563         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9564         instead of __register_pthread_fork_handler.
9565         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9566         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9567         fork-gen with libc_pthread_init.
9568         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9569         of __register_pthread_fork_handler.
9570         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9571         of __register_pthread_fork_handler.
9572         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9573         __libc_locking_needed to determine whether lock prefix can be avoided.
9574         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9576 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9578         * Makefile (tests): Add tst-cleanup1.
9579         * tst-cleanup1.c: New file.
9580         * cancellation.c (__cleanup_thread): Removed.
9581         (__do_cancel): Remove call to __cleanup_thread.
9582         * pthreadP.h: Remove __cleanup_thread prorotype.
9584         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9585         Remember function and argument even if cancellation handler
9586         function is not available.
9587         (__libc_cleanup_region_end): Execute registered function directly if
9588         pthread functions are not available.
9589         (__libc_cleanup_end): Likewise.
9591         * init.c (__pthread_initialize_minimal): Fix initialization in
9592         static lib by preventing gcc from being too clever.
9594 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9596         * init.c (__pthread_initialize_minimal): Remove unneccesary
9597         sigaddset call.
9599         * Makefile (tests): We can run tst-locale2 now.
9601 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9603         * Versions: Remove duplicated sigwait entry.
9605 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9607         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9608         inside libpthread.
9610         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9612         * pthreadP.h: Declare __pthread_enable_asynccancel and
9613         __pthread_disable_asynccancel.
9614         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9615         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9616         * cancellation.c (__pthread_enable_asynccancel): New function.
9617         (__pthread_disable_asynccancel): New function.
9618         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9619         * pt-close.c: Likewise.
9620         * pt-connect.c: Likewise.
9621         * pt-creat.c: Likewise.
9622         * pt-fcntl.c: Likewise.
9623         * pt-fsync.c: Likewise.
9624         * pt-lseek.c: Likewise.
9625         * pt-lseek64.c: Likewise.
9626         * pt-msgrcv.c: Likewise.
9627         * pt-msgsnd.c: Likewise.
9628         * pt-msync.c: Likewise.
9629         * pt-nanosleep.c: Likewise.
9630         * pt-open.c: Likewise.
9631         * pt-open64.c: Likewise.
9632         * pt-pause.c: Likewise.
9633         * pt-poll.c: Likewise.
9634         * pt-pread.c: Likewise.
9635         * pt-pread64.c: Likewise.
9636         * pt-pselect.c: Likewise.
9637         * pt-pwrite.c: Likewise.
9638         * pt-pwrite64.c: Likewise.
9639         * pt-read.c: Likewise.
9640         * pt-readv.c: Likewise.
9641         * pt-recv.c: Likewise.
9642         * pt-recvfrom.c: Likewise.
9643         * pt-recvmsg.c: Likewise.
9644         * pt-select.c: Likewise.
9645         * pt-send.c: Likewise.
9646         * pt-sendmsg.c: Likewise.
9647         * pt-sendto.c: Likewise.
9648         * pt-sigpause.c: Likewise.
9649         * pt-sigsuspend.c: Likewise.
9650         * pt-sigtimedwait.c: Likewise.
9651         * pt-sigwait.c: Likewise.
9652         * pt-sigwaitinfo.c: Likewise.
9653         * pt-system.c: Likewise.
9654         * pt-tcdrain.c: Likewise.
9655         * pt-wait.c: Likewise.
9656         * pt-waitid.c: Likewise.
9657         * pt-waitpid.c: Likewise.
9658         * pt-write.c: Likewise.
9659         * pt-writev.c: Likewise.
9660         * pthread_join.c: Likewise.
9661         * pthread_timedjoin.c: Likewise.
9663         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9664         (__xpg_sigpause): New function.
9665         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9667 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
9669         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
9671         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
9672         _GI_pthread_cleanup_pop to pthreadP.h.
9674         * ftrylockfile.c: Use _IO_lock_trylock instead of
9675         pthread_mutex_trylock.
9677         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
9678         (CANCEL_RESET): Likewise.
9679         (__pthread_setcanceltype_): Declare.
9680         (__pthread_mutex_lock_internal): Declare.
9681         (__pthread_mutex_unlock_internal): Declare.
9682         (__pthread_once_internal): Declare.
9683         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
9684         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
9686         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
9687         and pthread_mutex_unlock.
9688         * pthread_cond_wait.c: Likewise.
9689         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
9690         * pthread_mutex_unlock.c: Likewise.
9692         * pthread_setcanceltype.c: Add additional alias
9693         __pthread_setcanceltype.
9695         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
9696         * sem_open.c (sem_open): Likewise.
9697         Use __libc_open, __libc_write, and __libc_close instead of
9698         open, write, and close respectively.
9700         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
9701         Rewrite as statement expression since it must return a value.
9703         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
9704         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
9705         __pthread_kill.
9707         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
9708         alias __pthread_once_internal.
9710         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
9712 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
9714         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
9715         * tst-stdio1.c: New file.
9716         * tst-stdio2.c: New file.
9718         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
9720         * Makefile (tests): Comment out tst-locale2 for now.
9721         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
9723         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
9724         -D_IO_MTSAFE_IO.
9725         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
9726         Use _IO_lock_init instead of explicit assignment.
9728         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
9729         Define __libc_lock_* and __libc_lock_recursive macros with
9730         lowlevellock macros, not pthread mutexes.
9732         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
9733         of pthread_mutex_lock.
9734         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
9735         instead of pthread_mutex_unlock.
9737 2002-12-06  Roland McGrath  <roland@redhat.com>
9739         * allocatestack.c (__stack_user): Use uninitialized defn.
9740         * init.c (__pthread_initialize_minimal): Initialize it here.
9742 2002-12-05  Roland McGrath  <roland@redhat.com>
9744         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
9745         string.
9746         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
9748         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
9749         missing & here too.
9751 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
9753         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9754         lowlevellock.
9755         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
9756         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
9757         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
9758         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
9759         for __libc_lock_* macros.
9760         * Makefile (routines): Add libc-lowlevellock.
9762 2002-10-09  Roland McGrath  <roland@redhat.com>
9764         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
9765         Under [__PIC__], call the function via the pointer fetched for
9766         comparison rather than a call by name that uses the PLT.
9767         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
9768         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
9769         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
9770         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
9771         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
9773 2002-12-04  Roland McGrath  <roland@redhat.com>
9775         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
9777         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
9778         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
9780         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
9782 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9784         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
9785         a completely opaque, non-integer type.
9786         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9788 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
9790         * sysdeps/i386/tls.h: Include stdlib.h.
9791         * sysdeps/x86_64/tls.h: Likewise.
9793 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9795         * Makefile (tests): Add tst-locale2.
9796         (tests-static): Likewise.
9797         * tst-locale2.c: New file.
9799         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
9800         volatile and add memory clobbers to lock operations.
9802 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
9804         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
9805         * sysdeps/i386/i486/bits/atomic.h: New file.
9806         * sysdeps/i386/i586/bits/atomic.h: New file.
9807         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
9808         include i486 version.
9809         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
9810         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
9811         Patch by Marijn Ros <marijn@mad.scientist.com>.
9813         * allocatestack.c (get_cached_stack): Don't crash if we first
9814         found a stack with a larger size then needed.
9815         Reported by Hui Huang <hui.huang@sun.com>.
9817         * Makefile (tests): Add tst-sysconf.
9818         * tst-sysconf.c: New file.
9820         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
9821         PTHREAD_THREADS_MAX.
9823 2002-12-02  Roland McGrath  <roland@redhat.com>
9825         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
9826         Declare using hidden_proto instead of attribute_hidden, so there are
9827         non-.hidden static symbols for gdb to find.
9828         (__pthread_keys): Likewise.
9829         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
9830         * allocatestack.c (__stack_user): Likewise.
9831         * pthread_create.c (__pthread_keys): Likewise.
9832         (__nptl_threads_events, __nptl_last_event): Make these static instead
9833         of hidden.
9834         * pthread_key_create.c (__pthread_pthread_keys_max,
9835         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
9837 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
9839         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
9840         statically.
9841         * tst-locale1.c: New file.
9843         * pthread_cond_timedwait.c: Include <stdlib.h>.
9845         * Makefile (tests): Add tst-fork2 and tst-fork3.
9846         * tst-fork2.c: New file.
9847         * tst-fork3.c: New file.
9849 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
9851         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
9853         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
9854         require it to 200112L.
9856         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
9857         instruction only if HAVE_CMOV is defined.
9858         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
9860         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
9862         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
9864         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
9866         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
9868 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
9870         * sysdeps/x86_64/bits/atomic.h: New file.
9872         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
9873         16-bit operations.
9875         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
9876         possible since gettid cannot fail.
9878         * sysdeps/x86_64/pthreaddef.h: New file.
9880         * sysdeps/i386/pthreaddef.h (gettid): Removed.
9882         * sysdeps/x86_64/pthread_spin_init.c: New file.
9883         * sysdeps/x86_64/pthread_spin_lock.c: New file.
9884         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
9885         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
9887         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
9888         Add missing lock prefix.  Minute optimization.
9890         * tst-spin2.c (main): Also check successful trylock call.
9892         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
9893         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
9895         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
9896         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
9898         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
9899         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
9900         value in case of an error.  Add support for INTERNAL_SYSCALL.
9902         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
9903         value in case of an error.
9905         * sysdeps/x86_64/tls.h: New file.
9907 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
9909         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
9910         takes the array member name and the index as parameters.
9911         (THREAD_SETMEM_NC): Likewise.
9912         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
9913         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
9914         interfaces.
9916         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
9917         to decide which code to use.
9918         (THREAD_SETMEM_NC): Likewise.
9920         * allocatestack.c (queue_stack): Don't remove stack from list here.
9921         Do it in the caller.  Correct condition to prematurely terminate
9922         loop to free stacks.
9923         (__deallocate_stack): Remove stack from list here.
9925 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
9927         * Makefile (tests): Add tst-stack1.
9928         * tst-stack1.c: New file.
9930         * allocatestack.c (allocate_stack): Initialize the TCB on a user
9931         provided stack.
9933         * pthread_attr_getstack.c: Return bottom of the thread area.
9935 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
9937         * Makefile (libpthread-routines): Add pt-allocrtsig and
9938         pthread_kill_other_threads.
9939         * pt-allocrtsig.c: New file.
9940         * pthread_kill_other_threads.c: New file.
9941         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
9942         all three functions.
9943         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9944         allocrtsig.
9945         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
9946         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
9947         and __libc_allocate_rtsig_private.
9948         * Versions (libpthread): Export pthread_kill_other_threads_np,
9949         __libc_current_sigrtmin, and __libc_current_sigrtmax.
9951 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
9953         * allocatestack.c (allocate_stack): stackaddr in attribute points to
9954         the end of the stack.  Adjust computations.
9955         When mprotect call fails dequeue stack and free it.
9956         * pthread_attr_setstack.c: Store top of the stack in stackaddr
9957         attribute.
9958         * pthread_getattr_np.c: Likewise.
9960         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
9961         surprises.
9963 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
9965         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
9966         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
9968 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
9970         * pthread_getspecific.c: Optimize access to first 2nd-level array.
9971         * pthread_setspecific.c: Likewise.
9973 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
9975         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
9976         definitions.  Get them from the official place.
9977         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
9979         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
9980         Use new CLONE_ flags in clone() calls.
9982         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
9983         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
9985         * Versions: Add pthread_* functions for libc.
9986         * forward.c: New file.
9988         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
9989         errno-loc.
9990         * herrno.c: New file.
9991         * res.c: New file.
9993         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
9994         sem_trywait, and sem_timedwait.  Add herrno and res.
9995         * sem_init.c: Don't initialize lock and waiters members.
9996         * sem_open.c: Likewise.
9997         * sem_post.c: Removed.
9998         * sem_wait.c: Removed.
9999         * sem_trywait.c: Removed.
10000         * sem_timedwait.c: Removed.
10001         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10002         Includes full implementations of sem_post, sem_wait, sem_trywait,
10003         and sem_timedwait.
10004         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10005         for new implementation.
10006         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10007         and waiters fields.
10009         * tst-sem3.c: Improve error message.
10010         * tst-signal3.c: Likewise.
10012         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10013         to tell the kernel about the termination futex and to initialize tid
10014         member.  Don't initialize main_thread.
10015         * descr.h (struct pthread): Remove main_thread member.
10016         * cancelllation.c (__do_cancel): Remove code handling main thread.
10017         The main thread is not special anymore.
10019         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10020         size of the stacks to stack_cache_actsize.
10022         * pt-readv.c: Add missing "defined".
10023         * pt-sigwait.c: Likewise.
10024         * pt-writev.c: Likewise.
10026 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10028         * Versions: Export __connect from libpthread.
10029         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10031         * Makefile (libpthread-routines): Add pt-raise.
10032         * sysdeps/unix/sysv/linux/raise.c: New file.
10033         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10034         * sysdeps/generic/pt-raise.c: New file.
10036         * pthread_cond_init.c: Initialize all data elements of the condvar
10037         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10039         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10040         * pthread_create.c: Likewise.
10042         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10043         * tst-key1.c: New file.
10044         * tst-key2.c: New file.
10045         * tst-key3.c: New file.
10047         * Versions: Export pthread_detach for version GLIBC_2.0.
10048         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10050 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10052         * pthread_key_create.c: Terminate search after an unused key was found.
10053         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10055         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10056         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10058 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10060         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10061         dynamic lookup for errno in PIC.
10063         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10064         release the stack lock as soon as possible.
10065         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10066         the static TLS block.
10067         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10069         * cancellation.c: Renamed from cancelation.c.
10070         * Makefile: Adjust accordingly.
10071         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10072         * cleanup_defer.c: Use CANCELLATION_P.
10073         * pthread_testcancel.c: Likewise.
10074         * descr.h: Fix spelling in comments.
10075         * init.c: Likewise.
10076         * pthread_getattr_np.c: Likewise.
10077         * pthread_getschedparam.c: Likewise.
10078         * pthread_setschedparam.c: Likewise.
10079         * Versions: Likewise.
10081         * pt-pselect.c: New file.
10082         * Makefile (libpthread-routines): Add pt-pselect.
10083         * Versions: Add pselect.
10085         * tst-cancel4.c: New file.
10086         * Makefile (tests): Add tst-cancel4.
10088 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10090         * pthread_mutex_lock.c: Always record lock ownership.
10091         * pthread_mutex_timedlock.c: Likewise.
10092         * pthread_mutex_trylock.c: Likewise.
10094         * pt-readv.c: New file.
10095         * pt-writev.c: New file.
10096         * pt-creat.c: New file.
10097         * pt-msgrcv.c: New file.
10098         * pt-msgsnd.c: New file.
10099         * pt-poll.c: New file.
10100         * pt-select.c: New file.
10101         * pt-sigpause.c: New file.
10102         * pt-sigsuspend.c: New file.
10103         * pt-sigwait.c: New file.
10104         * pt-sigwaitinfo.c: New file.
10105         * pt-waitid.c: New file.
10106         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10107         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10108         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10109         * Versions: Add all the new functions.
10111         * tst-exit1.c: New file.
10112         * Makefile (tests): Add tst-exit1.
10114         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10116 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10118         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10120         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10121         call.  pthread_join is an official cancellation point.
10122         * pthread_timedjoin.c: Likewise.
10124         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10125         and the condvar's mutex are retrieved.
10126         * pthread_cond_timedwait.c: Likewise.
10127         Reported by dice@saros.East.Sun.COM.
10129 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10131         * pthreadP.h: Cut out all type definitions and move them...
10132         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10133         * pthreadP.h: Include <internaltypes.h>.
10135         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10136         performance tweaks.
10138         * sem_trywait.c: Shuffle #includes around to get right order.
10139         * sem_timedwait.c: Likewise.
10140         * sem_post.c: Likewise.
10141         * sem_wait.c: Likewise.
10143         * nptl 0.3 released.
10145         * Makefile (tests): Add tst-signal3.
10146         * tst-signal3.c: New file.
10148 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10150         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10151         the asms modify the sem object.
10152         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10154         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10155         the actual members.
10156         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10157         * semaphoreP.h: Include pthreadP.h.
10158         * sem_getvalue.c: Adjust to sem_t change.
10159         * sem_init.c: Likewise.
10160         * sem_open.c: Likewise.
10161         * sem_post.c: Likewise.
10162         * sem_timedwait.c: Likewise.
10163         * sem_trywait.c: Likewise.
10164         * sem_wait.c: Likewise.
10166 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10168         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10169         * tst-basic2.c: New file.
10170         * tst-exec1.c: New file.
10171         * tst-exec2.c: New file.
10172         * tst-exec3.c: New file.
10174         * tst-fork1.c: Remove extra */.
10176         * nptl 0.2 released.  The API for IA-32 is complete.