* sysdeps/mach/hurd/bits/fcntl.h [__USE_GNU__] (F_DUPFD_CLOEXEC): New.
[glibc.git] / nptl / ChangeLog
blobeb9dd20b5a66c5e2e38b636a3c7b9f43ffc4ef52
1 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
3         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
4         routine instead of an alias to __new_sem_post.
6 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
8         * init.c (__pthread_initialize_minimal): Initialize word to appease
9         valgrind.
11 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
13         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
14         libc.so just clear NAME.
15         (__libc_rwlock_fini): Nop inside of libc.so.
16         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
17         all zeros.
19 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
21         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
22         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
23         unlocking failed.
24         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
26 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
28         [BZ #4938]
29         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
30         reclaimed stack if necessary.
31         * Makefile (tests): Add tst-tsd6.
32         * tst-tsd6.c: New file.
34 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
36         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
37         Add private argument.
39 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
41         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
42         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
44 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
46         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
47         (__lll_robust_timedlock): Pass private as last argument to
48         __lll_robust_timedlock_wait.
49         (__lll_unlock): Fix a pasto.
51 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
53         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
54         sparc_old_sem): New structs.
55         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
56         (__sem_wait_cleanup): New function.
57         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
58         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
59         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
60         lll_futex_wait.
61         (__old_sem_wait): New function.
62         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
63         nptl/sysdeps/unix/sysv/linux/sparc version.
64         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
65         Likewise.
66         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
67         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
68         (__new_sem_trywait): Use sparc_old_sem structure.
69         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
70         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
71         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
72         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
73         lll_futex_timed_wait.
74         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
75         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
76         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
77         lll_futex_wake.
78         (__old_sem_post): New function.
79         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
80         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
81         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
82         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
83         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
84         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
86 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
88         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
89         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
90         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
91         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
92         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
93         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
94         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
95         Use FUTEX_WAKE_OP.
96         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
97         kernel-features.h and tcb-offsets.h.
98         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
99         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
100         process private.
101         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
102         tcb-offsets.h.
103         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
104         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
105         process private.
106         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
107         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
108         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
109         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
110         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
111         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
112         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
114 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
116         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
117         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
118         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
119         lll_futex_timed_wait.
121         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
122         __lll_robust_unlock): Rewrite as macros instead of inline functions.
123         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
124         __lll_robust_unlock, __lll_wait_tid): Likewise.
126 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
128         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
129         Fix a pasto.
130         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
131         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
132         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
133         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
134         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
135         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
136         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
137         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
138         kernel-features.h.
139         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
140         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
141         process private.  Switch DW_CFA_advance_loc1 and some
142         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
143         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
144         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
145         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
146         process private.  Switch DW_CFA_advance_loc{1,2} and some
147         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
148         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
149         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
150         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
151         Likewise.
152         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
153         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
154         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
155         Likewise.
156         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
157         (__pthread_cond_broadcast): Compare %r8 instead of
158         dep_mutex-cond_*(%rdi) with $-1.
159         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
160         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
161         of oring.
163 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
165         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
167 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
169         * allocatestack.c: Include kernel-features.h.
170         * pthread_create.c: Likewise.
171         * pthread_mutex_init.c: Likewise.
172         * init.c: Likewise.
173         * pthread_cond_timedwait.c: Likewise.
174         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
175         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
176         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
177         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
178         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
179         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
180         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
181         Likewise.
182         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
183         Likewise.
184         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
185         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
186         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
187         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
189 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
191         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
192         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
193         byte elements.  One of them is the new __shared element.
194         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
195         adjust names of other padding elements.
196         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
197         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
198         byte elements.  One of them is the new __shared element.
199         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
200         adjust names of other padding elements.
201         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
202         Renamed __pad1 element to __shared, adjust names of other padding
203         elements.
204         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
205         (pthread_rwlock_t): Likewise.
206         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
207         typo.
209 2007-08-09  Anton Blanchard  <anton@samba.org>
211         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
213 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
215         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
216         <kernel-features.h>.
217         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
219 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
221         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
222         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
223         dealing with robust mutexes.
224         * pthread_mutex_timedlock.c: Likewise.
225         * pthread_mutex_trylock.c: Likewise.
226         * pthread_mutex_unlock.c: Likewise.
227         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
229 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
231         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
232         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
233         (PTHREAD_MUTEX_PSHARED): Define.
234         * pthread_mutex_init.c (__pthread_mutex_init): Set
235         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
236         mutexes.
237         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
238         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
239         as second argument to lll_lock.
240         (LLL_MUTEX_TRYLOCK): Take mutex as argument
241         instead of its __data.__lock field.
242         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
243         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
244         to lll_robust_lock.
245         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
246         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
247         instead of mutex->__data.__kind directly, pass
248         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
249         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
250         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
251         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
252         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
253         to lll_timedlock, lll_robust_timedlock, lll_unlock and
254         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
255         of mutex->__data.__kind directly.
256         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
257         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
258         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
259         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
260         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
261         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
262         and lll_futex_wake.
263         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
264         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
265         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
266         directly.
267         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
268         Take mutex as argument instead of its __data.__lock field, pass
269         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
270         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
271         __data.__lock field.
272         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
273         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
274         to lll_robust_cond_lock.
275         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
276         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
277         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
278         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
279         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
280         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
281         lll_futex_wait.
282         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
283         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
284         lll_futex_wake.
285         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
286         pshared variable, pass it to lll_lock, lll_unlock,
287         lll_futex_timedwait and lll_futex_wake.
288         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
289         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
290         and lll_futex_wake.
291         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
292         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
293         macro.
294         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
295         lll_futex_wake_unlock): Likewise.
296         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
297         Likewise.
298         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
299         lll_futex_wake_unlock): Likewise.
300         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
301         Likewise.
302         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
303         lll_futex_wake_unlock): Likewise.
304         (lll_futex_wake): Fix a typo.
305         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
306         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
307         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
308         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
309         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
310         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
311         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
312         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
313         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
314         (__pthread_cond_timedwait): Likewise.
315         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
316         (__condvar_cleanup, __pthread_cond_wait): Likewise.
318 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
320         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
321         Don't use CGOTSETUP and CGOTRESTORE macros.
322         (CGOTSETUP, CGOTRESTORE): Remove.
323         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
324         @local symbol.
326 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
328         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
329         definitions for private futexes.
330         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
331         kernel-features.h and lowlevellock.h.  Use private futexes if
332         they are available.
333         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
334         (__lll_mutex_lock_wait): Rename to
335         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
336         (__lll_mutex_timedlock_wait): Rename to ...
337         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
338         Don't compile in for libc.so.
339         (__lll_mutex_unlock_wake): Rename to ...
340         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
341         (__lll_timedwait_tid): Use __NR_gettimeofday.
342         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
343         the header from assembler.  Renamed all lll_mutex_* resp.
344         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
345         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
346         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
347         Define.
348         (__lll_lock_wait_private): Add prototype.
349         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
350         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
351         __lll_unlock_wake): Likewise.
352         (lll_lock): Add private argument.  Call __lll_lock_wait_private
353         if private is constant LLL_PRIVATE.
354         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
355         lll_timedlock, lll_robust_timedlock): Add private argument.
356         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
357         if private is constant LLL_PRIVATE.
358         (lll_robust_unlock, lll_robust_dead): Add private argument.
359         (lll_lock_t): Remove.
360         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
361         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
362         lll_cond_wake, lll_cond_broadcast): Remove.
363         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
364         kernel-features.h and lowlevellock.h.
365         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
366         (LOAD_FUTEX_WAIT): Define.
367         (__lll_robust_mutex_lock_wait): Rename to ...
368         (__lll_robust_lock_wait): ... this.  Add private argument.
369         Use LOAD_FUTEX_WAIT macro.
370         (__lll_robust_mutex_timedlock_wait): Rename to ...
371         (__lll_robust_timedlock_wait): ... this.    Add private argument.
372         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
373         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
374         lowlevellock.h.
375         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
376         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
377         __lll_mutex_{lock,unlock}_*.
378         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
379         lowlevellock.h and pthread-errnos.h.
380         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
381         FUTEX_CMP_REQUEUE, EINVAL): Remove.
382         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
383         __lll_mutex_{lock,unlock}_*.
384         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
385         lowlevellock.h and pthread-errnos.h.
386         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
387         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
388         __lll_mutex_{lock,unlock}_*.
389         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
390         lowlevellock.h.
391         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
392         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
393         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
394         (__condvar_tw_cleanup): Likewise.
395         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
396         lowlevellock.h.
397         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
398         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
399         __lll_mutex_{lock,unlock}_*.
400         ( __condvar_w_cleanup): Likewise.
401         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
402         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
403         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
404         lowlevellock.h.
405         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
406         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
407         __lll_mutex_{lock,unlock}_*.
408         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
409         lowlevellock.h.
410         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
411         FUTEX_PRIVATE_FLAG): Remove.
412         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
413         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
414         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
415         lowlevellock.h.
416         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
417         FUTEX_PRIVATE_FLAG): Remove.
418         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
419         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
420         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
421         lowlevellock.h.
422         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
423         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
424         __lll_mutex_{lock,unlock}_*.
425         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
426         lowlevellock.h.
427         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
428         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
429         __lll_mutex_{lock,unlock}_*.
430         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
431         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
432         (__new_sem_post): Use standard initial exec code sequences.
433         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
434         lowlevellock.h.
435         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
436         FUTEX_PRIVATE_FLAG): Remove.
437         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
438         exec code sequences.
439         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
440         (__new_sem_trywait): Use standard initial exec code sequences.
441         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
442         (__new_sem_wait): Use standard initial exec code sequences.
444 2007-07-31  Anton Blanchard  <anton@samba.org>
446         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
447         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
448         atomic_full_barrier.
450 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
452         * allocatestack.c (stack_cache_lock): Change type to int.
453         (get_cached_stack, allocate_stack, __deallocate_stack,
454         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
455         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
456         as second argument to lll_lock and lll_unlock macros on
457         stack_cache_lock.
458         * pthread_create.c (__find_in_stack_list): Likewise.
459         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
460         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
461         as second argument.
462         * descr.h (struct pthread): Change lock and setxid_futex field
463         type to int.
464         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
465         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
466         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
467         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
468         Likewise.
469         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
470         * pthread_cond_init.c (__pthread_cond_init): Likewise.
471         * pthreadP.h (__attr_list_lock): Change type to int.
472         * pthread_attr_init.c (__attr_list_lock): Likewise.
473         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
474         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
475         lll_{,un}lock.
476         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
477         also for lll_futex_{wake,wait}.
478         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
479         a pointer to const.
480         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
481         LLL_SHARED as second argument to lll_{,un}lock.
482         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
483         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
484         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
485         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
486         Likewise.
487         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
488         as second argument to lll_{,un}lock macros on pd->lock.
489         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
490         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
491         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
492         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
493         Likewise.
494         * sysdeps/pthread/createthread.c (do_clone, create_thread):
495         Likewise.
496         * pthread_once.c (once_lock): Change type to int.
497         (__pthread_once): Pass LLL_PRIVATE as second argument to
498         lll_{,un}lock macros on once_lock.
499         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
500         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
501         rwlock->__data.__shared as second argument to them and similarly
502         for lll_futex_w*.
503         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
504         Likewise.
505         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
506         Likewise.
507         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
508         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
509         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
510         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
511         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
512         to lll_{,un}lock macros on __sem_mappings_lock.
513         * sem_open.c (check_add_mapping): Likewise.
514         (__sem_mappings_lock): Change type to int.
515         * semaphoreP.h (__sem_mappings_lock): Likewise.
516         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
517         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
518         instead of lll_*mutex_*, pass LLL_SHARED as last
519         argument.
520         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
521         pass LLL_SHARED as last argument.
522         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
523         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
524         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
525         pass LLL_SHARED as last argument.
526         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
527         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
528         LLL_SHARED as last argument.
529         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
530         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
531         Similarly.
532         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
533         __libc_lock_lock_recursive, __libc_lock_unlock,
534         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
535         argument to lll_{,un}lock.
536         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
537         _IO_lock_unlock): Likewise.
538         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
539         compound literal.
540         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
541         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
542         __fork_lock.
543         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
544         free_mem): Likewise.
545         (__fork_lock): Change type to int.
546         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
547         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
548         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
549         lll_futex_wake.
550         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
551         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
552         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
553         New function.
554         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
555         pass it through to lll_futex_*wait, only compile in when
556         IS_IN_libpthread.
557         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
558         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
559         argument and pass it through to lll_futex_*wait.
560         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
561         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
562         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
563         inline functions to __lll_* resp. __lll_robust_*.
564         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
565         (lll_mutex_dead): Add private argument.
566         (__lll_lock_wait_private): New prototype.
567         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
568         __lll_robust_lock_timedwait): Add private argument to prototypes.
569         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
570         call __lll_lock_wait_private, otherwise pass private to
571         __lll_lock_wait.
572         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
573         __lll_robust_timedlock): Add private argument, pass it to
574         __lll_*wait functions.
575         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
576         call __lll_unlock_wake_private, otherwise pass private to
577         __lll_unlock_wake.
578         (__lll_robust_unlock): Add private argument, pass it to
579         __lll_robust_unlock_wake.
580         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
581         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
582         argument, pass it through to __lll_* inline function.
583         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
584         (lll_lock_t): Remove.
585         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
586         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
587         lll_cond_wake, lll_cond_broadcast): Remove.
588         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
589         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
590         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
591         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
592         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
593         the header from assembler.  Renamed all lll_mutex_* resp.
594         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
595         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
596         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
597         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
598         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
599         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
600         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
601         Remove prototype.
602         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
603         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
604         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
605         (lll_trylock): Likewise, use __lll_trylock_asm, pass
606         MULTIPLE_THREADS_OFFSET as another asm operand.
607         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
608         MULTIPLE_THREADS_OFFSET as last asm operand, call
609         __lll_lock_wait_private if private is constant LLL_PRIVATE,
610         otherwise pass private as another argument to __lll_lock_wait.
611         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
612         lll_timedlock, lll_robust_timedlock): Add private argument, pass
613         private as another argument to __lll_*lock_wait call.
614         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
615         MULTIPLE_THREADS_OFFSET as another asm operand, call
616         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
617         otherwise pass private as another argument to __lll_unlock_wake.
618         (lll_robust_unlock): Add private argument, pass private as another
619         argument to __lll_unlock_wake.
620         (lll_robust_dead): Add private argument, use __lll_private_flag
621         macro.
622         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
623         LLL_MUTEX_LOCK_INITIALIZER.
624         (lll_lock_t): Remove.
625         (LLL_LOCK_INITIALIZER_WAITERS): Define.
626         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
627         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
628         lll_cond_wake, lll_cond_broadcast): Remove.
629         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
630         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
631         2007-05-2{3,9} changes.
632         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
633         kernel-features.h and lowlevellock.h.
634         (LOAD_PRIVATE_FUTEX_WAIT): Define.
635         (LOAD_FUTEX_WAIT): Rewritten.
636         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
637         define.
638         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
639         (__lll_mutex_lock_wait): Rename to ...
640         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
641         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
642         (__lll_mutex_timedlock_wait): Rename to ...
643         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
644         contains private argument.  Don't compile in for libc.so.
645         (__lll_mutex_unlock_wake): Rename to ...
646         (__lll_unlock_wake): ... this.  %ecx contains private argument.
647         Don't compile in for libc.so.
648         (__lll_timedwait_tid): Use __NR_gettimeofday.
649         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
650         kernel-features.h and lowlevellock.h.
651         (LOAD_FUTEX_WAIT): Define.
652         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
653         define.
654         (__lll_robust_mutex_lock_wait): Rename to ...
655         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
656         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
657         macro.
658         (__lll_robust_mutex_timedlock_wait): Rename to ...
659         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
660         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
661         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
662         lowlevellock.h.
663         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
664         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
665         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
666         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
667         to __lll_lock_wait in %edx.
668         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
669         Include lowlevellock.h and pthread-errnos.h.
670         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
671         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
672         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
673         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
674         pass LLL_SHARED in %ecx to both __lll_lock_wait and
675         __lll_unlock_wake.
676         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
677         Include lowlevellock.h and pthread-errnos.h.
678         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
679         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
680         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
681         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
682         pass LLL_SHARED in %ecx to both __lll_lock_wait and
683         __lll_unlock_wake.
684         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
685         Include lowlevellock.h.
686         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
687         Don't define.
688         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
689         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
690         pass LLL_SHARED in %ecx to both __lll_lock_wait and
691         __lll_unlock_wake.  Use __NR_gettimeofday.
692         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
693         Include lowlevellock.h.
694         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
695         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
696         to __lll_*, pass cond_lock address in %edx rather than %ecx to
697         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
698         and __lll_unlock_wake.
699         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
700         Include lowlevellock.h.
701         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
702         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
703         MUTEX(%ebx) address in %edx rather than %ecx to
704         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
705         and __lll_unlock_wake.  Move return value from %ecx to %edx
706         register.
707         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
708         Include lowlevellock.h.
709         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
710         Don't define.
711         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
712         MUTEX(%ebp) address in %edx rather than %ecx to
713         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
714         and __lll_unlock_wake.  Move return value from %ecx to %edx
715         register.  Use __NR_gettimeofday.
716         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
717         Include lowlevellock.h.
718         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
719         Don't define.
720         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
721         MUTEX(%ebp) address in %edx rather than %ecx to
722         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
723         and __lll_unlock_wake.  Move return value from %ecx to %edx
724         register.  Use __NR_gettimeofday.
725         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
726         Include lowlevellock.h.
727         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
728         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
729         MUTEX(%edi) address in %edx rather than %ecx to
730         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
731         and __lll_unlock_wake.
732         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
733         Include lowlevellock.h.
734         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
735         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
736         MUTEX(%ebx) address in %edx rather than %ecx to
737         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
738         and __lll_unlock_wake.  Move return value from %ecx to %edx
739         register.
740         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
741         lowlevellock.h.
742         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
743         define.
744         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
745         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
746         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
747         lowlevellock.h.
748         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
749         (sem_timedwait): Use __NR_gettimeofday.
750         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
751         lowlevellock.h.
752         (LOCK): Don't define.
753         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
754         lowlevellock.h.
755         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
756         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
757         are waiters.
758         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
759         2007-05-2{3,9} changes.
760         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
761         kernel-features.h and lowlevellock.h.
762         (LOAD_PRIVATE_FUTEX_WAIT): Define.
763         (LOAD_FUTEX_WAIT): Rewritten.
764         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
765         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
766         (__lll_mutex_lock_wait): Rename to ...
767         (__lll_lock_wait): ... this.  %esi is now private argument.
768         Don't compile in for libc.so.
769         (__lll_mutex_timedlock_wait): Rename to ...
770         (__lll_timedlock_wait): ... this.  %esi contains private argument.
771         Don't compile in for libc.so.
772         (__lll_mutex_unlock_wake): Rename to ...
773         (__lll_unlock_wake): ... this.  %esi contains private argument.
774         Don't compile in for libc.so.
775         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
776         kernel-features.h and lowlevellock.h.
777         (LOAD_FUTEX_WAIT): Define.
778         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
779         (__lll_robust_mutex_lock_wait): Rename to ...
780         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
781         Use LOAD_FUTEX_WAIT macro.
782         (__lll_robust_mutex_timedlock_wait): Rename to ...
783         (__lll_robust_timedlock_wait): ... this. %esi argument contains
784         private, use LOAD_FUTEX_WAIT macro.
785         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
786         lowlevellock.h.
787         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
788         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
789         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
790         __lll_lock_wait and __lll_unlock_wake.
791         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
792         Include lowlevellock.h and pthread-errnos.h.
793         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
794         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
795         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
796         pass LLL_SHARED in %esi to both __lll_lock_wait and
797         __lll_unlock_wake.
798         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
799         Include lowlevellock.h and pthread-errnos.h.
800         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
801         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
802         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
803         pass LLL_SHARED in %esi to both __lll_lock_wait and
804         __lll_unlock_wake.
805         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
806         Include lowlevellock.h.
807         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
808         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
809         pass LLL_SHARED in %esi to both __lll_lock_wait and
810         __lll_unlock_wake.
811         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
812         Include lowlevellock.h.
813         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
814         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
815         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
816         and __lll_unlock_wake.
817         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
818         Include lowlevellock.h.
819         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
820         Don't define.
821         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
822         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
823         and __lll_unlock_wake.
824         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
825         Include lowlevellock.h.
826         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
827         Don't define.
828         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
829         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
830         and __lll_unlock_wake.
831         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
832         Include lowlevellock.h.
833         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
834         Don't define.
835         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
836         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
837         and __lll_unlock_wake.
838         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
839         Include lowlevellock.h.
840         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
841         Don't define.
842         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
843         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
844         and __lll_unlock_wake.
845         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
846         Include lowlevellock.h.
847         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
848         Don't define.
849         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
850         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
851         and __lll_unlock_wake.
852         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
853         lowlevellock.h.
854         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
855         define.
856         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
857         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
858         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
859         lowlevellock.h.
860         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
861         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
862         lowlevellock.h.
863         (LOCK): Don't define.
864         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
865         lowlevellock.h.
866         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
867         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
868         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
869         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
870         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
871         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
872         (__lll_lock_wait_private): New function.
873         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
874         it to lll_futex_*wait.  Don't compile in for libc.so.
875         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
876         Remove.
877         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
878         (struct sparc_pthread_barrier): Remove.
879         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
880         struct sparc_pthread_barrier.  Pass
881         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
882         and lll_futex_wait macros.
883         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
884         Remove.
885         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
886         Include sparc pthread_barrier_wait.c instead of generic one.
888 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
890         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
892         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
893         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
894         %ecx.
895         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
896         (pthread_rwlock_timedwrlock): Likewise.
897         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
898         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
900 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
902         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
904 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
906         * tst-locale2.c (useless): Add return statement.
908 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
910         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
911         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
912         * pthread_create.c (start_thread): Likewise.
913         * init.c (sighandler_setxid): Likewise.
914         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
915         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
916         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
917         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
918         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
919         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
920         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
921         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
922         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
923         Likewise.
924         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
925         Likewise.
926         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
927         Likewise.
928         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
929         __rtld_notify): Likewise.
930         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
931         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
932         __pthread_once): Likewise.
933         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
934         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
935         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
936         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
937         (lll_futex_wait): Add private argument, define as wrapper around
938         lll_futex_timed_wait.
939         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
940         use __lll_private_flag macro.
941         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
942         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
943         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
944         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
945         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
946         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
947         (lll_futex_wait): Add private argument, define as wrapper around
948         lll_futex_timed_wait.
949         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
950         use __lll_private_flag macro.
951         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
952         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
953         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
954         Define.
955         (lll_futex_timed_wait, lll_futex_wake): Use it.
956         (lll_private_futex_wait, lll_private_futex_timed_wait,
957         lll_private_futex_wake): Removed.
958         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
959         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
960         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
961         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
962         (lll_futex_wait): Add private argument, define as wrapper around
963         lll_futex_timed_wait.
964         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
965         use __lll_private_flag macro.
966         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
967         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
968         to lll_futex_*.
969         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
970         (lll_private_futex_wait, lll_private_futex_timed_wait,
971         lll_private_futex_wake): Removed.
972         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
973         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
974         (lll_private_futex_wait, lll_private_futex_timed_wait,
975         lll_private_futex_wake): Removed.
976         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
977         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
978         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
979         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
980         (lll_futex_wait): Add private argument, define as wrapper around
981         lll_futex_timed_wait.
982         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
983         use __lll_private_flag macro.
984         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
985         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
986         to lll_futex_*.
987         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
988         Define.
989         (lll_futex_timed_wait, lll_futex_wake): Use it.
990         (lll_private_futex_wait, lll_private_futex_timed_wait,
991         lll_private_futex_wake): Removed.
993 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
995         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
996         of the structure for sparc32.
998 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1000         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1002 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1004         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1005         code used when private futexes are assumed.
1006         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1007         Likewise.
1009 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1011         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1012         (__lll_private_flag): Define.
1013         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1014         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1015         __lll_private_flag.
1016         (lll_private_futex_wait, lll_private_futex_timedwait,
1017         lll_private_futex_wake): Define as wrapper around non-_private
1018         macros.
1019         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1020         (__lll_private_flag): Define.
1021         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1022         (lll_private_futex_wait, lll_private_futex_timedwait,
1023         lll_private_futex_wake): Define as wrapper around non-_private
1024         macros.
1026 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1028         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1029         parameter to lll_futex_wait call.
1030         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1032         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1033         Replace lll_futex_wait with lll_private_futex_wait.
1034         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1035         Add LLL_SHARED parameter to lll_futex_wake().
1037         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1038         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1039         lll_private_futex_wake.
1040         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1041         bit from private parm before syscall.
1042         (lll_futex_timed_wait): Likewise.
1043         (lll_futex_wake): Likewise.
1044         (lll_futex_wake_unlock): Likewise.
1045         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1046         (lll_robust_mutex_unlock): Likewise.
1047         (lll_mutex_unlock_force): Likewise.
1048         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1050 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1052         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1053         compilation when unconditionally using private futexes.
1054         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1055         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1056         Likewise.
1057         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1058         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1060 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1062         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1063         Define.
1065 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1067         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1068         kernel-features.h.
1070 2007-05-16  Roland McGrath  <roland@redhat.com>
1072         * init.c (__nptl_initial_report_events): New variable.
1073         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1074         to that.
1076 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1078         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1079         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1081 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1083         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1084         implementation.
1086 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1088         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1089         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1090         * pthread_mutex_timedlock.c: Likewise.
1091         * pthread_mutex_trylock.c: Likewise.
1092         * pthread_mutex_unlock.c: Likewise.
1094 2007-06-17  Andreas Schwab  <schwab@suse.de>
1096         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1097         sections.
1099 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1101         * allocatestack.c (allocate_stack): Make code compile if
1102         __ASSUME_PRIVATE_FUTEX is set.
1104 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1106         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1107         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1108         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1109         (__pthread_rwlock_wrlock): Likewise.
1110         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1111         (pthread_rwlock_timedrdlock): Likewise.
1112         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1113         (pthread_rwlock_timedwrlock): Likewise.
1114         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1115         (__pthread_rwlock_unlock): Likewise.
1117 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1119         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1120         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1121         Split __flags into __flags, __shared, __pad1 and __pad2.
1122         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1123         futexes if they are available.
1124         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1125         in libc-lowlevellock.S allow using private futexes.
1126         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1127         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1128         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1129         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1130         lll_private_futex_timed_wait and lll_private_futex_wake.
1131         (lll_robust_mutex_unlock): Fix typo.
1132         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1133         field in futex command setup.
1134         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1135         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1136         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1137         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1138         if they are available.  Remove clear_once_control.
1139         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1140         futexes if they are available.
1141         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1142         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1143         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1144         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1145         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1146         Wake only when there are waiters.
1147         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1148         support.  Indicate that there are waiters.  Remove unnecessary
1149         extra cancellation test.
1150         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1151         left-over duplication of __sem_wait_cleanup.
1153 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1155         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1156         parameter to lll_futex_wait, lll_futex_timed_wait, and
1157         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1158         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1159         lll_private_futex_wake.
1160         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1161         * allocatestack.c: Adjust use of lll_futex_* macros.
1162         * init.c: Likewise.
1163         * lowlevellock.h: Likewise.
1164         * pthread_barrier_wait.c: Likewise.
1165         * pthread_cond_broadcast.c: Likewise.
1166         * pthread_cond_destroy.c: Likewise.
1167         * pthread_cond_signal.c: Likewise.
1168         * pthread_cond_timedwait.c: Likewise.
1169         * pthread_cond_wait.c: Likewise.
1170         * pthread_create.c: Likewise.
1171         * pthread_mutex_lock.c: Likewise.
1172         * pthread_mutex_setprioceiling.c: Likewise.
1173         * pthread_mutex_timedlock.c: Likewise.
1174         * pthread_mutex_unlock.c: Likewise.
1175         * pthread_rwlock_timedrdlock.c: Likewise.
1176         * pthread_rwlock_timedwrlock.c: Likewise.
1177         * pthread_rwlock_unlock.c: Likewise.
1178         * sysdeps/alpha/tls.h: Likewise.
1179         * sysdeps/i386/tls.h: Likewise.
1180         * sysdeps/ia64/tls.h: Likewise.
1181         * sysdeps/powerpc/tls.h: Likewise.
1182         * sysdeps/pthread/aio_misc.h: Likewise.
1183         * sysdeps/pthread/gai_misc.h: Likewise.
1184         * sysdeps/s390/tls.h: Likewise.
1185         * sysdeps/sh/tls.h: Likewise.
1186         * sysdeps/sparc/tls.h: Likewise.
1187         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1188         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1189         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1190         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1191         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1192         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1193         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1194         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1195         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1196         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1197         Likewise.
1198         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1199         * sysdeps/x86_64/tls.h: Likewise.
1201 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1203         * pthread_getattr_np.c: No need to install a cancellation handler,
1204         this is no cancellation point.
1205         * pthread_getschedparam.c: Likewise.
1206         * pthread_setschedparam.c: Likewise.
1207         * pthread_setschedprio.c: Likewise.
1208         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1209         lll_unlock_wake_cb.
1210         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1211         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1212         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1213         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1214         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1215         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1216         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1217         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1218         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1219         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1220         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1221         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1223         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1224         whether there are more than one thread makes no sense here since
1225         we only call the slow path if the locks are taken.
1226         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1228         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1229         COND_NWAITERS_SHIFT.
1230         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1231         COND_CLOCK_BITS.
1232         * pthread_cond_init.c: Likewise.
1233         * pthread_cond_timedwait.c: Likewise.
1234         * pthread_cond_wait.c: Likewise.
1235         * pthread_condattr_getclock.c: Likewise.
1236         * pthread_condattr_setclock.c: Likewise.
1237         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1238         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1239         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1240         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1241         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1243 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1245         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1246         unistd.h.
1248         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1249         insn suffix.
1250         (THREAD_GSCOPE_GET_FLAG): Remove.
1251         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1252         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1253         changes.
1254         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1255         (THREAD_GSCOPE_GET_FLAG): Remove.
1256         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1257         instead of THREAD_GSCOPE_GET_FLAG.
1258         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1259         it.
1260         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1261         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1262         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1263         THREAD_GSCOPE_WAIT): Define.
1264         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1265         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1266         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1267         THREAD_GSCOPE_WAIT): Define.
1268         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1269         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1270         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1271         THREAD_GSCOPE_WAIT): Define.
1272         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1273         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1274         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1275         THREAD_GSCOPE_WAIT): Define.
1277 2007-05-24  Richard Henderson  <rth@redhat.com>
1279         * descr.h (struct pthread): Add header.gscope_flag.
1280         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1281         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1282         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1283         THREAD_GSCOPE_WAIT): Define.
1285 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1287         * init.c: Make it compile with older kernel headers.
1289         * tst-initializers1.c: Show through exit code which test failed.
1291         * pthread_rwlock_init.c: Also initialize __shared field.
1292         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1293         element in rwlock structure into four byte elements.  One of them is
1294         the new __shared element.
1295         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1296         Likewise.
1297         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1298         __shared, adjust names of other padding elements.
1299         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1300         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1301         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1302         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1303         FUTEX_PRIVATE_FLAG.
1304         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1305         futex to use private operations if possible.
1306         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1307         Likewise.
1308         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1309         Likewise.
1310         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1311         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1312         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1313         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1314         Likewise.
1315         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1316         Likewise.
1317         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1318         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1320 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1322         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1323         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1324         * pthread_rwlock_timedrdlock.c: Likewise.
1325         * pthread_rwlock_tryrdlock.c: Likewise.
1327         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1328         optimization.
1330         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1331         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1332         duplication of __sem_wait_cleanup.
1334         * allocatestack.c: Revert last change.
1335         * init.c: Likewise.
1336         * sysdeps/i386/tls.h: Likewise.
1337         * sysdeps/x86_64/tls.h: Likewise.
1338         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1339         header structure.
1340         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1342         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1343         Add private field.
1344         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1345         * pthread_barrier_init.c: Set private flag if pshared and private
1346         futexes are supported.
1347         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1348         private field in futex command setup.
1349         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1351 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1353         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1354         support.
1355         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1356         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1357         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1358         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1359         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1361         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1362         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1363         fields in the structure.
1364         (__old_sem_init): New function.
1365         * sem_open.c: Initialize all fields of the structure.
1366         * sem_getvalue.c: Adjust for renamed element.
1367         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1368         (gen-as-const-headers): Add structsem.sym.
1369         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1370         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1371         struct new_sem.  Add struct old_sem.
1372         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1373         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1374         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1375         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1376         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1377         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1378         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1379         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1380         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1381         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1382         * tst-sem10.c: New file.
1383         * tst-sem11.c: New file.
1384         * tst-sem12.c: New file.
1385         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1386         of struct sem.
1388 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1389             Jakub Jelinek  <jakub@redhat.com>
1391         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1392         Move __pthread_enable_asynccancel right before futex syscall.
1393         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1394         Likewise.
1396 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1398         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1399         THREAD_COPY_PRIVATE_FUTEX): Define.
1400         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1401         THREAD_COPY_PRIVATE_FUTEX): Define.
1402         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1403         * init.c (__pthread_initialize_minimal_internal): Use
1404         THREAD_SET_PRIVATE_FUTEX.
1406         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1407         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1408         THREAD_GSCOPE_FLAG_WAIT): Define.
1409         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1410         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1411         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1412         PTR_DEMANGLE.
1413         (THREAD_GSCOPE_GET_FLAG): Define.
1414         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1415         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1416         instead of ->header.gscope_flag directly.
1418 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1420         * init.c (__pthread_initialize_minimal_internal): Check whether
1421         private futexes are available.
1422         * allocatestack.c (allocate_stack): Copy private_futex field from
1423         current thread into the new stack.
1424         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1425         futexes if they are available.
1426         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1427         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1428         in libc-lowlevellock.S allow using private futexes.
1429         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1430         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1431         FUTEX_PRIVATE_FLAG.
1432         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1433         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1434         if they are available.
1435         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1436         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1437         * sysdeps/i386/tcb-offsets.sym: Likewise.
1438         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1439         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1441 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1443         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1444         Remove ptr_wait_lookup_done again.
1445         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1446         (__pthread_initialize_minimal_internal): Initialize
1447         _dl_wait_lookup_done pointer in _rtld_global directly.
1448         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1449         Remove code to code _dl_wait_lookup_done.
1450         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1451         encrypted for now.
1453 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1455         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1456         pthread_mutex_init failed with ENOTSUP.
1458 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1460         * allocatestack.c (__wait_lookup_done): New function.
1461         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1462         Add ptr_wait_lookup_done.
1463         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1464         * pthreadP.h: Declare __wait_lookup_done.
1465         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1466         Define macros to implement reference handling of global scope.
1467         * sysdeps/x86_64/tls.h: Likewise.
1468         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1469         Initialize GL(dl_wait_lookup_done).
1471 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1473         [BZ #4512]
1474         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1475         is detected.
1476         * pthread_mutex_timedlock.c: Likewise.
1477         * pthread_mutex_trylock.c: Likewise.
1478         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1480         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1481         * tst-robust9.c: New file.
1482         * tst-robustpi9.c: New file.
1484         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1485         unnecessary extra cancellation test.
1487 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1489         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1490         extra cancellation test.
1491         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1493 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1495         * descr.h (struct pthread): Rearrange members to fill hole in
1496         64-bit layout.
1498         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1499         (__pthread_setaffinity_new): If syscall was successful and
1500         RESET_VGETCPU_CACHE is defined, use it before returning.
1501         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1503 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1505         [BZ #4455]
1506         * tst-align2.c: Include stackinfo.h.
1507         * tst-getpid1.c: Likewise.
1509 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1511         [BZ #4455]
1512         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1513         * tst-getpid1.c (do_test): Likewise.
1515         [BZ #4456]
1516         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1517         (allocate_stack): Likewise.
1519 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1521         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1522         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1523         (__lll_robust_timedlock_wait): Likewise.
1524         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1526 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1528         [BZ #4465]
1529         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1530         * tst-cancel4.c (tf_fdatasync): New test.
1532 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1534         [BZ #4392]
1535         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1536         check mutexes like normal mutexes.
1538         [BZ #4306]
1539         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1540         Initialize the whole sigevent structure to appease valgrind.
1542 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1544         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1545         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1547 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1549         * tst-locale1.c: Avoid warnings.
1550         * tst-locale2.c: Likewise.
1552 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1554         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1555         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1557 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1559         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1560         __extern_always_inline where appropriate.
1561         * sysdeps/pthread/pthread.h: Likewise.
1563 2007-03-13  Richard Henderson  <rth@redhat.com>
1565         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1566         separate cfi regions for the two subsections.
1568 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1570         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1571         new thread, don't just decrement it.
1572         Patch by Suzuki K P <suzuki@in.ibm.com>.
1574 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1576         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1577         PTHFCT_CALL definition.
1579 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1581         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1582         available, don't use it.
1584 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1586         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1587         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1588         call into the kernel to delay.
1590 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1592         * tst-initializers1.c: We want to test the initializers as seen
1593         outside of libc, so undefined _LIBC.
1595         * pthread_join.c (cleanup): Avoid warning.
1597 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1599         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1600         (__lll_timedwait_tid): Add unwind info.
1602         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1603         function table, mangle the pointers.
1604         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1605         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1606         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1607         demangle pointers before use.
1608         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1609         demangle pointer.
1610         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1611         * sysdeps/pthread/setxid.h: Likewise.
1613 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1615         * tst-rwlock7.c: Show some more information in case of correct
1616         behavior.
1618 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1620         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1621         (lll_futex_timed_wait): Undo part of last change, don't negate
1622         return value.
1624 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1626         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1627         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1629 2006-12-28  David S. Miller  <davem@davemloft.net>
1631         * shlib-versions: Fix sparc64 linux target specification.
1633 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1635         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1636         Adjust include path for pthread_barrier_wait.c move.
1638 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1640         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1641         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1643 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1645         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1646         6 argument cancellable syscalls.
1647         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1648         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1649         6 argument cancellable syscalls.
1650         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1652 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1654         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1655         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1657 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1659         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1660         __sync_lock_release instead of __sync_lock_release_si.
1662 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1664         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1665         Define.
1666         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1667         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1668         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1669         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1670         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1671         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1672         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1673         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1674         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1675         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1676         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1678 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1680         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1681         * pthread_barrier_wait.c: ...here.
1682         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1683         * pthread_cond_broadcast.c: ...here.
1684         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1685         * pthread_cond_signal.c: ...here.
1686         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1687         * pthread_cond_timedwait.c: ...here.
1688         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1689         * pthread_cond_wait.c: ...here.
1690         * sysdeps/pthread/pthread_once.c: Move to...
1691         * pthread_once.c: ...here.
1692         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1693         * pthread_rwlock_rdlock.c: ...here.
1694         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1695         * pthread_rwlock_timedrdlock.c: ...here.
1696         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1697         * pthread_rwlock_timedwrlock.c: ...here.
1698         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1699         * pthread_rwlock_unlock.c: ...here.
1700         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1701         * pthread_rwlock_wrlock.c: ...here.
1702         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1703         * pthread_spin_destroy.c: ...here.
1704         * sysdeps/pthread/pthread_spin_init.c: Move to...
1705         * pthread_spin_init.c: ...here.
1706         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1707         * pthread_spin_unlock.c: ...here.
1708         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1709         * pthread_getcpuclockid.c: ...here.
1711         * init.c: USE_TLS support is now always enabled.
1712         * tst-tls5.h: Likewise.
1713         * sysdeps/alpha/tls.h: Likewise.
1714         * sysdeps/i386/tls.h: Likewise.
1715         * sysdeps/ia64/tls.h: Likewise.
1716         * sysdeps/powerpc/tls.h: Likewise.
1717         * sysdeps/s390/tls.h: Likewise.
1718         * sysdeps/sh/tls.h: Likewise.
1719         * sysdeps/sparc/tls.h: Likewise.
1720         * sysdeps/x86_64/tls.h: Likewise.
1722 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1724         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1725         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1726         failed.
1728         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1729         Define to THREAD_SELF->header.multiple_threads.
1730         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1731         Likewise.
1732         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1733         Likewise.
1734         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1735         (SINGLE_THREAD_P): Likewise.
1736         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1737         (SINGLE_THREAD_P): Likewise.
1738         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1739         (SINGLE_THREAD_P): Likewise.
1740         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1741         (SINGLE_THREAD_P): Likewise.
1742         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
1743         Likewise.
1744         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1745         (SINGLE_THREAD_P): Likewise.
1746         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1747         (SINGLE_THREAD_P): Likewise.
1748         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
1749         Likewise.
1751 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
1753         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
1754         by default rather than 2_3_3.
1756 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
1758         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1759         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
1760         atomic_* instead of catomic_* macros.
1762 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
1764         [BZ #3285]
1765         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
1766         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1767         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1768         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1769         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1770         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
1771         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1772         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1773         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1774         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
1775         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1776         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1777         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1779 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
1781         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
1782         cancelable syscalls with six parameters.
1784         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
1785         operations instead of atomic_*.
1787 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
1789         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
1791 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
1793         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
1794         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
1795         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
1796         New file.
1797         * pthread_attr_setstack.c: Allow overwriting the version number of the
1798         new symbol.
1799         * pthread_attr_setstacksize.c: Likewise.
1800         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
1801         it.
1802         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
1803         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
1805 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
1807         [BZ #3251]
1808         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
1809         Patch by Petr Baudis.
1811 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
1813         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
1815         * tst-cancel2.c (tf): Loop as long as something was written.
1817 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1819         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
1820         mutexes wake all mutexes.
1821         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
1822         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1823         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1825 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
1827         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
1828         to guarantee the thread is always canceled.
1830 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
1832         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
1833         Include stdlib.h.
1834         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
1835         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
1836         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1837         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1838         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1840 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
1842         [BZ #3123]
1843         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
1844         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1845         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1846         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1847         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1848         * Makefile (tests): Add tst-cond22.
1849         * tst-cond22.c: New file.
1851 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
1853         [BZ #3124]
1854         * descr.h (struct pthread): Add parent_cancelhandling.
1855         * sysdeps/pthread/createthread.c (create_thread): Pass parent
1856         cancelhandling value to child.
1857         * pthread_create.c (start_thread): If parent thread was canceled
1858         reset the SIGCANCEL mask.
1859         * Makefile (tests): Add tst-cancel25.
1860         * tst-cancel25.c: New file.
1862 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
1863             Ulrich Drepper  <drepper@redhat.com>
1865         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
1866         counterp if it is already zero.
1867         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
1869 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
1870             Roland McGrath  <roland@redhat.com>
1872         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
1873         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1874         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
1875         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1876         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1877         lll_robust_mutex_timedlock, lll_mutex_unlock,
1878         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1879         Add _L_*_ symbols around the subsection.
1880         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
1881         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
1883 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
1884             Roland McGrath  <roland@redhat.com>
1886         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1887         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1888         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
1889         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1890         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1891         lll_robust_mutex_timedlock, lll_mutex_unlock,
1892         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1893         Add _L_*_ symbols around the subsection.
1894         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
1895         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
1897 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
1899         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
1900         change because it can disturb too much existing code.  If real hard
1901         reader preference is needed we'll introduce another type.
1902         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1903         (pthread_rwlock_timedwrlock): Likewise.
1904         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1905         Likewise.
1907 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
1909         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
1910         reader preference.
1911         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1912         (pthread_rwlock_timedwrlock): Likewise.
1913         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1914         Likewise.
1916 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
1918         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
1919         Only define ifdef SHARED.
1921 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
1923         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
1924         (free_stacks): ...here.
1925         (__free_stack_cache): New function.
1926         * pthreadP.h: Declare __free_stack_cache.
1927         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
1928         ptr_freeres.
1929         * init.c (pthread_functions): Initialize ptr_freeres.
1930         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
1931         New freeres function.
1933 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
1935         [BZ #3018]
1936         * Makefile (extra-objs): Add modules to extra-test-objs instead.
1938 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
1940         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1941         _XOPEN_REALTIME_THREADS.
1943 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
1945         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
1946         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
1947         HAVE_CLOCK_GETTIME_VSYSCALL.
1948         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
1950 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
1952         * sysdeps/unix/sysv/linux/bits/posix_opt.h
1953         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
1954         * descr.h (struct priority_protection_data): New type.
1955         (struct pthread): Add tpp field.
1956         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
1957         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
1958         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
1959         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
1960         TPP mutexes.
1961         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
1962         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
1963         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
1964         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
1965         * tpp.c: New file.
1966         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
1967         boosted by TPP.
1968         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1969         * pthread_mutexattr_getprioceiling.c
1970         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
1971         in the SCHED_FIFO priority range.
1972         * pthread_mutexattr_setprioceiling.c
1973         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
1974         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
1975         if mutex is not TPP.  Ceiling is now in __data.__lock.
1976         * pthread_mutex_setprioceiling.c: Include stdbool.h.
1977         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
1978         is now in __data.__lock.  Add locking.
1979         * pthread_create.c (__free_tcb): Free pd->tpp structure.
1980         * Makefile (libpthread-routines): Add tpp.
1981         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
1982         * tst-tpp.h: New file.
1983         * tst-mutexpp1.c: New file.
1984         * tst-mutexpp6.c: New file.
1985         * tst-mutexpp10.c: New file.
1986         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
1987         * tst-mutex6.c (TEST_FUNCTION): Likewise.
1989 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
1991         [BZ #2843]
1992         * pthread_join.c (pthread_join): Account for self being canceled
1993         when checking for deadlocks.
1994         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
1995         (tf1): Don't print anything after pthread_join returns, this would be
1996         another cancellation point.
1997         (tf2): Likewise.
1998         * tst-join6.c: New file.
1999         * Makefile (tests): Add tst-join6.
2001 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2003         [BZ #2892]
2004         * pthread_setspecific.c (__pthread_setspecific): Check
2005         out-of-range index before checking for unused key.
2007         * sysdeps/pthread/gai_misc.h: New file.
2009 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2011         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2012         file.  Don't use sysctl.
2013         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2014         overwrite the file if this is likely not true.
2016 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2018         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2019         * Makefile (tests): Add tst-getpid3.
2020         * tst-getpid3.c: New file.
2022 2006-07-30  Roland McGrath  <roland@redhat.com>
2024         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2026         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2027         (pause_not_cancel): New macro.
2028         (nanosleep_not_cancel): New macro.
2029         (sigsuspend_not_cancel): New macro.
2030         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2031         nanosleep_not_cancel macro from <not-cancel.h>.
2032         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2033         macro from <not-cancel.h>.
2035 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2036             Jakub Jelinek  <jakub@redhat.com>
2038         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2039         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2040         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2041         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2042         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2043         * pthread_mutex_lock.c: Likewise.
2044         * pthread_mutex_timedlock.c: Likewise.
2045         * pthread_mutex_trylock.c: Likewise.
2046         * pthread_mutex_unlock.c: Likewise.
2047         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2048         all mutexes.
2049         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2050         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2051         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2052         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2053         pthread-pi-defines.sym.
2054         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2055         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2056         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2057         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2058         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2059         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2060         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2061         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2062         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2063         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2064         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2065         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2066         * tst-mutex2.c: Likewise.
2067         * tst-mutex3.c: Likewise.
2068         * tst-mutex4.c: Likewise.
2069         * tst-mutex5.c: Likewise.
2070         * tst-mutex6.c: Likewise.
2071         * tst-mutex7.c: Likewise.
2072         * tst-mutex7a.c: Likewise.
2073         * tst-mutex8.c: Likewise.
2074         * tst-mutex9.c: Likewise.
2075         * tst-robust1.c: Likewise.
2076         * tst-robust7.c: Likewise.
2077         * tst-robust8.c: Likewise.
2078         * tst-mutexpi1.c: New file.
2079         * tst-mutexpi2.c: New file.
2080         * tst-mutexpi3.c: New file.
2081         * tst-mutexpi4.c: New file.
2082         * tst-mutexpi5.c: New file.
2083         * tst-mutexpi6.c: New file.
2084         * tst-mutexpi7.c: New file.
2085         * tst-mutexpi7a.c: New file.
2086         * tst-mutexpi8.c: New file.
2087         * tst-mutexpi9.c: New file.
2088         * tst-robust1.c: New file.
2089         * tst-robust2.c: New file.
2090         * tst-robust3.c: New file.
2091         * tst-robust4.c: New file.
2092         * tst-robust5.c: New file.
2093         * tst-robust6.c: New file.
2094         * tst-robust7.c: New file.
2095         * tst-robust8.c: New file.
2096         * Makefile (tests): Add the new tests.
2098         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2099         * pthread_mutex_destroy.c: Remove unneeded label.
2101 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2103         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2104         computations to compile time.
2106 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2108         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2110 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2112         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2114 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2116         * pthread_key_create.c (__pthread_key_create): Do away with
2117         __pthread_keys_lock.
2119         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2120         (__kernel_cpumask_size): Mark as hidden.
2121         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2123         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2124         * semaphoreP.h (__sem_mappings_lock): Likewise.
2126 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2128         * pthread_atfork.c: Mark __dso_handle as hidden.
2130 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2132         [BZ #2644]
2133         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2134         the reload problem.  Change the one path in pthread_cancel_init
2135         which causes the problem.  Force gcc to reload.  Simplify callers.
2136         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2137         (_Unwind_GetBSP): Undo last patch.
2139 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2141         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2142         function pointer is reloaded after pthread_cancel_init calls.
2144         [BZ #2644]
2145         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2146         pointers are reloaded after pthread_cancel_init calls.
2148 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2150         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2151         __always_inline.
2153 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2155         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2156         Allocate new object which is passed to timer_sigev_thread so that
2157         the timer can be deleted before the new thread is scheduled.
2159 2006-04-26  Roland McGrath  <roland@redhat.com>
2161         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2163 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2165         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2166         suffix for conditional jumps.
2167         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2168         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2169         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2170         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2171         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2172         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2174         * init.c (sigcancel_handler): Compare with correct PID even if the
2175         thread is in the middle of a fork call.
2176         (sighandler_setxid): Likewise.
2177         Reported by Suzuki K P <suzuki@in.ibm.com> .
2179 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2181         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2183 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2185         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2186         fails [Coverity CID 105].
2188 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2190         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2192 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2194         [BZ #2505]
2195         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2196         Define __lll_rel_instr using lwsync.
2198 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2200         * allocatestack.c (allocate_stack): Always initialize robust_head.
2201         * descr.h: Define struct robust_list_head.
2202         (struct pthread): Use robust_list_head in robust mutex list definition.
2203         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2204         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2205         (__pthread_initialize_minimal_internal): Register robust_list with
2206         the kernel.
2207         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2208         Declare __set_robust_list_avail.
2209         * pthread_create.c (start_thread): Register robust_list of new thread.
2210         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2211         waiters.
2212         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2213         number of users, it's unreliable.
2214         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2215         set_robust_list syscall is available.
2216         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2217         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2218         Set robust_head.list_op_pending before trying to lock a robust mutex.
2219         * pthread_mutex_timedlock.c: Likewise.
2220         * pthread_mutex_trylock.c: Likewise.
2221         * pthread_mutex_unlock.c: Likewise for unlocking.
2222         * Makefile (tests): Add tst-robust8.
2223         * tst-robust8.c: New file.
2225 2006-03-08  Andreas Schwab  <schwab@suse.de>
2227         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2228         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2230 2006-03-05  Roland McGrath  <roland@redhat.com>
2232         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2233         and $config_os doesn't match *linux*.
2235 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2237         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2238         Use __syscall_error.
2239         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2240         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2241         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2242         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2243         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2244         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2246 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2248         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2250 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2252         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2253         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2254         mutex.
2255         (__lll_robust_timedlock_wait): Likewise.
2256         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2257         (__lll_robust_lock_wait): Likewise.
2258         (__lll_robust_timedlock_wait): Likewise.
2259         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2260         (__lll_robust_lock_wait): Likewise.
2261         (__lll_robust_timedlock_wait): Likewise.
2263 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2265         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2266         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2267         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2268         lll_robust_mutex_unlock): Define.
2269         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2271 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2273         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2274         instead of <clone.S>.
2276 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2278         * Makefile (libpthread-routines): Add
2279         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2280         and pthread_mutex_[sg]etprioceiling.
2281         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2282         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2283         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2284         pthread_mutex_setprioceiling.
2285         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2286         PTHREAD_PRIO_PROTECT): New enum values.
2287         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2288         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2289         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2290         prototypes.
2291         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2292         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2293         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2294         Define.
2295         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2296         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2297         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2298         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2299         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2300         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2301         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2302         protocol mutexes.
2303         * pthread_mutex_getprioceiling.c: New file.
2304         * pthread_mutex_setprioceiling.c: New file.
2305         * pthread_mutexattr_getprioceiling.c: New file.
2306         * pthread_mutexattr_setprioceiling.c: New file.
2307         * pthread_mutexattr_getprotocol.c: New file.
2308         * pthread_mutexattr_setprotocol.c: New file.
2310 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2312         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2314 2006-02-27  Roland McGrath  <roland@redhat.com>
2316         * sysdeps/pthread/Subdirs: List nptl here too.
2317         * configure (libc_add_on_canonical): New variable.
2319         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2321         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2322         self to get main source tree's file.
2323         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2324         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2325         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2326         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2327         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2328         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2329         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2330         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2331         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2332         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2333         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2334         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2335         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2337         * Makefile: Use $(sysdirs) in vpath directive.
2339         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2340         (CPPFLAGS-timer_routines.c): Likewise.
2342         * Makeconfig (includes): Variable removed.
2344 2006-02-26  Roland McGrath  <roland@redhat.com>
2346         * sysdeps/generic/pt-raise.c: Moved to ...
2347         * pt-raise.c: ... here.
2348         * sysdeps/generic/lowlevellock.h: Moved to ...
2349         * lowlevellock.h: ... here.
2351 2006-02-23  Roland McGrath  <roland@redhat.com>
2353         * descr.h (struct pthread): Add final member `end_padding'.
2354         (PTHREAD_STRUCT_END_PADDING): Use it.
2356 2006-02-20  Roland McGrath  <roland@redhat.com>
2358         * sysdeps/mips: Directory removed, saved in ports repository.
2359         * sysdeps/unix/sysv/linux/mips: Likewise.
2361 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2363         * tst-robust1.c: Add second mutex to check that the mutex list is
2364         handled correctly.
2366 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2368         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2369         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2370         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2371         lll_robust_mutex_unlock): New macros.
2372         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2373         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2374         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2375         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2376         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2378 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2380         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2381         definitions.
2382         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2384 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2386         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2387         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2388         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2389         (lll_robust_mutex_unlock): Likewise.
2391 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2393         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2394         Set robust_list.__next rather than robust_list.
2395         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2396         (__pthread_list_t): New typedef.
2397         (pthread_mutex_t): Replace __next and __prev fields with __list.
2398         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2399         (__pthread_list_t): New typedef.
2400         (pthread_mutex_t): Replace __next and __prev fields with __list.
2401         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2402         (__pthread_list_t, __pthread_slist_t): New typedefs.
2403         (pthread_mutex_t): Replace __next and __prev fields with __list.
2404         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2405         (__pthread_list_t, __pthread_slist_t): New typedefs.
2406         (pthread_mutex_t): Replace __next and __prev fields with __list.
2407         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2408         (__pthread_list_t, __pthread_slist_t): New typedefs.
2409         (pthread_mutex_t): Replace __next and __prev fields with __list.
2410         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2411         (__pthread_slist_t): New typedef.
2412         (pthread_mutex_t): Replace __next field with __list.
2414 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2416         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2417         PTHREAD_MUTEX_OWNERDEAD.
2418         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2419         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2420         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2421         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2422         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2423         to PTHREAD_MUTEX_INCONSISTENT.
2424         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2425         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2426         * pthread_mutex_trylock.c: Likewise.
2427         * pthread_mutex_timedlock.c: Likewise.
2428         * pthread_mutex_unlock.c: Likewise.
2429         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2430         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2431         lowlevelrobustlock.sym.
2432         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2433         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2434         definitions.
2435         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2436         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2437         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2438         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2439         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2441 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2443         * allocatestack.c (allocate_stack): Initialize robust_list.
2444         * init.c (__pthread_initialize_minimal_internal): Likewise.
2445         * descr.h (struct xid_command): Pretty printing.
2446         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2447         robust_list.  Adjust macros.
2448         * pthread_create.c (start_thread): Adjust robust_list handling.
2449         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2450         but the owner for all robust mutex types.
2451         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2452         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2453         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2454         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2456         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2457         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2459 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2461         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2462         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2464 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2466         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2467         Return status.
2468         (lll_futex_timed_wait): Define.
2470 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2472         * tst-cancel4.c: Test ppoll.
2474 2006-01-18  Andreas Jaeger  <aj@suse.de>
2476         [BZ #2167]
2477         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2478         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2479         by Jim Gifford <patches@jg555.com>.
2481 2006-01-13  Richard Henderson  <rth@redhat.com>
2483         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2485 2006-01-10  Roland McGrath  <roland@redhat.com>
2487         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2488         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2489         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2490         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2491         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2492         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2493         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2494         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2495         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2496         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2498 2006-01-09  Roland McGrath  <roland@redhat.com>
2500         * tst-initializers1-c89.c: New file.
2501         * tst-initializers1-c99.c: New file.
2502         * tst-initializers1-gnu89.c: New file.
2503         * tst-initializers1-gnu99.c: New file.
2504         * Makefile (tests): Add them.
2505         (CFLAGS-tst-initializers1-c89.c): New variable.
2506         (CFLAGS-tst-initializers1-c99.c): New variable.
2507         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2508         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2510         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2511         Use __extension__ on anonymous union definition.
2512         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2513         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2514         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2515         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2516         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2518 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2520         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2521         Don't give the union a name because it changes the mangled name.
2522         Instead name the struct for __data.
2523         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2524         Likewise.
2525         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2526         Likewise.
2528 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2530         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2531         stack bias to mc_ftp field.
2533 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2535         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2536         being too clever and reloading the futex value where it shouldn't.
2538 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2540         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2541         correct type.
2543 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2545         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2546         Add cfi directives.
2548 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2550         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2551         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2552         rename in tcbhead_t.
2554         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2555         Don't give the union a name because it changes the mangled name.
2556         Instead name the struct for __data.
2557         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2558         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2559         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2560         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2561         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2562         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2564 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2566         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2567         Return status.
2568         (lll_futex_timed_wait): Define.
2569         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2570         * sysdeps/pthread/aio_misc.h: New file.
2572 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2574         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2576 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2578         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2579         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2580         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2582 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2584         * tst-cancel24.cc: Use C headers instead of C++ headers.
2586 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2588         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2589         sparc-linux configured glibc.
2590         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2591         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2592         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2593         atomic_compare_and_exchange_val_24_acq instead of
2594         atomic_compare_and_exchange_val_acq.
2595         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2596         instead of atomic_exchange_rel.
2597         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2598         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2599         file.
2600         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2601         file.
2602         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2603         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2604         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2605         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2606         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2607         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2608         New file.
2609         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2610         New file.
2611         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2612         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2613         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2614         file.
2615         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2616         file.
2617         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2619 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2621         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2622         mutex initializers.
2624 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2626         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2627         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2628         THREAD_COPY_POINTER_GUARD): Define.
2629         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2630         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2632 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2634         * version.c: Update copyright year.
2636 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2638         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2639         .eh_frame section, use cfi_* directives.
2640         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2642 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2644         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2645         now.
2647 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2649         * sysdeps/pthread/sigaction.c: Removed.
2650         * sigaction.c: New file.
2651         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2653 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2655         * Makefile (tests): Add tst-signal7.
2656         * tst-signal7.c: New file.
2658 2005-12-27  Roland McGrath  <roland@redhat.com>
2660         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2661         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2662         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2663         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2664         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2665         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2666         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2667         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2668         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2669         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2670         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2672 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2674         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2675         and __prev field to pthread_mutex_t.
2676         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2677         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2678         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2679         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2680         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2681         to pthread_mutex_t.
2683 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2685         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2686         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2687         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2688         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2689         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2690         and PTHREAD_MUTEXATTR_FLAG_BITS.
2691         * descr.h (struct pthread): Add robust_list field and define
2692         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2693         * pthread_mutexattr_getrobust.c: New file.
2694         * pthread_mutexattr_setrobust.c: New file.
2695         * pthread_mutex_consistent.c: New file.
2696         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2697         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2698         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2699         Adjust pthread_mutex_t initializers.
2700         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2701         field to pthread_mutex_t.
2702         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2703         and __prev field to pthread_mutex_t.
2704         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2705         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2706         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2707         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2708         * pthread_mutexattr_gettype.c: Likewise.
2709         * pthread_mutexattr_setpshared.c: Likewise.
2710         * pthread_mutexattr_settype.c: Likewise.
2711         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2712         Initialize mutex kind according to robust flag.
2713         * pthread_mutex_lock.c: Implement local robust mutex.
2714         * pthread_mutex_timedlock.c: Likewise.
2715         * pthread_mutex_trylock.c: Likewise.
2716         * pthread_mutex_unlock.c: Likewise.
2717         * pthread_create.c (start_thread): Mark robust mutexes which remained
2718         locked as dead.
2719         * tst-robust1.c: New file.
2720         * tst-robust2.c: New file.
2721         * tst-robust3.c: New file.
2722         * tst-robust4.c: New file.
2723         * tst-robust5.c: New file.
2724         * tst-robust6.c: New file.
2725         * tst-robust7.c: New file.
2726         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
2727         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2728         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
2729         tst-robust5, tst-robust6, and tst-robust7.
2731         * tst-typesizes.c: New file.
2732         * Makefile (tests): Add tst-typesizes.
2734         * tst-once3.c: More debug output.
2736 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
2738         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
2739         missing after last change.
2741         * version.c: Update copyright year.
2743 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
2745         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
2746         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
2747         * pthread_mutex_trylock.c: Likewise.
2748         * pthread_mutex_timedlock.c: Likewise.
2749         * pthread_mutex_unlock.c: Likewise.
2751 2005-12-22  Roland McGrath  <roland@redhat.com>
2753         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
2754         so that #include_next's search location is not reset to the -I..
2755         directory where <nptl/...> can be found.
2757 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
2759         [BZ #1913]
2760         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2761         Fix unwind info.  Remove useless branch prediction prefix.
2762         * tst-cancel24.cc: New file.
2763         * Makefile: Add rules to build and run tst-cancel24.
2765 2005-12-21  Roland McGrath  <roland@redhat.com>
2767         * libc-cancellation.c: Use <> rather than "" #includes.
2768         * pt-cleanup.c: Likewise.
2769         * pthread_create.c: Likewise.
2770         * pthread_join.c: Likewise.
2771         * pthread_timedjoin.c: Likewise.
2772         * pthread_tryjoin.c: Likewise.
2773         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
2774         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2775         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2776         * unwind.c: Likewise.
2778 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2780         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
2781         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
2782         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2783         THREAD_COPY_POINTER_GUARD): Define.
2785 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
2787         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
2788         rather than one.
2789         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2790         THREAD_COPY_POINTER_GUARD): Define.
2791         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
2792         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
2793         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2794         THREAD_COPY_POINTER_GUARD): Define.
2795         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
2796         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
2797         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
2798         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
2799         Use PTR_DEMANGLE for B0 if defined.
2801 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
2803         * pthread_create.c (__pthread_create_2_1): Use
2804         THREAD_COPY_POINTER_GUARD if available.
2805         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
2806         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2807         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
2808         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
2809         * sysdeps/x86_64/tls.h: Likewise.
2811 2005-12-15  Roland McGrath  <roland@redhat.com>
2813         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
2815 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
2817         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
2818         sysdeps/generic.
2819         * errno-loc.c: New file.
2821 2005-12-12  Roland McGrath  <roland@redhat.com>
2823         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
2824         adjustments before choosing stack size.  Update minimum stack size
2825         calculation to match allocate_stack change.
2827 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
2829         * allocatestack.c (allocate_stack): Don't demand that there is an
2830         additional full page available on the stack beside guard, TLS, the
2831         minimum stack.
2833 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
2835         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2836         (__cleanup_fct_attribute): Use __regparm__ not regparm.
2838         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
2839         compiling 32-bit code we must define __cleanup_fct_attribute.
2841 005-11-24  Jakub Jelinek  <jakub@redhat.com>
2843         [BZ #1920]
2844         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
2845         __attribute__ instead of __attribute.
2846         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2847         (__cleanup_fct_attribute): Likewise.
2849 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
2851         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
2852         a write barrier before writing libgcc_s_getcfa.
2854 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
2856         * sysdeps/unix/sysv/linux/configure: Removed.
2858 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
2860         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
2861         optional init_array/fini_array support.
2863 2005-10-24  Roland McGrath  <roland@redhat.com>
2865         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
2866         versioned_symbol use.
2868 2005-10-16  Roland McGrath  <roland@redhat.com>
2870         * init.c (__pthread_initialize_minimal_internal): Even when using a
2871         compile-time default stack size, apply the minimum that allocate_stack
2872         will require, and round up to page size.
2874 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
2876         * Makefile ($(test-modules)): Remove static pattern rule.
2878 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2879             Ulrich Drepper  <drepper@redhat.com>
2881         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
2882         alignment in callback function.
2883         * Makefile: Add rules to build and run tst-align3.
2884         * tst-align3.c: New file.
2886 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
2888         * allocatestack.c (setxid_signal_thread): Add
2889         INTERNAL_SYSCALL_DECL (err).
2891 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
2893         * allocatestack.c (setxid_signal_thread): Need to use
2894         atomic_compare_and_exchange_bool_acq.
2896 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
2897             Jakub Jelinek  <jakub@redhat.com>
2899         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
2900         CANCEL_RESTMASK.
2901         (struct pthread): Move specific_used field to avoid padding.
2902         Add setxid_futex field.
2903         * init.c (sighandler_setxid): Reset setxid flag and release the
2904         setxid futex.
2905         * allocatestack.c (setxid_signal_thread): New function.  Broken
2906         out of the bodies of the two loops in __nptl_setxid.  For undetached
2907         threads check whether they are exiting and if yes, don't send a signal.
2908         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
2909         * pthread_create.c (start_thread): For undetached threads, check
2910         whether setxid bit is set.  If yes, wait until signal has been
2911         processed.
2913         * allocatestack.c (STACK_VARIABLES): Initialize them.
2914         * pthread_create.c (__pthread_create_2_1): Initialize pd.
2916 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
2918         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
2919         waiters, awake all waiters on the associated mutex.
2921 2005-09-22  Roland McGrath  <roland@redhat.com>
2923         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
2924         ../sysdeps/x86_64/hp-timing.h).
2926 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
2928         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
2929         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2930         (lll_futex_wake_unlock): Define.
2931         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
2932         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2933         (lll_futex_wake_unlock): Define.
2934         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
2935         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2936         (lll_futex_wake_unlock): Define.
2937         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
2938         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2939         (lll_futex_wake_unlock): Define.
2940         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
2941         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2942         (lll_futex_wake_unlock): Define.
2943         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
2944         lll_futex_wake_unlock.
2945         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2946         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2947         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2948         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2949         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2950         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2952 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2954         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2955         Fix typo in register name.
2957 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
2959         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2960         Use __sigfillset.  Document that sigfillset does the right thing wrt
2961         to SIGSETXID.
2963 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
2965         [BZ #1102]
2966         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
2967         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
2968         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
2969         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
2970         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
2971         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
2972         in the structure.
2973         * Makefile (tests): Add tst-initializers1.
2974         (CFLAGS-tst-initializers1.c): Set.
2975         * tst-initializers1.c: New test.
2977 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
2979         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
2980         Make sure __flags are located at offset 48 from the start of the
2981         structure.
2983 2005-07-02  Roland McGrath  <roland@redhat.com>
2985         * Makeconfig: Comment fix.
2987 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
2989         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
2990         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
2991         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
2992         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
2993         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
2994         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
2995         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
2996         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
2997         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
2998         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3000 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3002         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3003         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3004         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3005         fields.
3006         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3007         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3008         field.  Put in sysinfo field unconditionally.
3009         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3010         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3011         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3012         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3013         fields.
3014         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3015         * pthread_create.c (__pthread_create_2_1): Use
3016         THREAD_COPY_STACK_GUARD macro.
3017         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3018         tests.
3019         * tst-stackguard1.c: New file.
3020         * tst-stackguard1-static.c: New file.
3022 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3024         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3025         Invoke CGOTSETUP and CGOTRESTORE.
3026         (CGOTSETUP, CGOTRESTORE): Define.
3028 2005-05-29  Richard Henderson  <rth@redhat.com>
3030         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3031         (tf_write, tf_writev): Use it.
3032         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3033         the system minimum.
3035 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3037         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3038         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3039         __librt_*_asynccancel@local.
3041 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3043         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3044         all occurrences of JUMPTARGET.  Instead append @local to labels.
3046 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3048         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3049         size/alignment of struct pthread rather than tcbhead_t.
3050         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3051         Likewise.
3052         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3053         Likewise.
3054         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3055         Likewise.
3057 2005-05-19  Richard Henderson  <rth@redhat.com>
3059         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3060         __sync_val_compare_and_swap, not explicit _si variant.
3061         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3063 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3065         [BZ #915]
3066         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3068 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3070         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3071         .eh_frame section, use cfi_* directives.
3073 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3075         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3076         of "" includes.
3078 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3080         [BZ #1075]
3081         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3082         aio_write blocks.
3084 2005-04-27  Roland McGrath  <roland@redhat.com>
3086         * Makefile (tests): Remove tst-clock2.
3088         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3089         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3090         translating to the kernel clockid_t for our own process/thread clock.
3092         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3094 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3096         * old_pthread_cond_init.c: Include <errno.h>.
3097         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3098         process shared or uses clock other than CLOCK_REALTIME.
3099         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3101 2005-04-13  David S. Miller  <davem@davemloft.net>
3103         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3104         * sysdeps/sparc/sparc64/clone.S: New file.
3106 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3108         [BZ #1102]
3109         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3110         __inline instead of inline.
3111         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3113 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3115         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3116         functionally equivalent, but shorter instructions.
3117         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3118         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3119         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3120         Likewise.
3121         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3122         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3123         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3124         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3125         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3126         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3127         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3128         Likewise.
3129         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3130         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3131         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3132         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3133         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3135 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3137         * sysdeps/mips/Makefile: New file.
3138         * sysdeps/mips/nptl-sysdep.S: New file.
3139         * sysdeps/mips/tcb-offsets.sym: New file.
3140         * sysdeps/mips/pthread_spin_lock.S: New file.
3141         * sysdeps/mips/pthread_spin_trylock.S: New file.
3142         * sysdeps/mips/pthreaddef.h: New file.
3143         * sysdeps/mips/tls.h: New file.
3144         * sysdeps/mips/jmpbuf-unwind.h: New file.
3145         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3146         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3147         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3148         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3149         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3150         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3151         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3152         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3153         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3154         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3156 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3158         [BZ #1112]
3159         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3160         variable to scerr.
3162 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3164         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3166 2005-02-25  Roland McGrath  <roland@redhat.com>
3168         * alloca_cutoff.c: Correct license text.
3169         * tst-unload.c: Likewise.
3170         * sysdeps/pthread/allocalim.h: Likewise.
3171         * sysdeps/pthread/pt-initfini.c: Likewise.
3172         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3173         * sysdeps/pthread/bits/sigthread.h: Likewise.
3174         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3175         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3177 2005-02-16  Roland McGrath  <roland@redhat.com>
3179         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3180         Use unsigned int * for ptr_nthreads.
3182 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3184         [BZ #721]
3185         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3186         gcc4.
3188 2005-02-07  Richard Henderson  <rth@redhat.com>
3190         [BZ #787]
3191         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3192         argument.
3194 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3196         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3197         order of arguments in invocation of atomic_add_zero.
3199 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3201         [BZ #737]
3202         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3203         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3204         at least gotntpoff relocation and addition.
3205         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3206         Likewise.
3207         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3208         Likewise.
3209         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3210         Likewise.
3212 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3214         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3215         entry for static tls deallocation fix.
3216         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3217         also contains information whether the memory pointed to is static
3218         TLS or not.
3219         * sysdeps/i386/tls.h: Likewise.
3220         * sysdeps/ia64/tls.h: Likewise.
3221         * sysdeps/powerpc/tls.h: Likewise.
3222         * sysdeps/s390/tls.h: Likewise.
3223         * sysdeps/sh/tls.h: Likewise.
3224         * sysdeps/sparc/tls.h: Likewise.
3225         * sysdeps/x86_64/tls.h: Likewise.
3227 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3229         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3231 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3233         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3234         %esp.
3235         * Makefile (tests): Add tst-align2.
3236         * tst-align2.c: New test.
3237         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3238         -mpreferred-stack-boundary=4.
3240 2004-12-18  Roland McGrath  <roland@redhat.com>
3242         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3243         New file removed withdrawn for the moment.
3245 2004-12-17  Richard Henderson  <rth@redhat.com>
3247         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3248         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3250 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3252         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3253         Increased PTHREAD_STACK_MIN.
3255         * tst-context1.c (stacks): Use bigger stack size.
3257 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3259         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3260         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3262 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3264         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3265         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3266         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3268 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3270         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3272 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3274         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3275         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3277         * tst-getpid1.c: If child crashes, report this first.  Print which
3278         signal.
3280 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3282         * init.c (__pthread_initialize_minimal_internal): Also unblock
3283         SIGSETXID.
3285 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3287         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3288         _POSIX_THREAD_CPUTIME): Define to 0.
3289         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3290         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3291         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3292         __timer_signal_thread_tclk): Remove.
3293         (init_module): Remove their initialization.
3294         (thread_cleanup): Remove their cleanup assertions.
3295         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3296         __timer_signal_thread_tclk): Remove.
3297         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3298         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3299         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3301 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3303         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3304         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3306         * Makefile (tests): Add tst-getpid2.
3307         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3308         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3309         * tst-getpid2.c: New test.
3311 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3313         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3315 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3317         * Makefile (tests): Add tst-getpid1.
3318         * tst-getpid1.c: New file.
3319         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3320         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3322 2004-12-02  Roland McGrath  <roland@redhat.com>
3324         * Makefile (libpthread-nonshared): Variable removed.
3325         ($(objpfx)libpthread_nonshared.a): Target removed.
3326         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3327         These are now handled by generic magic from
3328         libpthread-static-only-routines being set.
3330 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3332         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3333         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3334         _POSIX_THREAD_PRIO_PROTECT): Define.
3335         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3336         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3337         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3339 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3341         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3342         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3343         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3344         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3345         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3346         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3347         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3349 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3351         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3353         * Makefile (libpthread-routines): Add pthread_setschedprio.
3354         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3355         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3356         * pthread_setschedprio.c: New file.
3358 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3360         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3361         * pthread_cancel.c (pthread_create): Likewise.
3363         * Makefile (libpthread-routines): Add vars.
3364         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3365         * init.c (__default_stacksize, __is_smp): Remove.
3366         * vars.c: New file.
3367         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3368         and define a wrapper macro.
3369         (PTHREAD_STATIC_FN_REQUIRE): Define.
3370         * allocatestack.c (__find_thread_by_id): Undefine.
3371         * pthread_create (__pthread_keys): Remove.
3372         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3373         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3374         PTHREAD_STATIC_FN_REQUIRE.
3376 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3378         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3379         parameter to REGISTER macro.
3381 2004-11-17  Roland McGrath  <roland@redhat.com>
3383         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3384         Make sure SIGCANCEL is blocked as well.
3386 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3388         * sysdeps/pthread/setxid.h: New file.
3389         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3390         (struct xid_command): Add forward decl.
3391         (struct pthread_functions): Change return type of __nptl_setxid hook
3392         to int.
3393         * pthreadP.h (__nptl_setxid): Change return type to int.
3394         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3395         calling thread, return its return value and set errno on failure.
3396         * descr.h (struct xid_command): Change id type to long array.
3398         * Makefile: Add rules to build and test tst-setuid1 and
3399         tst-setuid1-static.
3400         * tst-setuid1.c: New test.
3401         * tst-setuid1-static.c: New test.
3403 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3405         * Makefile (tests): Add tst-exit3.
3406         * tst-exit3.c: New test.
3408 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3410         * Makefile (tests): Add tst-exit2.
3411         * tst-exit2.c: New file.
3413 2004-11-09  Roland McGrath  <roland@redhat.com>
3415         [BZ #530]
3416         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3417         here, before calling clone.
3418         * pthread_create.c (start_thread): Don't do it here.
3420 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3422         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3424 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3426         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3427         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3428         assembler warning.
3430 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3432         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3433         if sched_priority is not between minprio and maxprio.
3435 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3437         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3438         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3440         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3441         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3443 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3445         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3446         not-cancelable I/O functions.
3448 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3450         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3451         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3452         make sure 2 is stored in the futex and we looked at the old value.
3453         Fix a few other problems to return the correct value.
3455 2004-10-14  Richard Henderson  <rth@redhat.com>
3457         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3458         make gcc4 happy.
3460 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3462         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3463         of pthread-functions.h and pthreaddef.h.
3464         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3466         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3467         Change __data.__nwaiters from int to unsigned int.
3469         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3470         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3472         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3473         before return type.
3475         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3476         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3478 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3480         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3481         test fails, remove message queue.
3482         (tf_msgsnd): Likewise.
3484 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3486         * tst-clock1.c: Change #ifdef to #if defined.
3487         * tst-clock2.c: Likewise.
3488         * tst-cond11.c: Likewise.
3490         * sysdeps/pthread/timer_create.c (timer_create): Use
3491         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3492         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3493         THREAD_CPUTIME.
3495 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3497         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3498         _POSIX_THREAD_CPUTIME): Define to 0.
3500 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3502         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3503         and _POSIX_THREAD_CPUTIME to zero.
3504         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3505         * tst-barrier2.c: Fix testing for POSIX feature.
3506         * tst-clock1.c: Likewise.
3507         * tst-clock2.c: Likewise.
3508         * tst-cond11.c: Likewise.
3509         * tst-cond4.c: Likewise.
3510         * tst-cond6.c: Likewise.
3511         * tst-flock2.c: Likewise.
3512         * tst-mutex4.c: Likewise.
3513         * tst-mutex9.c: Likewise.
3514         * tst-rwlock12.c: Likewise.
3515         * tst-rwlock4.c: Likewise.
3516         * tst-signal1.c: Likewise.
3517         * tst-spin2.c: Likewise.
3518         * sysdeps/pthread/posix-timer.h: Likewise.
3519         * sysdeps/pthread/timer_create.c: Likewise.
3520         * sysdeps/pthread/timer_routines.c: Likewise.
3522 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3524         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3525         (__lll_mutex_timedlock_wait): Address futex correctly.
3527         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3528         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3529         make sure 2 is stored in the futex and we looked at the old value.
3530         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3531         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3532         which might very well made the code not working at all before.
3533         [BZ #417]
3535 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3537         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3538         allow SIGSETXID to be sent.
3539         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3540         for SIGSETXID to be defined.
3541         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3542         SIGSETXID cannot be blocked.
3544         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3545         Add __extension__ to long long types.
3546         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3547         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3548         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3549         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3550         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3551         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3552         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3554 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3556         * descr.h (struct pthread): Add stopped_start field.
3557         * sysdeps/pthread/createthread.c (create_thread): Set
3558         start_stopped flag in descriptor for new thread appropriately.
3559         * pthread_create.c (start_thread): Only take lock to be stopped on
3560         startup if stopped_start flag says so.
3562 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3564         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3565         is created detached and if yes, do not try to free the stack in case
3566         the thread creation failed.
3567         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3568         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3569         case there has been no error.  [BZ #405]
3571         * pthread_create.c (start_thread): Don't wait for scheduler data
3572         etc to be set at the beginning of the function.  The cancellation
3573         infrastructure must have been set up.  And enable async
3574         cancellation before potentially going to sleep.  [BZ #401]
3576 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3578         * Versions: Remove exports for pthread_set*id_np functions.
3579         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3580         for now.
3581         * Makefile: Don't build pthread_set*id code for now.
3583 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3585         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3586         internal use.
3587         * allocatestack.c (__nptl_setxid): New function.
3588         * descr.h (struct xid_command): Define type.
3589         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3590         (sighandler_setxid): New function.
3591         (__pthread_initialize_minimal): Register sighandler_setxid for
3592         SIGCANCEL.
3593         * pt-allocrtsig.c: Update comment.
3594         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3595         Declare __nptl_setxid.
3596         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3597         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3598         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3599         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3600         and pthread_setresuid_np.
3601         * pthread_setgid_np.c: New file.
3602         * pthread_setuid_np.c: New file.
3603         * pthread_setegid_np.c: New file.
3604         * pthread_seteuid_np.c: New file.
3605         * pthread_setregid_np.c: New file.
3606         * pthread_setreuid_np.c: New file.
3607         * pthread_setresgid_np.c: New file.
3608         * pthread_setresuid_np.c: New file.
3609         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3610         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3611         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3612         and pthread_setresuid_np.
3613         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3614         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3615         pthread_setregid, and pthread_setresgid.
3617 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3619         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3620         ENOMEM when out of memory.
3622 2004-09-10  Roland McGrath  <roland@redhat.com>
3624         [BZ #379]
3625         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3626         code, since we don't try to use the broken CLONE_STOPPED any more.
3627         * pthread_create.c (start_thread): Likewise.
3629 2004-09-15  Richard Henderson  <rth@redhat.com>
3631         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3633 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3635         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3636         (__libc_unwind_longjmp): Delete macro and declare as function.
3637         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3638         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3639         nptl directory.
3640         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3641         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3642         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3644 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3646         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3647         for __USE_XOPEN2K.
3648         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3649         types also for __USE_XOPEN2K.
3650         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3651         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3652         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3653         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3654         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3655         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3656         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3657         [BZ #320]
3659 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3661         * sysdeps/pthread/pthread.h
3662         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3663         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3664         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3665         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3666         [BZ #375]
3668 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3670         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3671         PSEUDO to be used with . prefix.
3673         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3674         Use atomic_increment instead of atomic_exchange_and_add.
3675         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3676         Likewise.
3677         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3678         Likewise.
3679         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3680         Likewise.
3682         * allocatestack.c (allocate_stack): Use atomic_increment_val
3683         instead of atomic_exchange_and_add.
3684         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3685         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3686         Likewise.
3687         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3688         Likewise.
3690         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3691         the initialization function might throw.
3693 2005-09-05  Richard Henderson  <rth@redhat.com>
3695         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3696         Move definition inside libpthread, libc, librt check.  Provide
3697         definition for rtld.
3699 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3701         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3702         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3703         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3704         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3705         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3706         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3707         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3708         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3709         * unwind.c: Use it.
3711         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3712         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3713         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3714         Likewise.
3715         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3716         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3717         this is the last waiter, signal pthread_cond_destroy caller and
3718         avoid using the pthread_cond_t structure after unlock.
3719         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3720         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3721         Read clock type from the least significant bits of __nwaiters instead
3722         of __clock.
3723         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3724         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
3726 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
3728         [BZ #342]
3729         * Makefile (tests): Add tst-cond20 and tst-cond21.
3730         * tst-cond20.c: New test.
3731         * tst-cond21.c: New test.
3732         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3733         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
3734         it unsigned int.
3735         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3736         Likewise.
3737         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3738         (pthread_cond_t): Likewise.
3739         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3740         Likewise.
3741         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3742         Likewise.
3743         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3744         Likewise.
3745         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
3746         (cond_nwaiters): New.
3747         (clock_bits): New.
3748         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
3749         if there are waiters not signalled yet.
3750         Wait until all already signalled waiters wake up.
3751         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
3752         __nwaiters.  If pthread_cond_destroy has been called and this is the
3753         last waiter, signal pthread_cond_destroy caller and avoid using
3754         the pthread_cond_t structure after unlock.
3755         (__pthread_cond_wait): Increment __nwaiters in the beginning,
3756         decrement it when leaving.  If pthread_cond_destroy has been called
3757         and this is the last waiter, signal pthread_cond_destroy caller.
3758         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3759         Likewise.  Read clock type from the least significant bits of
3760         __nwaiters instead of __clock.
3761         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
3762         whether clock ID can be encoded in COND_CLOCK_BITS bits.
3763         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
3764         clock type just from the last COND_CLOCK_BITS bits of value.
3765         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
3766         instead of __clock, just from second bit of condattr's value.
3768 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
3770         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
3771         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
3772         != 64.
3773         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3775 2004-08-15  Roland McGrath  <roland@frob.com>
3777         * pthread_atfork.c: Update copyright terms including special exception
3778         for these trivial files, which are statically linked into executables
3779         that use dynamic linking for the significant library code.
3781 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3783         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
3784         pthread_rwlock_rdlock.
3785         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
3786         Decrease __nr_readers_queued after reacquiring lock.
3787         * sysdeps/pthread/pthread_rwlock_timedrdlock
3788         (pthread_rwlock_timedrdlock): Likewise.
3789         Reported by Bob Cook <bobcook47@hotmail.com>.
3791 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
3793         * tst-rwlock14.c (tf): Read main thread handle from *ARG
3794         before pthread_barrier_wait.
3796 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
3798         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3799         Remove unnecessary exception handling data.
3801 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
3803         [BZ #284]
3804         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
3805         instead of clockid_t.
3807 2004-07-21  Roland McGrath  <roland@redhat.com>
3809         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
3811 2004-07-19  Roland McGrath  <roland@redhat.com>
3813         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
3815 2004-07-02  Roland McGrath  <roland@redhat.com>
3817         * configure: Don't exit.
3819 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3821         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3822         (__pthread_cond_timedwait): Check for invalid nanosecond in
3823         timeout value.
3825 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
3827         * Makefile: Add rules to build and run tst-fini1.
3828         * tst-fini1.c: New file.
3829         * tst-fini1mod.c: New file.
3831 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
3833         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
3834         if no cancellation support is needed.
3835         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3836         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3837         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3838         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3839         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3840         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3841         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3842         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3843         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3845         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
3846         only if not already defined.
3848 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
3850         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
3851         constraint "m" instead of "0" for futex.
3853         * shlib-versions: Add powerpc64-.*-linux.*.
3855 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
3857         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
3858         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
3859         for valid tv_nsec.
3860         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
3861         1 billion and 64-bit tv_nsec which is valid when truncated to 32
3862         bits.
3864 2004-06-29  Roland McGrath  <roland@redhat.com>
3866         * Banner: NPTL no longer has its own version number.
3867         * Makefile (nptl-version): Variable removed.
3868         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
3869         using $(version), the glibc version number.
3871 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3873         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
3874         Fix branch offset for a PLT entry.
3875         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
3876         Likewise.
3877         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3878         Likewise.
3879         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
3880         Likewise.
3881         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
3882         Likewise.
3884 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3886         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
3887         unconditionally.
3889 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3891         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3892         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
3893         instead of tv_sec.
3894         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
3895         (pthread_rwlock_timedrdlock): Likewise.
3897 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
3899         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
3900         Set __r7 to val, not mutex.
3902 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
3904         * Makefile: Add rules to build tst-rwlock14.
3905         * tst-rwlock14.c: New file.
3907 2004-06-24  Boris Hu  <boris.hu@intel.com>
3909         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
3910         check.
3911         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3913 2004-06-19  Andreas Jaeger  <aj@suse.de>
3915         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
3916         assembler in last patch.
3918 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
3920         * sysdeps/pthread/pthread_cond_timedwait.c
3921         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
3922         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3923         (__pthread_cond_timedwait): Check for invalid nanosecond in
3924         timeout value.
3925         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3926         * tst-cond19.c: New file.
3927         * Makefile: Add rules to build and run tst-cond19.
3929 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
3931         * tst-context1.c (GUARD_PATTERN): Defined.
3932         (tst_context_t): Define struct containing ucontext_t & guard words.
3933         (ctx): Declare as an array of tst_context_t.
3934         (fct): Verify uc_link & guard words are still valid.
3935         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
3937 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3939         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3940         Add __data.__futex field, reshuffle __data.__clock.
3941         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
3942         (__pthread_cond_signal): Increment __futex at the same time as
3943         __wakeup_seq or __total_seq.  Pass address of __futex instead of
3944         address of low 32-bits of __wakeup_seq to futex syscall.
3945         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
3946         (__pthread_cond_wait): Likewise.  Pass __futex value from before
3947         releasing internal lock to FUTEX_WAIT.
3948         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3949         (__pthread_cond_timedwait): Likewise.
3950         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
3951         (FUTEX_CMP_REQUEUE): Define.
3952         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
3953         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
3954         Pass __futex value from before the unlock and __futex address instead
3955         of address of low 32-bits of __wakeup_seq to futex syscall.
3956         Fallback to FUTEX_WAKE all on any errors.
3958 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
3960         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
3961         comment typo.
3962         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
3963         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
3964         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
3965         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
3966         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
3968 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3970         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
3971         Add memory clobber to inline assembly.
3972         (__lll_mutex_trylock): Likewise.
3973         (__lll_mutex_cond_trylock): Likewise.
3975 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3977         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
3978         Pass val argument as 6th system call argument in %r7.
3980 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
3982         * Makefile (tests): Add tst-cond16.
3983         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
3984         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
3985         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3986         Add __data.__futex field, reshuffle __data.__clock.
3987         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
3988         (__pthread_cond_signal): Increment __futex at the same time as
3989         __wakeup_seq or __total_seq.  Pass address of __futex instead of
3990         address of low 32-bits of __wakeup_seq to futex syscall.
3991         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
3992         (__pthread_cond_wait): Likewise.  Pass __futex value from before
3993         releasing internal lock to FUTEX_WAIT.
3994         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
3995         (__pthread_cond_timedwait): Likewise.
3996         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
3997         (FUTEX_CMP_REQUEUE): Define.
3998         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
3999         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4000         Pass __futex value from before the unlock and __futex address instead
4001         of address of low 32-bits of __wakeup_seq to futex syscall.
4002         Fallback to FUTEX_WAKE all on any errors.
4003         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4004         Define.
4005         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4006         internally.  Return non-zero if error, zero if success.
4007         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4008         Add __data.__futex field, reshuffle __data.__clock.
4009         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4010         Define.
4011         (lll_futex_requeue): Add val argument, return 1 unconditionally
4012         for the time being.
4013         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4014         Add __data.__futex field, reshuffle __data.__clock.
4015         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4016         Define.
4017         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4018         internally.  Return non-zero if error, zero if success.
4019         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4020         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4021         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4022         Define.
4023         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4024         internally.  Return non-zero if error, zero if success.
4025         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4026         Add __data.__futex field, reshuffle __data.__clock.
4027         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4028         Define.
4029         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4030         internally.  Return non-zero if error, zero if success.
4031         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4032         Add __data.__futex field, reshuffle __data.__clock.
4033         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4034         Add __data.__futex field, reshuffle __data.__clock.
4035         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4036         Increment __futex at the same time as __wakeup_seq or __total_seq.
4037         Pass address of __futex instead of address of low 32-bits of
4038         __wakeup_seq to futex syscall.
4039         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4040         Pass __futex value from before releasing internal lock
4041         to FUTEX_WAIT.
4042         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4043         Likewise.  Avoid unnecessary shadowing of variables.
4044         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4045         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4046         unlock and __futex address instead of address of low 32-bits of
4047         __wakeup_seq to futex_requeue macro, adjust for new return value
4048         meaning.
4049         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4050         (__pthread_cond_signal): Increment __futex at the same time as
4051         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4052         address of low 32-bits of __wakeup_seq to futex syscall.
4053         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4054         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4055         releasing internal lock to FUTEX_WAIT.
4056         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4057         (__pthread_cond_timedwait): Likewise.
4058         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4059         (FUTEX_CMP_REQUEUE): Define.
4060         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4061         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4062         Pass __futex value from before the unlock and __futex address instead
4063         of address of low 32-bits of __wakeup_seq to futex syscall.
4064         Fallback to FUTEX_WAKE all on any errors.
4066 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4068         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4069         Add nop to align the end of critical section.
4070         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4072 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4074         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4075         Add __broadcast_seq field.
4076         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4077         all waiters as woken with woken_seq and bump broadcast counter.
4078         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4079         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4080         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4081         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4083 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4085         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4086         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4087         Reported by Kaz Kojima.
4089 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4091         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4093 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4095         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4096         __broadcast_seq with bc_seq after acquiring internal lock instead of
4097         before it.
4099 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4101         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4102         compilation.
4103         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4104         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4105         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4106         (pthread_cond_t): Add __data.__broadcast_seq field.
4107         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4108         (FRAME_SIZE): Define.
4109         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4110         Comment typo fixes.
4111         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4112         Define.
4113         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4114         typo fixes.
4115         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4116         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4117         fixes.
4119 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4121         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4122         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4123         Add __broadcast_seq field.
4124         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4125         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4126         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4127         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4128         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4130         all waiters as woken with woken_seq and bump broadcast counter.
4131         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4132         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4133         __broadcast_seq field.
4134         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4135         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4136         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4137         * pthread_cond_init.c: Initialize __broadcast_seq field.
4138         * Makefile (tests): Add tst-cond17 and tst-cond18.
4139         Add .NOTPARALLEL goal.
4140         * tst-cond16.c: New file.  From Jakub.
4141         * tst-cond17.c: New file.  From Jakub.
4142         * tst-cond18.c: New file.  From Jakub.
4144 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4146         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4147         unwind info.
4149         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4150         Parametrize frame size.  Correct some unwind info.
4151         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4153 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4155         * tst-stack3.c: Note testing functionality beyond POSIX.
4157 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4159         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4160         Change conditional from ifdef to if.
4162 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4164         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4165         SYSDEP_CANCEL_ERROR): Define.
4166         (PSEUDO): Use it.
4168 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4170         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4172 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4174         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4176 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4178         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4179         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4180         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4181         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4183 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4185         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4186         thread has all signals blocked.
4188 2004-04-18  Andreas Jaeger  <aj@suse.de>
4190         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4191         (SEM_VALUE_MAX): Add missing brace.
4193 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4195         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4196         in rt subdir.
4197         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4198         * sysdeps/pthread/tst-mqueue8x.c: New test.
4199         * tst-cancel4.c: Update comment about message queues.
4201         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4202         return it_value { 0, 0 }.
4203         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4204         like SIGEV_SIGNAL.
4205         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4206         assertion for SIGEV_NONE.
4207         (thread_attr_compare): Compare all attributes, not just a partial
4208         subset.
4210 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4212         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4214 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4216         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4217         Just use a plain number.
4218         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4219         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4220         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4221         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4222         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4223         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4224         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4226 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4228         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4229         frame info.
4230         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4232 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4234         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4235         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4236         of calling sigwaitinfo.
4238 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4240         * allocatestack.c (allocate_stack): Set reported_guardsize
4241         unconditionally.
4242         * pthread_getattr_np.c (pthread_getattr_np): Use
4243         reported_guardsize instead of guardsize.
4244         * descr.h (struct pthread): Add reported_guardsize field.
4246 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4248         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4250 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4252         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4254 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4256         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4257         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4258         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4259         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4260         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4261         Define.
4262         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4263         (_POSIX_MESSAGE_PASSING): Define.
4264         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4265         (_POSIX_MESSAGE_PASSING): Define.
4266         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4267         (_POSIX_MESSAGE_PASSING): Define.
4269 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4271         * tst-context1.c (fct): Check whether correct stack is used.
4273 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4275         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4276         matching constraints for asm mem parameters.
4278         * tst-clock2.c (tf): Don't define unless needed.
4280 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4282         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4283         $(gnulib).
4285 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4287         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4288         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4289         * pthreadP.h: Declare __nptl_deallocate_tsd.
4290         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4291         Adjust caller.
4293         * Makefile (tests): Add tst-tsd5.
4294         * tst-tsd5.c: New file.
4296 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4298         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4299         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4300         is SHLIB_COMPAT check.
4301         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4302         (__pthread_attr_getaffinity_old): Likewise.
4303         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4304         (__pthread_getaffinity_old): Likewise.
4305         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4306         (__pthread_setaffinity_old): Likewise.
4308 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4310         * allocatestack.c (_make_stacks_executable): Call
4311         _dl_make_stack_executable first.
4313 2004-03-24  Roland McGrath  <roland@redhat.com>
4315         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4316         constraint instead of "0".
4318 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4320         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4321         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4323         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4324         code to avoid warning.
4326 2004-03-24  Andreas Jaeger  <aj@suse.de>
4328         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4329         (__pthread_attr_setaffinity_old): Remove const.
4331 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4333         * sysdeps/unix/sysv/linux/smp.h: New file.
4334         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4335         * init.c: Define __is_smp.
4336         (__pthread_initialize_minimal_internal): Call is_smp_system to
4337         initialize __is_smp.
4338         * pthreadP.h: Declare __is_smp.
4339         Define MAX_ADAPTIVE_COUNT is necessary.
4340         * pthread_mutex_init.c: Add comment regarding __spins field.
4341         * pthread_mutex_lock.c: Implement adaptive mutex type.
4342         * pthread_mutex_timedlock.c: Likewise.
4343         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4344         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4345         Add __spins field.
4346         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4347         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4348         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4349         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4350         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4351         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4352         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4353         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4354         lll_mutex_cond_trylock.
4355         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4356         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4357         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4358         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4359         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4360         Define BUSY_WAIT_NOP.
4361         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4362         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4364         * tst-mutex5.c: Add support for testing adaptive mutexes.
4365         * tst-mutex7.c: Likewise.
4366         * tst-mutex5a.c: New file.
4367         * tst-mutex7a.c: New file.
4368         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4370         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4371         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4372         vgettimeofday call might destroy the content.
4374         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4375         @pause in the loop.
4377         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4378         No need to restrict type of ret.  Make it int.  Add comment.
4380         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4381         Remove unnecessary setne instruction.
4383 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4385         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4386         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4387         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4388         If realloc fails, break out of the loop.
4390 2004-03-20  Andreas Jaeger  <aj@suse.de>
4392         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4393         (__pthread_setaffinity_old): Fix interface.
4394         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4395         (__pthread_getaffinity_old): Likewise.
4397         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4398         (__pthread_setaffinity_new): Remove duplicate declaration.
4400 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4402         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4403         the return value to a safe register.
4404         (CDISABLE): Set the function argument correctly.
4406 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4408         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4409         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4410         Rewrite so that only one locked memory operation per round is needed.
4411         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4412         (pthread_barrier_wait): After wakeup, release lock only when the
4413         last thread stopped using the barrier object.
4414         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4415         (__pthread_cond_wait): Don't store mutex address if the current
4416         value is ~0l.  Add correct cleanup support and unwind info.
4417         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4418         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4419         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4420         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4421         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4422         Add correct cleanup support and unwind info.
4423         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4424         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4425         information for syscall wrappers.
4427 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4429         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4430         cpusetsize field, remove next.
4431         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4432         parameter for size of the CPU set.
4433         (pthread_setaffinity_np): Likewise.
4434         (pthread_attr_getaffinity_np): Likewise.
4435         (pthread_attr_setaffinity_np): Likewise.
4436         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4437         interface change, keep compatibility code.
4438         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4439         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4440         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4441         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4442         __pthread_getaffinity_np.
4443         * Versions: Add version for changed interfaces.
4444         * tst-attr3.c: Adjust test for interface change.
4445         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4446         increasing buffer sizes.
4447         * pthread_attr_destroy.c: Remove unused list handling.
4448         * pthread_attr_init.c: Likewise.
4450 2004-03-17  Roland McGrath  <roland@redhat.com>
4452         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4453         first argument to clock_getres so we ever enable kernel timers.
4455 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4457         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4459 2004-03-12  Richard Henderson  <rth@redhat.com>
4461         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4462         oldvalue from CENABLE to CDISABLE.
4464 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4466         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4467         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4468         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4469         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4471 2004-03-11  Richard Henderson  <rth@redhat.com>
4473         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4474         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4475         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4477 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4479         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4480         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4481         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4483 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4485         * forward.c (__pthread_cond_broadcast_2_0,
4486         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4487         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4488         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4490 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4492         * sysdeps/sh/tcb-offsets.sym: Add PID.
4493         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4494         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4496 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4498         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4499         include <sysdep-cancel.h>, vfork is no cancellation point.
4500         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4501         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4502         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4504 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4506         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4507         libc_hidden_def.
4508         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4509         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4510         Likewise.
4511         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4512         Likewise.
4513         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4514         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4515         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4516         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4517         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4519         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4520         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4521         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4522         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4523         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4524         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4526         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4527         a local register for saving old PID.  Negate PID in parent upon exit.
4529         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4530         tcb-offsets.h.
4531         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4532         before syscall, set to the old value in the parent afterwards.
4533         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4534         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4535         tcb-offsets.h.
4536         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4537         before syscall, set to the old value in the parent afterwards.
4538         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4539         * sysdeps/s390/tcb-offsets.sym: Add PID.
4541         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4542         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4543         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4544         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4545         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4546         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4548 2004-03-10  Andreas Schwab  <schwab@suse.de>
4550         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4551         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4552         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4554 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4556         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4557         * tst-cancel21.c (do_one_test): Likewise.
4558         Reported by Gordon Jin <gordon.jin@intel.com>.
4560 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4562         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4563         if non-zero and set to INT_MIN if zero.
4564         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4565         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4566         (SAVE_PID, RESTORE_PID): Define.
4567         (__vfork): Use it.
4568         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4569         Use relative path to avoid including NPTL i386/vfork.S.
4570         (SAVE_PID, RESTORE_PID): Define.
4571         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4572         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4573         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4574         tst-vfork2x.
4575         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4576         * tst-vfork1.c: New test.
4577         * tst-vfork2.c: New test.
4578         * tst-vfork1x.c: New test.
4579         * tst-vfork2x.c: New test.
4581 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4583         * sysdeps/i386/tcb-offsets.sym: Add PID.
4584         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4585         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4586         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4588 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4590         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4592 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4594         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4595         _rtld_global_ro.
4597 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4599         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4600         _rtld_global_ro.
4602         * tst-once4.c: Remove unnecessary macro definition.
4604         * tst-mutex7.c (do_test): Limit thread stack size.
4605         * tst-once2.c (do_test): Likewise.
4606         * tst-tls3.c (do_test): Likewise.
4607         * tst-tls1.c (do_test): Likewise.
4608         * tst-signal3.c (do_test): Likewise.
4609         * tst-kill6.c (do_test): Likewise.
4610         * tst-key4.c (do_test): Likewise.
4611         * tst-join4.c (do_test): Likewise.
4612         * tst-fork1.c (do_test): Likewise.
4613         * tst-context1.c (do_test): Likewise.
4614         * tst-cond2.c (do_test): Likewise.
4615         * tst-cond10.c (do_test): Likewise.
4616         * tst-clock2.c (do_test): Likewise.
4617         * tst-cancel10.c (do_test): Likewise.
4618         * tst-basic2.c (do_test): Likewise.
4619         * tst-barrier4.c (do_test): Likewise.
4621 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4623         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4625 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4627         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4628         (__pthread_cond_timedwait): Optimize wakeup test.
4629         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4630         (__pthread_cond_wait): Likewise.
4631         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4632         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4633         Likewise.
4635 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4637         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4638         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4639         the atomic instruction needed.
4640         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4641         (__lll_mutex_lock_wait): Likewise.
4643 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4645         * Makefile (tests): Add tst-cond14 and tst-cond15.
4646         * tst-cond14.c: New file.
4647         * tst-cond15.c: New file.
4649 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4651         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4652         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4653         needs to be implemented differently to be useful.
4655 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4657         * pthread_attr_setschedparam.c: Don't test priority against limits
4658         here.  Set ATTR_FLAG_SCHED_SET flag.
4659         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4660         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4661         from parent thread to child.  If attribute is used and scheduling
4662         parameters are not inherited, copy parameters from attribute or
4663         compute them.  Check priority value.
4664         * pthread_getschedparam.c: If the parameters aren't known yet get
4665         them from the kernel.
4666         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4667         ATTR_FLAG_POLICY_SET flag for thread.
4668         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4669         and ATTR_FLAG_POLICY_SET.
4671         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4673         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4674         fail if stack address hasn't been set.  Just return 0.
4676 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4678         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4679         libpthread for the files in this list.
4680         (CFLAGS-tst-unload): Removed.
4681         * tst-unload.c (do_test): Don't use complete path for
4682         LIBPHREAD_SO.
4684         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4685         tst-_res1mod2.
4687 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4689         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4690         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4691         operation per round is needed.
4692         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4693         (__lll_mutex_lock_wait): Likewise.
4695 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4697         * tst-cancel9.c (cleanup): Don't print to stderr.
4699 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4701         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4703 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4705         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4706         (__syscall_error_handler2): Call CDISABLE.
4707         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4708         (__syscall_error_handler2): Call CDISABLE.
4710         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4711         Release lock before the loop, don't reacquire it.
4713         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4715 2004-02-19  Andreas Schwab  <schwab@suse.de>
4717         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4718         Fix last change.
4720 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
4722         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4723         (pthread_barrier_wait): After wakeup, release lock only when the
4724         last thread stopped using the barrier object.
4725         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
4726         (pthread_barrier_wait): Likewise.
4727         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4728         Likewise.
4729         * Makefile (tests): Add tst-barrier4.
4730         * tst-barrier4.c: New file.
4732         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4733         (__pthread_cond_timedwait): Perform timeout test while holding
4734         internal lock to prevent wakeup race.
4735         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4736         * sysdeps/pthread/pthread_cond_timedwait.c
4737         (__pthread_cond_timedwait): Likewise.
4738         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4739         (__pthread_cond_timedwait): Likewise.
4741 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
4743         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
4744         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
4745         * Makefile (tests): Add tst-rwlock13.
4746         * tst-rwlock13.c: New test.
4748 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
4750         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4751         (__condvar_tw_cleanup): Little optimization.
4752         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4754 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
4756         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
4757         libpthread as "lib" parameter to SHLIB_COMPAT.
4758         (__novmx_siglongjmp): Fix typo in function name.
4759         (__novmx_longjmp): Fix typo in function name.
4761 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4763         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
4764         __builtin_expect.
4766         * sysdeps/generic/pt-longjmp.c: Moved to...
4767         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
4769 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
4771         * Makefile (libpthread-routines): Add pt-cleanup.
4772         * pt-longjmp.c: Removed.
4773         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
4774         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
4775         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
4776         Version longjmp, siglongjmp for GLIBC_2.3.4.
4777         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
4779 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4781         * sysdeps/pthread/pthread_cond_timedwait.c
4782         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
4783         Reuse code.  Add __builtin_expects.
4785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4786         (__pthread_cond_timedwait): Get internal lock in case timeout has
4787         passed before the futex syscall.
4788         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4790 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
4792         * allocatestack.c: Pretty printing.
4794         * sysdeps/pthread/createthread.c (create_thread): Don't add
4795         CLONE_DETACHED bit if it is not necessary.
4797 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
4799         * pthread_getattr_np.c: Include ldsodefs.h.
4801 2004-01-16  Richard Henderson  <rth@redhat.com>
4803         * allocatestack.c: Don't declare __libc_stack_end.
4804         * init.c (__pthread_initialize_minimal_internal): Likewise.
4805         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
4807 2004-01-15  Richard Henderson  <rth@redhat.com>
4809         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
4810         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
4811         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
4812         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
4813         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
4814         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
4815         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
4816         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
4818 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
4820         * init.c (pthread_functions): Make array const.
4822 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
4824         * allocatestack.c (__make_stacks_executable): Change interface.
4825         Check parameters.  Pass parameter on to libc counterpart.
4826         * pthreadP.h: Change declaration.
4828 2004-01-13  Richard Henderson  <rth@redhat.com>
4830         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
4831         prototype form.
4832         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
4833         Likewise.
4835         * sysdeps/alpha/Makefile: New file.
4836         * sysdeps/alpha/tcb-offsets.sym: New file.
4837         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4838         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
4840         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
4841         on powerpc version.
4843 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
4845         * Makefile (tests): Add tst-backtrace1.
4846         * tst-backtrace1.c: New test.
4848 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
4850         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
4851         register as second parameter to the REGISTER macro.
4852         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
4853         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
4854         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
4855         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
4856         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
4857         of thread register as second parameter to REGISTER macro in 64 case.
4859 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
4861         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
4862         (CFLAGS-getpid.o): Defined.
4863         (CFLAGS-getpid.os): Defined.
4865 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
4867         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
4868         returned for main thread does not overlap with any other VMA.
4869         Patch by Jakub Jelinek.
4871 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
4873         * tst-raise1.c: Include stdio.h.
4875 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
4877         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
4878         setting with __ASSUME_TGKILL || defined __NR_tgkill.
4879         If pid is 0, set it to selftid.
4880         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
4881         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
4882         != 0, return self->tid without doing a syscall.
4883         * descr.h (struct pthread): Move pid field after tid.
4885         * Makefile (tests): Add tst-raise1.
4886         * tst-raise1.c: New file.
4888 2003-12-23  Roland McGrath  <roland@redhat.com>
4890         * tst-oddstacklimit.c: New file.
4891         * Makefile (tests): Add it.
4892         (tst-oddstacklimit-ENV): New variable.
4894         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
4895         value up to page size for __default_stacksize.
4897 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
4899         * Makefile (tests): Add tst-eintr5.
4900         * tst-eintr5.c: New file.
4902         * eintr.c (eintr_source): Prevent sending signal to self.
4904         * tst-eintr2.c (tf1): Improve error message.
4906 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
4908         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
4909         * sysdeps/unix/sysv/linux/getpid.c: New file.
4910         * pthread_cancel.c: Add comment explaining use of PID field.
4911         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4912         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
4913         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
4914         temporarily to signal the field must not be relied on and updated
4915         by getpid().
4916         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
4917         temporarily negative.
4918         * sysdeps/unix/sysv/linux/raise.c: Likewise.
4920 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
4922         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
4923         (eintr_source): If ARG != NULL, use pthread_kill.
4924         * tst-eintr1.c: Adjust for this change.
4925         * tst-eintr2.c: Likewise.
4926         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
4927         * tst-eintr3.c: New file.
4928         * tst-eintr4.c: New file.
4930 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
4932         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
4933         if CANCELSTATE_BITMASK is set.
4934         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
4935         Likewise.
4937         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
4938         (tests-reverse): Add tst-cancel23.
4939         * tst-cancel22.c: New test.
4940         * tst-cancel23.c: New test.
4942 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
4944         * tst-eintr1.c: Better error messages.
4946         * Makefile (tests): Add tst-eintr2.
4947         * tst-eintr2.c: New file.
4949 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
4951         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
4952         (CFLAGS-tst-cancelx21.c): Set.
4953         * tst-cancel21.c: New test.
4954         * tst-cancelx21.c: New test.
4956         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
4957         comparison operand.
4958         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
4959         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
4960         * pt-longjmp.c: Include jmpbuf-unwind.h.
4961         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
4962         _JMPBUF_UNWINDS.  Adjust compared pointers.
4963         * init.c (__pthread_initialize_minimal_internal): Initialize
4964         pd->stackblock_size.
4965         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
4966         * sysdeps/alpha/jmpbuf-unwind.h: New file.
4967         * sysdeps/i386/jmpbuf-unwind.h: New file.
4968         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
4969         * sysdeps/s390/jmpbuf-unwind.h: New file.
4970         * sysdeps/sh/jmpbuf-unwind.h: New file.
4971         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
4972         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
4973         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
4974         (_JMPBUF_CFA_UNWINDS): Remove.
4975         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
4977 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
4979         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
4980         (CFLAGS-tst-cancelx20.c): Set.
4981         * tst-cancel20.c: New test.
4982         * tst-cancelx20.c: New test.
4984 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
4986         * init.c (__pthread_initialize_minimal_internal): Don't treat
4987         architectures with separate register stack special here when
4988         computing default stack size.
4990 2003-12-17  Roland McGrath  <roland@redhat.com>
4992         * Makefile (tst-cancelx7-ARGS): New variable.
4993         Reportd by Greg Schafer <gschafer@zip.com.au>.
4995 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
4997         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
4998         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
4999         (tst-stack3-ENV): Set.
5000         ($(objpfx)tst-stack3-mem): New.
5001         * tst-stack3.c: New test.
5003 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5005         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5006         Add unwind directives.  Drop unused .regstk directive.
5007         (_fini_EPILOG_BEGINS): Add unwind directives.
5009 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5011         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5012         Assume parameter is a pointer.
5013         (lll_futex_wake): Likewise.
5014         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5015         Likewise.
5016         (lll_futex_wake): Likewise.
5017         Reported by Boris Hu.
5018         * sysdeps/unix/sysv/linux/unregister-atfork.c
5019         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5021         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5023 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5025         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5026         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5027         __rtld_lock_initialize for ld.so lock.
5028         Patch in part by Adam Li <adam.li@intel.com>.
5030 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5032         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5033         in $(gnulib).  Also, remove stale comment.
5035 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5037         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5038         advantage of new syscall stub and optimize accordingly.
5040         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5041         from SYS_futex, to match expectations of
5042         sysdep.h:DO_INLINE_SYSCALL.
5043         (lll_futex_clobbers): Remove.
5044         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5045         (lll_futex_wake): Likewise.
5046         (lll_futex_requeue): Likewise.
5047         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5048         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5049         Jelinek).
5050         (__lll_mutex_lock): Likewise.
5051         (__lll_mutex_cond_lock): Likewise.
5052         (__lll_mutex_timed_lock): Likewise.
5053         (__lll_mutex_unlock): Likewise.
5054         (__lll_mutex_unlock_force): Likewise.
5056         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5057         comes before the include of <sysdep.h>.
5058         (THREAD_SELF_SYSINFO): New macro.
5059         (THREAD_SYSINFO): Likewise.
5060         (INIT_SYSINFO): New macro.
5061         (TLS_INIT_TP): Call INIT_SYSINFO.
5063         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5065         * sysdeps/pthread/createthread.c (create_thread): Use
5066         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5067         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5068         THREAD_SELF_SYSINFO instead of open code.
5069         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5070         (THREAD_SYSINFO): Likewise.
5072         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5074         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5076 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5078         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5079         instead of .init.  Patch by David Mosberger.
5081 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5083         * sysdeps/pthread/configure.in: Remove broken declaration in C
5084         cleanup handling check.
5086 2003-11-30  Andreas Jaeger  <aj@suse.de>
5088         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5089         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5090         Likewise.
5092 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5094         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5095         * pthread_attr_destroy.c: Include shlib-compat.h.
5096         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5097         is set in iattr->flags.
5098         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5100 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5102         * Makefile (distribute): Add tst-cleanup4aux.c.
5104         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5105         include.
5107 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5109         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5110         pthread_cond_signal.
5112         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5113         store mutex address if the current value is ~0l.
5114         * sysdeps/pthread/pthread_cond_timedwait.c
5115         (__pthread_cond_timedwait): Likewise.
5116         * sysdeps/pthread/pthread_cond_broadcast.c
5117         (__pthread_cond_broadcast): Don't use requeue for pshared
5118         condvars.
5120         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5121         (__pthread_cond_wait): Don't store mutex address if the current
5122         value is ~0l.
5123         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5124         (__pthread_cond_timedwait): Likewise.
5125         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5126         (__pthread_cond_broadcast): Don't use requeue for pshared
5127         condvars.
5129         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5130         element with ~0l for pshared condvars, with NULL otherwise.
5132         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5133         (__pthread_cond_wait): Don't store mutex address if the current
5134         value is ~0l.
5135         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5136         (__pthread_cond_timedwait): Likewise.
5137         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5138         (__pthread_cond_broadcast): Don't use requeue for pshared
5139         condvars.
5141         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5142         * tst-cond12.c: New file.
5143         * tst-cond13.c: New file.
5145 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5147         * sysdeps/pthread/configure.in: Make missing forced unwind support
5148         fatal.
5150 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5152         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5154 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5156         * Makefile: Add magic to clean up correctly.
5158 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5160         * unwind.c (FRAME_LEFT): Define.
5161         (unwind_stop): Handle old style cleanups here.
5162         (__pthread_unwind): Handle old style cleanups only if
5163         !HAVE_FORCED_UNWIND.
5164         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5165         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5166         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5167         ($(objpfx)tst-cleanupx4): Likewise.
5168         * tst-cleanup4.c: New test.
5169         * tst-cleanup4aux.c: New.
5170         * tst-cleanupx4.c: New test.
5172 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5174         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5175         lll_mutex_*lock macros to skip atomic operations on some archs.
5177 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5179         * sysdeps/pthread/tst-timer.c (main): Initialize
5180         sigev2.sigev_value as well.
5182 2003-10-15  Roland McGrath  <roland@redhat.com>
5184         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5185         is missing.
5186         * sysdeps/pthread/configure: Regenerated.
5188 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5190         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5191         locking macros.  No distinction between normal and mutex locking
5192         anymore.
5193         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5194         Merge bits from lowlevelmutex.S we still need.
5195         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5196         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5197         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5198         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5199         new mutex implementation.
5200         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5201         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5202         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5203         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5204         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5205         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5206         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5207         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5208         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5209         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5210         symbol for entry point to avoid cancellation.
5212 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5214         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5215         changes.
5216         (SAVE_OLDTYPE_0): Fix a typo.
5218 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5220         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5221         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5223 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5225         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5226         correct offset.
5228 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5230         * Makefile (tests): Add tst-cancel19.
5231         * tst-cancel19.c: New test.
5233 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5235         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5236         restoring of the old cancellation type.
5238 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5240         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5242 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5244         * sysdeps/pthread/malloc-machine.h: New file
5246 2003-09-24  Roland McGrath  <roland@redhat.com>
5248         * allocatestack.c (__make_stacks_executable): Don't ignore return
5249         value from _dl_make_stack_executable.
5251 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5253         * allocatestack.c (__make_stacks_executable): Also change
5254         permission of the currently unused stacks.
5256         * allocatestack.c (change_stack_perm): Split out from
5257         __make_stacks_executable.
5258         (allocate_stack): If the required permission changed between the time
5259         we started preparing the stack and queueing it, change the permission.
5260         (__make_stacks_executable): Call change_stack_perm.
5262         * Makefile: Build tst-execstack-mod locally.
5263         * tst-execstack-mod.c: New file.
5265 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5267         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5269 2003-09-23  Roland McGrath  <roland@redhat.com>
5271         * tst-execstack.c: New file.
5272         * Makefile (tests): Add it.
5273         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5274         (LDFLAGS-tst-execstack): New variable.
5276         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5277         whether to use PROT_EXEC for stack mmap.
5278         (__make_stacks_executable): New function.
5279         * pthreadP.h: Declare it.
5280         * init.c (__pthread_initialize_minimal_internal): Set
5281         GL(dl_make_stack_executable_hook) to that.
5283 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5285         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5286         recommendation from AMD re avoidance of lock prefix.
5288 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5290         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5291         lll_futex_timed_wait instead of lll_futex_wait.
5292         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5293         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5294         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5295         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5296         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5297         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5298         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5299         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5300         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5301         Completely revamp the locking macros.  No distinction between
5302         normal and mutex locking anymore.
5303         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5304         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5305         __lll_lock_timedwait): Fix prototypes.
5306         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5307         __lll_lock_timedwait): Likewise.
5308         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5309         macros, add __builtin_expect.
5310         (lll_mutex_timedlock): Likewise.  Fix return value.
5311         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5312         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5313         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5314         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5315         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5316         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5317         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5318         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5320 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5322         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5323         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5324         operation if possible.
5326         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5327         like jumping over the lock prefix.
5329 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5331         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5332         locking macros.  No distinction between normal and mutex locking
5333         anymore.
5334         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5335         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5336         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5337         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5338         locking.  Merge bits from lowlevelmutex.S we still need.
5339         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5340         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5341         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5342         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5343         * Makefile (routines): Remove libc-lowlevelmutex.
5344         (libpthread-rountines): Remove lowlevelmutex.
5345         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5346         for new mutex implementation.
5347         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5348         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5349         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5350         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5351         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5352         Likewise.
5353         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5354         Likewise.
5355         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5356         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5357         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5358         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5359         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5360         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5361         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5362         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5363         Likewise.
5364         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5365         Likewise.
5366         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5367         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5368         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5369         Don't use requeue.
5370         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5371         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5373 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5375         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5376         in parameters of asm with output parameters.
5378         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5379         type of DECR parameter to int.
5380         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5382 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5384         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5385         guardsize for each thread.
5387 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5389         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5390         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5391         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5393         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5394         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5395         NULL.
5396         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5397         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5398         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5399         (pthread_getaffinity_np): Add hidden_def.
5401         * Makefile (tests): Add tst-attr3.
5402         * tst-attr3.c: New test.
5404         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5406 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5408         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5409         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5411 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5413         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5414         * tst-align.c: Include tst-stack-align.h.
5415         (tf, do_test): Use TEST_STACK_ALIGN macro.
5417 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5419         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5420         variable.
5422 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5424         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5425         stack-related values for the initial thread.
5427 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5429         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5431 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5433         * pthread_mutex_lock.c: Minor code rearrangements.
5435 2003-09-05  Roland McGrath  <roland@redhat.com>
5437         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5438         Instead, include ../nptl_db/db_info.c to do its magic.
5439         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5440         (__pthread_pthread_key_2ndlevel_size): Likewise.
5441         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5442         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5443         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5444         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5445         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5446         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5447         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5448         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5449         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5450         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5451         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5452         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5453         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5454         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5455         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5456         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5457         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5459 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5461         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5462         of pthread_t to be compatible with LT.
5463         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5464         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5465         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5466         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5467         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5468         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5469         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5471 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5473         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5475 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5477         * unwind-forcedunwind.c: Move to...
5478         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5479         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5480         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5481         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5482         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5483         * unwind.c: Include jmpbuf-unwind.h.
5484         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5486 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5488         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5489         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5490         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5491         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5492         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5493         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5494         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5495         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5496         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5497         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5498         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5499         function.
5500         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5501         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5502         * Makefile (tests): Add tst-stack2.
5503         * tst-stack2.c: New test.
5504         * tst-stack1.c: Include limits.h and sys/param.h.
5505         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5507         * pthread_condattr_setpshared.c: Include errno.h.
5508         (pthread_condattr_setpshared): Return EINVAL if pshared
5509         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5511         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5512         defined symbol for entry point to avoid cancellation.
5513         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5514         Likewise.
5515         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5516         Likewise.
5517         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5518         Likewise.
5519         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5520         Likewise.
5521         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5522         Likewise.
5523         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5524         __close_nocancel, __read_nocancel, __write_nocancel,
5525         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5526         libpthread.so or librt.so, define to corresponding function
5527         without _nocancel suffix.
5528         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5529         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5530         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5532         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5534 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5536         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5537         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5539         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5540         in subsections has a symbol associated with it.
5542         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5543         defined symbol for entry point to avoid cancellation.
5544         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5546 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5548         * Makefile (tests): Add tst-tls5.
5549         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5550         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5551         ($(objpfx)tst-tls5): New.
5552         ($(objpfx)tst-tls6.out): Likewise.
5553         (tests): Depend on $(objpfx)tst-tls6.out.
5554         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5555         (do_test): Check pthread_self () return value alignment.
5556         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5557         (tf): Check pthread_self () return value alignment.
5558         * tst-tls5.c: New test.
5559         * tst-tls5.h: New.
5560         * tst-tls5mod.c: New.
5561         * tst-tls5moda.c: New.
5562         * tst-tls5modb.c: New.
5563         * tst-tls5modc.c: New.
5564         * tst-tls5modd.c: New.
5565         * tst-tls5mode.c: New.
5566         * tst-tls5modf.c: New.
5567         * tst-tls6.sh: New test.
5569         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5570         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5571         * init.c (pthread_functions): Initialize them.
5572         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5573         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5574         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5575         pthread_cond_timedwait@@GLIBC_2.3.2.
5577 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5579         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5580         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5581         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5582         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5583         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5584         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5586         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5588         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5589         _POSIX_THREAD_PRIORITY_SCHEDULING.
5590         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5592 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5594         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5595         nested function, use static inline function from libio.h.
5596         Code by Richard Henderson.
5598         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5599         weak.
5601 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5603         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5604         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5605         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5606         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5607         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5608         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5609         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5610         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5611         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5612         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5613         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5614         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5615         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5616         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5617         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5618         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5619         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5620         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5621         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5622         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5623         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5624         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5625         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5626         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5627         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5628         * sysdeps/sparc/tls.h: New file.
5629         * sysdeps/sparc/tcb-offsets.sym: New file.
5630         * sysdeps/sparc/Makefile: New file.
5631         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5632         * init.c [__sparc__] (__NR_set_tid_address): Define.
5634 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5636         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5637         _IO_release_lock): Define.
5639 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5641         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5642         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5644 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5646         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5647         (__pthread_cleanup_class): Add missing return types of member
5648         functions.
5650 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5652         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5653         (lll_mutex_unlock_force): Add memory barrier between store and futex
5654         syscall.
5656 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5658         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5659         tempmsg in first loop.
5661 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5663         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5664         _POSIX_THREAD_PRIORITY_SCHEDULING.
5665         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5667 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5669         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5670         (__rtld_lock_default_lock_recursive,
5671         __rtld_lock_default_unlock_recursive): Define.
5672         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5673         __rtld_lock_unlock_recursive): Define using
5674         GL(_dl_rtld_*lock_recursive).
5675         * init.c (__pthread_initialize_minimal_internal): Initialize
5676         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5677         Lock GL(_dl_load_lock) the same number of times as
5678         GL(_dl_load_lock) using non-mt implementation was nested.
5680         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5681         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5683 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5685         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5686         PIPE_BUF.
5688 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5690         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5692 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5694         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5695         to first syscall error check.  Move syscall error check for tkill
5696         into __ASSUME_CLONE_STOPPED #ifdef.
5698 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5700         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5701         is not defined, do explicit synchronization.
5702         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5703         is not defined also unlock pd->lock for non-debugging case in case
5704         it is necessary.
5705         * pthread_create.c (start_thread): Always get and release pd->lock
5706         if __ASSUME_CLONE_STOPPED is not defined.
5707         (start_thread_debug): Removed.  Adjust users.
5708         * allocatestack.c (allocate_stack): Always initialize lock if
5709         __ASSUME_CLONE_STOPPED is not defined.
5710         * Makefile (tests): Add tst-sched1.
5711         * tst-sched1.c: New file.
5713         * sysdeps/pthread/createthread.c (do_clone): Only use
5714         sched_setschduler and pass correct parameters.
5716 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5718         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
5719         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
5720         PTHREAD_STACK_MIN in comments.
5722 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5724         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5725         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
5726         argument.
5727         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
5728         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
5729         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
5730         (__pthread_cleanup_upto): Fix prototype.
5731         (_longjmp_unwind): Adjust caller.
5732         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
5733         Change second argument to const struct pointer.
5734         * tst-sem8.c (main): Remove unused s2 and s3 variables.
5735         * tst-sem9.c (main): Likewise.
5736         * unwind.c: Include string.h for strlen prototype.
5738 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
5740         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5741         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
5742         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
5743         Define HAVE_CMOV.
5744         Patch by Nicholas Miell <nmiell@attbi.com>.
5746 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
5748         * init.c (__pthread_initialize_minimal_internal): Initialize
5749         GL(dl_init_static_tls).
5750         * pthreadP.h (__pthread_init_static_tls): New prototype.
5751         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
5752         New functions.
5753         * Makefile (tests): Add tst-tls4.
5754         (modules-names): Add tst-tls4moda and tst-tls4modb.
5755         ($(objpfx)tst-tls4): Link against libdl and libpthread.
5756         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
5757         tst-tls4modb.so.
5758         * tst-tls4.c: New file.
5759         * tst-tls4moda.c: New file.
5760         * tst-tls4modb.c: New file.
5762 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
5764         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
5765         before __timer_dealloc.
5766         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
5767         Don't call list_unlink.
5769 2003-07-29  Roland McGrath  <roland@redhat.com>
5771         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
5773 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
5775         * tst-cancel17.c (do_test): Check if aio_cancel failed.
5776         Don't reuse struct aiocb A if it failed.
5777         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
5778         not just one byte, as that does not block.
5780 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
5782         * sysdeps/pthread/unwind-resume.c: New file.
5783         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
5784         unwind-resume in csu subdir.
5785         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
5786         exceptions.
5787         (librt-sysdep_routines, librt-shared-only-routines): Add
5788         rt-unwind-resume.
5789         * sysdeps/pthread/rt-unwind-resume.c: New file.
5790         * unwind-forcedunwind.c: New file.
5791         * Makefile (libpthread-routines): Add unwind-forcedunwind.
5792         (libpthread-shared-only-routines): Likewise.
5793         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
5794         * pthreadP.h (pthread_cancel_init): New prototype.
5795         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
5797         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
5798         attr argument const struct pthread_attr *.
5800         * res.c (__res_state): Return __resp.
5801         * descr.h: Include resolv.h.
5802         (struct pthread): Add res field.
5803         * pthread_create.c: Include resolv.h.
5804         (start_thread): Initialize __resp.
5805         * Makefile (tests): Add tst-_res1.
5806         (module-names): Add tst-_res1mod1, tst-_res1mod2.
5807         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
5808         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
5809         libpthread.
5810         * tst-_res1.c: New file.
5811         * tst-_res1mod1.c: New file.
5812         * tst-_res1mod2.c: New file.
5814 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
5816         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
5818         * Makefile: Define various *-no-z-defs variables for test DSOs
5819         which has undefined symbols.
5821 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
5823         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
5824         Retry if the stwcx fails to store once_control.
5826 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
5828         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
5829         pthread_attr_setaffinity.
5830         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
5831         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
5832         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
5833         * pthread_attr_destroy.c: Free cpuset element if allocated.
5834         * pthread_create.c: Pass iattr as additional parameter to
5835         create_thread.
5836         * sysdeps/pthread/createthread.c: If attribute is provided and
5837         a new thread is created with affinity set or scheduling parameters,
5838         start thread with CLONE_STOPPED.
5839         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
5840         pthread_attr_setaffinity.
5841         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5842         cpuset element.
5844 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
5846         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
5848 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
5850         * sysdeps/pthread/configure.in: Require CFI directives also for
5851         ppc and s390.
5853 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
5855         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5856         Add cfi directives.
5858 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5860         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
5861         CLEANUP_JMP_BUF.
5862         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
5863         registers as variables.  Call __pthread_mutex_unlock_usercnt.
5864         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5865         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
5866         not self pointer in __writer.  Compare with TID to determine
5867         deadlocks.
5868         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5869         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
5870         Likewise.
5871         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
5872         Likewise.
5873         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
5874         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5875         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
5876         macros also when compiling librt.
5878 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
5880         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
5881         -fasynchronous-unwind-tables.
5882         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
5883         (PSEUDO): Add cfi directives.
5884         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
5885         Likewise.
5886         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5887         Likewise.
5889 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
5891         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
5892         __pthread_unregister_cancel): Add prototypes and hidden_proto.
5893         * unwind.c (__pthread_unwind_next): Add hidden_def.
5894         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
5895         Likewise.
5896         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
5897         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5898         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
5899         Likewise.
5900         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
5901         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
5902         Likewise.
5903         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
5904         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
5905         __pthread_unregister_cancel and __pthread_unwind_next.
5907 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
5909         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
5910         different symbol for the cancellation syscall wrapper and
5911         non-cancellation syscall wrapper.
5912         (PSEUDO_END): Define.
5914 2003-07-05  Richard Henderson  <rth@redhat.com>
5916         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
5917         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
5918         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
5919         return actual return value from the syscall, not 0.
5921 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
5923         * descr.h (struct pthread): Add pid field.
5924         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
5925         (__reclaim_stacks): Likewise.
5926         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
5927         also check for PID of the signal source.
5928         (__pthread_initialize_minimal_internal): Also initialize pid field
5929         of initial thread's descriptor.
5930         * pthread_cancel.c: Use tgkill instead of tkill if possible.
5931         * sysdeps/unix/sysv/linux/fork.c: Likewise.
5932         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
5933         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5934         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5936 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
5938         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
5939         Fix use of parameter.
5940         (__libc_cleanup_pop): Likewise.
5942 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
5944         * init.c (sigcancel_handler): Change parameters to match handler
5945         for SA_SIGACTION.  Check signal number and code to recognize
5946         invalid invocations.
5948 2003-07-03  Roland McGrath  <roland@redhat.com>
5950         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
5951         Apply sizeof (struct pthread) bias to r13 value.
5953 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
5955         * sysdeps/pthread/configure.in: Require CFI directives.
5957         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
5958         definition.
5959         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
5960         libpthread compilation.
5961         * unwind.c (__pthread_unwind): Add hidden_def.
5962         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
5964 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
5966         * libc-cancellation.c (__libc_cleanup_routine): Define.
5967         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
5968         (__pthread_cleanup_pop): Define.
5970 2003-07-01  Richard Henderson  <rth@redhat.com>
5972         * sysdeps/alpha/elf/pt-initfini.c: New file.
5973         * sysdeps/alpha/pthread_spin_lock.S: New file.
5974         * sysdeps/alpha/pthread_spin_trylock.S: New file.
5975         * sysdeps/alpha/pthreaddef.h: New file.
5976         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
5977         * sysdeps/alpha/tls.h: New file.
5978         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
5979         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
5980         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
5981         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
5982         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
5983         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
5984         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
5985         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
5986         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
5987         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
5989 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
5991         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
5992         cleanup support and unwind info.
5994 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
5996         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5997         Use correct cleanup handler registration.  Add unwind info.
5998         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
5999         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6000         * tst-once3.c: Add cleanup handler and check it is called.
6001         * tst-once4.c: Likewise.
6002         * tst-oncex3.c: New file.
6003         * tst-oncex4.c: New file.
6004         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6006 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6008         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6010 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6012         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6013         (tf_msgsnd): Likewise.
6015         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6016         premature returns a bit more.
6018 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6020         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6021         definition to the front.
6023         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6024         the cleanup functions to make the names unique.  Fix dwarf opcode
6025         un unwind table.
6026         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6027         functions to make the names unique.  Fix CFA offset for two blocks.
6029 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6031         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6032         missing closing braces.
6033         Patch by Christophe Saout <christophe@saout.de>.
6035 2003-06-24  Roland McGrath  <roland@redhat.com>
6037         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6039 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6041         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6042         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6044         * pthreadP.h: Declare __find_thread_by_id.
6045         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6046         * pthread_clock_gettime.c: Allow using other thread's clock.
6047         * pthread_clock_settime.c: Likewise.
6048         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6049         * Makefile: Add rules to build and run tst-clock2.
6050         * tst-clock2.c: New file.
6052 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6054         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6055         to use exception-based cleanup handler.
6056         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6058         * tst-cond8.c (ch): Announce that we are done.
6060         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6062         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6063         Also test aio_suspend with timeout value.
6065 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6067         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6068         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6069         attribute_hidden.
6071         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6072         (__pthread_mutex_lock_internal): Likewise.
6073         (__pthread_mutex_unlock_internal): Likewise.
6074         (__pthread_mutex_unlock_usercnt): Declare.
6075         * pthread_mutex_destroy.c: Always fail if used in any way.
6076         * pthread_mutex_init.c: Update comment.
6077         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6078         * pthread_mutex_timedlock.c: Adjust __nusers.
6079         * pthread_mutex_trylock.c: Adjust __nusers.
6080         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6081         and public interfaces are wrapper with pass additional parameter.
6082         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6083         parameter zero.
6084         * tst-mutex8.c: New file.
6085         * Makefile (tests): Add tst-mutex8.
6086         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6087         __pthread_mutex_unlock_usercnt.
6088         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6089         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6090         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6091         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6092         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6093         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6094         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6095         Add __nusers.
6096         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6097         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6098         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6099         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6100         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6102         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6103         * pthread_mutex_timedlock.c: Likewise.
6104         * pthread_mutex_trylock.c: Adjust __nusers.
6105         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6106         * tst-mutex9.c: New file.
6107         * Makefile (tests): Add tst-mutex9.
6108         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6109         * sysdeps/ia64/tls.h: Likewise.
6110         * sysdeps/powerpc/tls.h: Likewise.
6111         * sysdeps/s390/tls.h: Likewise.
6112         * sysdeps/sh/tls.h: Likewise.
6113         * sysdeps/x86_64/tls.h: Likewise.
6114         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6115         Change type of __owner.
6116         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6117         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6118         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6119         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6120         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6122 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6124         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6125         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6127         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6128         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6129         instead of nr to lll_futex_wake.  Only set errno and return -1
6130         if err < 0.
6132         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6133         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6134         return actual return value from the syscall, not 0.
6136 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6138         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6139         find a random value.
6140         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6141         errno==EIDRM.
6143         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6144         compat_timer_settime.
6145         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6146         compat_timer_gettime.
6147         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6148         compat_timer_getoverrun.
6149         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6150         compat_timer_delete.
6152         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6153         error-checking mutex detect busy mutexes.
6155 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6157         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6158         Add ax to clobber list.
6159         (lll_mutex_cond_lock): Likewise.
6160         (lll_mutex_unlock): Likewise.
6161         (lll_lock): Likewise.
6162         (lll_unlock): Likewise.
6164         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6165         * tst-cancel18.c: New file.
6166         * tst-cancelx18.c: New file.
6168         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6169         and tcdrain.
6171         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6172         * tst-cancel17.c: New file.
6173         * tst-cancelx17.c: New file.
6175         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6176         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6177         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6179         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6181 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6183         * sysdeps/pthread/createthread.c (create_thread): Set
6184         header.multiple_threads unconditionally.
6185         * allocatestack.c (allocate_stack): Likewise.
6186         * descr.h (struct pthread): Add header.multiple_threads
6187         unconditionally.
6188         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6189         Define for librt.  #error if neither libpthread, libc nor librt.
6190         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6191         Likewise.
6192         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6193         CDISABLE): Likewise.
6194         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6195         CDISABLE): Likewise.
6196         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6197         CDISABLE): Likewise.
6198         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6199         CDISABLE): Likewise.  Access header.multiple_threads outside of
6200         libc and libpthread.
6201         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6202         Likewise.
6203         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6204         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6206 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6208         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6209         Also test early cancellation before the thread reaches the cancellation
6210         point.
6212         * Makefile: Compile forward.c with exceptions.
6214         * sysdeps/unix/sysv/linux/sleep.c: New file.
6216 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6218         * Makefile: Add CFLAGS definition to compile function wrappers
6219         duplicated from libc with exceptions.
6220         * tst-cancel4.c: Also check cancellation handlers.
6222         * Makefile: Add rules to build and run tst-cancel16 and
6223         tst-cancelx16.  Add missing CFLAGS definitions.
6224         * tst-cancel16.c: New file.
6225         * tst-cancelx16.c: New file.
6227 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6229         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6230         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6231         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6232         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6234         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6235         (LIBC_CANCEL_RESET): Likewise.
6236         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6237         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6238         librt-cancellation.
6239         (CFLAGS-libcrt-cancellation.c): Define.
6240         * sysdeps/pthread/librt-cancellation.c: New file.
6241         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6242         macros also when compiling librt.
6243         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6244         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6245         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6246         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6247         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6248         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6249         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6251         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6252         compat_timer_create.
6254 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6256         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6258         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6259         __register_atfork.
6260         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6261         Add libc_hidden_def.
6263 2003-06-13  Roland McGrath  <roland@redhat.com>
6265         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6266         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6268 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6270         * allocatestack.c (queue_stack): Always inline.
6271         * ptreadhP.h (__do_cancel): Likewise.
6273 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6275         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6276         a typo.
6278 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6280         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6281         (__pthread_cond_signal): Remove incorrect second addition for
6282         cond_lock!=0.
6284 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6286         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6287         (__pthread_cond_signal): Use correct futex pointer in
6288         __lll_mutex_lock_wait call.
6290         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6291         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6293 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6295         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6296         cancelable.
6297         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6298         Likewise.
6300         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6301         hand-written CFI generation code.  Since ENTRY/END also initiated
6302         CFI frames this caused two CFI sets to be generated.
6304 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6306         * cleanup_routine.c: New file.
6307         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6308         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6309         cleanup handling.
6310         * Makefile (libpthread-routines): Add cleanup_routine.
6311         Add more CFLAGS variables to compile with exceptions.  Add comments
6312         why which file needs unwind tables.
6313         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6314         tests.
6315         * tst-cancelx1.c: New file.
6316         * tst-cancelx2.c: New file.
6317         * tst-cancelx3.c: New file.
6318         * tst-cancelx4.c: New file.
6319         * tst-cancelx5.c: New file.
6320         * tst-cancelx6.c: New file.
6321         * tst-cancelx7.c: New file.
6322         * tst-cancelx8.c: New file.
6323         * tst-cancelx9.c: New file.
6324         * tst-cancelx10.c: New file.
6325         * tst-cancelx11.c: New file.
6326         * tst-cancelx12.c: New file.
6327         * tst-cancelx13.c: New file.
6328         * tst-cancelx14.c: New file.
6329         * tst-cancelx15.c: New file.
6330         * tst-cleanupx0.c: New file.
6331         * tst-cleanupx0.expect: New file.
6332         * tst-cleanupx1.c: New file.
6333         * tst-cleanupx2.c: New file.
6334         * tst-cleanupx3.c: New file.
6336         * tst-cleanup0.c: Make standard compliant.
6337         * tst-cleanup1.c: Likewise.
6339         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6340         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6341         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6342         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6343         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6344         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6345         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6346         CLEANUP_JMP_BUF.
6347         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6348         * tst-cancel12.c: New file.
6349         * tst-cancel13.c: New file.
6350         * tst-cancel14.c: New file.
6351         * tst-cancel15.c: New file.
6352         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6353         and tst-cancel15.
6355         * tst-cancel1.c: Add some comments.
6357         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6358         timeout correctly.
6360 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6362         * Makefile (CFLAGS-pthread_cancel.c): Define.
6364 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6366         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6367         Change type of __writer element to int.
6368         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6369         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6370         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6371         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6372         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6373         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6374         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6375         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6376         Compare with TID to determine deadlocks.
6377         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6378         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6379         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6380         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6381         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6382         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6383         Likewise.
6384         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6385         Likewise.
6386         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6387         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6388         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6389         Likewise.
6390         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6391         Likewise.
6392         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6393         * Makefile (tests): Add tst-rwlock12.
6394         * tst-rwlock12.c: New file.
6396 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6398         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6399         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6400         Remove bogus hidden_proto.
6401         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6402         Likewise.
6403         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6404         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6405         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6406         ___lll_mutex_timedlock): Likewise.
6408 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6410         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6411         (__pthread_cond_signal): Add some code to eventually handle
6412         cond_lock!=0.
6414 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6416         * Makefile (tests): Add tst-exec4.
6417         (tst-exec4-ARGS): Define.
6418         * tst-exec4.c: New file.
6420 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6422         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6423         Also fail if tv_nsec < 0.
6424         (__lll_timedwait_tid): Likewise.
6425         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6426         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6427         Likewise.
6428         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6429         Likewise.
6430         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6431         Likewise.
6432         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6433         Likewise.
6434         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6435         Likewise.
6436         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6437         Likewise.
6439         * Makefile (tests): Add tst-sem8 and tst-sem9.
6440         * tst-sem8.c: New file.
6441         * tst-sem9.c: New file.
6442         * sem_open.c: Fix creation of in_use record if the file exists but
6443         no internal record.
6445         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6446         definitions.
6448         * sysdeps/pthread/timer_create.c (timer_create): In case
6449         evp==NULL, assign timer ID to sival_ptr.
6451         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6452         struct pthread_unwind_buf *.
6453         (struct pthread): Likewise for cleanup_jmp_buf element.
6455         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6456         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6457         * unwind.c (__pthread_unwind_next): Likewise.
6459 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6461         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6462         (lll_futex_timed_wait): Use int for futex value parameter.
6463         (lll_futex_wake): Likewise.
6464         (lll_futex_requeue): Likewise.
6466         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6467         Replace one memory operation with one register operation.
6469         * tst-join4.c (do_test): Fix error message.
6471         * tst-rwlock6.c (do_test): Use correct format specifier.
6473         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6474         (__lll_mutex_lock_wait): Replace one memory operation with one
6475         register operation.
6476         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6477         (__lll_mutex_lock_wait): Likewise.
6479         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6480         (__lll_mutex_cond_lock): Add one to value parameter of
6481         __lll_lock_wait to reflect reality in the futex syscall.
6482         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6483         (lll_mutex_cond_lock): Likewise.
6485 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6487         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6488         New function.
6489         (lll_mutex_cond_lock): Define.
6491 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6493         * Makefile (tests): Add tst-signal6.
6494         * tst-signal6.c: New file.
6496         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6497         (__lll_mutex_unlock_force): New function
6498         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6500         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6501         (__lll_mutex_unlock_force): New function.
6502         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6504         * tst-rwlock7.c (do_test): Use correct format specifier.
6506         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6507         Find break parameter in correct asm argument.
6509 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6511         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6512         Remove out4.
6513         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6514         error occured.
6515         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6516         Add __mutex.
6517         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6518         lll_futex_requeue, lll_mutex_unlock_force): Define.
6520 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6522         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6523         (pthread_cond_t): Add __mutex.
6524         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6525         lll_futex_requeue, lll_mutex_unlock_force): Define.
6527 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6529         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6530         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6531         Add __mutex field.
6532         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6533         Define.
6534         (lll_futex_wait, lll_futex_wake): Define.
6535         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6536         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6537         FUTEX_REQUEUE instead of FUTEX_WAIT.
6538         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6539         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6540         mutex which was used in condvar structure.  Call
6541         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6542         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6544         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6545         include tcb-offsets.h.  Read wakeup value in locked region.
6546         Use the value of gbr register as THREAD_ID.
6547         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6548         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6549         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6551         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6552         macros.
6554 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6556         * sysdeps/pthread/pthread_cond_broadcast.c
6557         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6559 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6561         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6562         typo in register name.
6563         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6564         correctly.  Actually use requeue.  Little optimization.
6565         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6566         mutex address early.  Handle cancellation state as 32-bit value.
6567         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6568         Remove unnecessary label.
6570 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6572         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6573         instead of FUTEX_WAIT.
6574         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6575         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6576         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6577         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6578         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6579         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6580         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6581         of __pthread_mutex_lock_internal.
6582         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6583         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6584         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6585         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6586         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6587         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6588         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6589         Add pthread_mutex_cond_lock.
6590         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6591         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6592         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6593         lll_mutex_cond_lock.
6594         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6595         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6596         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6597         Add __mutex field.
6598         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6599         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6601         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6602         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6604         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6605         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6606         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6607         macro don't define aliases.
6609         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6610         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6611         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6612         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6613         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6614         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6615         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6616         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6617         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6619 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6621         * sem_open.c: Fix one endless loop.  Implement correct semantics
6622         wrt opening the same semaphore more then once.
6623         * sem_close.c: Adjust for sem_open change.
6624         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6625         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6626         * Makefile (tests): Add tst-sem7.
6627         * tst-sem7.c: New file.
6629 2003-05-16  Roland McGrath  <roland@redhat.com>
6631         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6632         uninitialized variable braino.
6634 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6636         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6637         test for syscall availability.
6639         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6640         __no_posix_timers to -1 if the syscalls don't exist.
6642         * pthread_join.c (pthread_join): Set tid field of the joined
6643         thread to -1.  This isn't necessary but helps to recognize some
6644         error conditions with almost no cost.
6646         * allocatestack.c (FREE_P): Also negative values indicate an
6647         unused stack.
6649         * unwind.c: Include <unistd.h>.
6651 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6653         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6655 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6657         * Makefile (crti-objs, crtn-objs): New variables.
6658         (omit-deps, extra-objs): Add crtn.
6659         ($(objpfx)libpthread.so): Depend on both crti and crtn
6660         and links to them in multidir.
6661         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6663 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6665         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6666         (lll_mutex_unlock): Use atomic_exchange_rel.
6668 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6670         * cond-perf.c (cons): Add missing locking around setting of alldone.
6672 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6674         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6675         related macros.
6676         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6678 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6680         * tst-sem6.c: New file.
6681         * Makefile (tests): Add tst-sem6.
6683         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6684         Use atomic_exchange_rel instead of atomic_exchange.
6685         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6686         Likewise.
6688         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6689         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6690         vsyscall is possible.
6692         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6693         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6694         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6695         pthread_setaffinity_np.
6696         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6697         and pthread_setaffinity_np.
6698         * Makefile (libpthread-routines): Add pthread_getaffinity and
6699         pthread_setaffinity.
6701         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6702         use it in case mmap to allocate the stack fails.
6703         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6704         ARCH_MAP_FLAGS here.
6705         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6706         ARCH_RETRY_MMAP.
6708 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6710         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6711         handler implementation.  It is now lockless in fork().
6712         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6713         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6714         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6715         declare the __fork_*_lists.
6716         (struct fork_handler): Include pointers to all three functions.
6717         Add next, refcntr and need_signal elements.
6718         (__fork_handlers): New declaration.
6719         (__register_atfork_malloc): Remove declaration.
6720         (HAVE_register_atfork_malloc): Remove definition.
6721         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
6722         __pthread_child_handler variable.
6723         (__libc_pthread_init): Use __register_atfork instead of explicitly
6724         adding to the list.
6725         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
6726         and lll_futex_wake.
6727         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6729         * unwind.c (unwind_cleanup): Print error message and then abort.  This
6730         function must never be reached.
6732         * cond-perf.c: New file.
6734 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
6736         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
6738 2003-05-04  Roland McGrath  <roland@redhat.com>
6740         * Makefile ($(objpfx)../libc.so): New target.
6742 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
6744         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6745         (pthread_condattr_t): Size is only an int, don't use long for
6746         alignment.
6747         (pthread_mutexattr_t): Likewise.
6748         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6749         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6750         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6752 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
6754         * sysdeps/i386/tls.h: Define THREAD_ID.
6755         * sysdeps/ia64/tls.h: Likewise.
6756         * sysdeps/powerpc/tls.h: Likewise.
6757         * sysdeps/s390/tls.h: Likewise.
6758         * sysdeps/sh/tls.h: Likewise.
6759         * sysdeps/x86_64/tls.h: Likewise.
6760         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
6761         record ownership.
6762         * pthread_mutex_timedlock.c: Likewise.
6763         * pthread_mutex_trylock.c: Likewise.
6764         * pthread_mutex_unlock.c: Likewise.
6765         * pthread_rwlock_trywrlock.c: Likewise.
6766         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
6767         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6768         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6769         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6771         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
6772         flag.
6774 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
6776         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6777         (__SIZEOF_PTHREAD_COND_T): Define to 48.
6778         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
6779         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6780         Make __align long long instead of long.
6781         (pthread_rwlock_t): Formatting.
6782         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
6783         (pthread_rwlock_t): Formatting.
6784         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6785         (pthread_cond_t): Make __align long long instead of long.
6786         (pthread_rwlock_t): Move __flags field to the same position as in
6787         linuxthreads.
6789 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
6791         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
6792         * tst-rwlock7.c (do_test): Likewise.
6794 2003-04-26  Roland McGrath  <roland@redhat.com>
6796         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
6798 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
6800         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
6801         sizeof (struct pthread).
6802         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
6803         1 struct pthread.
6804         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
6805         to 0.
6806         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
6807         struct pthread.
6808         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
6809         to 32-bit bytes.
6810         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
6811         tcbp.
6812         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
6813         unneccessarily.
6814         (NO_TLS_OFFSET): Define.
6815         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
6816         add TLS_TCB_SIZE unnecessarily.
6818 2003-04-22  Roland McGrath  <roland@redhat.com>
6820         * Makeconfig (shared-thread-library): Reverse link order to work
6821         around linker bug.
6823 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
6825         * semaphore.h: Fix typo in comment.
6827 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
6829         * sysdeps/pthread/sigfillset.c: New file.
6831         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
6832         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
6833         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
6834         * sysdeps/pthread/sigaction.c: Likewise.
6835         * sysdeps/pthread/sigprocmask.c: New file.
6836         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
6837         __SIGRTMIN+1.
6838         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
6839         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
6840         in this case.
6842 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
6844         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6845         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
6847         * sysdeps/unix/sysv/linux/unregister-atfork.c
6848         (__unregister_atfork): Don't free memory not allocated dynamically.
6850         * semaphore.h: Remove __THROW marker from cancellation points.
6851         * nptl/sysdeps/pthread/pthread.h: Likewise.
6853 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
6855         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
6856         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
6857         __THROW.
6859 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
6861         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
6863 2003-04-15  Roland McGrath  <roland@redhat.com>
6865         * forward.c (__pthread_unwind): Tweak to avoid warning.
6867 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
6869         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
6871 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
6873         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
6874         overflow CFA advance instructions.
6875         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6877 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
6879         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
6880         * sysdeps/i386/pthread_spin_lock.c: Likewise.
6881         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
6882         defined.
6884         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
6885         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
6886         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
6887         DW_CFA_advance_loc for .Laddl-.Lsubl.
6889 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
6891         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
6892         position-independent unwind data for static libraries.
6893         Add missing unwind info.  Add comments.
6895         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
6896         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6897         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6898         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6900 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
6902         * Makefile: Make sure all cancellation points are compiled with
6903         exception and asynchronous unwind tables.
6905         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
6906         which mishandles loading of global object addresses in PIC.
6907         (THREAD_SETMEM_NC): Likewise.
6909 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
6911         * pthread.h: Define new data structure for cleanup buffer.  Declare
6912         new cleanup handler interfaces.
6913         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
6914         (struct pthread): Add cleanup_jmp_buf pointer.  Define
6915         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
6916         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
6917         it.  Declare old cleanup handler installation functions.
6918         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
6919         handling.
6920         * cleanup_defer.c: Likewise.
6921         * cleanup_compat.c: New file.  Old cleanup code.
6922         * cleanup_def_compat.c: New file.  Old cleanup code.
6923         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
6924         if own thread descriptor.
6925         * unwind.c: New file.
6926         * forward.c: Add __pthread_unwind.
6927         * init.c (pthread_functions): Add __pthread_unwind.
6928         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
6929         Add ptr___pthread_unwind.
6930         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
6931         and unwind function.
6932         * Makefile (libpthread-routines): Add cleanup_compat,
6933         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
6934         table generation if necessary.
6935         * version.c: Record whether unwind support is compiled in.
6936         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
6937         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
6938         handler interfaces.
6939         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
6940         complication to generate unwind information for syscall wrappers.
6941         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6942         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
6943         __cleanup_fct_attribute.
6945         * Makefile: Add rules to build and run tst-cleanup0.
6946         * tst-cleanup0.c: New file.
6947         * tst-cleanup0.expect: New file.
6949         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
6950         caller.  Optimize to avoid often unecessary local variable.
6952 2003-04-11  Roland McGrath  <roland@redhat.com>
6954         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
6955         sets variable `multidir'; include that.
6956         (generated): Add it.
6957         ($(objpfx)$(multidir)/crti.o): New target.
6958         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
6960 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
6962         * tst-attr2.c (do_test): Add cast to avoid warning.
6963         * tst-mutex4.c (do_test): Likewise.
6965 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
6967         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
6968         in child.
6970 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
6972         * Makefile (tests): Add tst-detach1.
6973         * tst-detach1.c: New file.
6975 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
6977         * sysdeps/pthread/pthread.h: Remove duplicate
6978         pthread_cleanup_{push,pop} definitions.
6980         * tst-barrier2.c: Eliminate warnings.
6981         * tst-cancel4.c: Likewise.
6982         * tst-cond4.c: Likewise.
6983         * tst-cond6.c: Likewise.
6984         * tst-detach1.c: Likewise.
6985         * tst-rwlock4.c: Likewise.
6986         * tst-rwlock6.c: Likewise.
6987         * tst-rwlock7.c: Likewise.
6988         * tst-sem3.c: Likewise.
6989         * tst-spin2.c: Likewise.
6990         * tst-umask1.c: Likewise.
6992 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
6994         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
6996 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
6998         * descr.h (struct pthread): Move cancelhandling member to the front.
7000 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7002         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7003         malloc_parent, and malloc_child statically.
7004         (__register_atfork_malloc): New function.
7005         (free_mem): Don't free any of the malloc_* variables on the list.
7006         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7007         Define HAVE_register_atfork_malloc.
7009 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7011         * sysdeps/pthread/createthread.c (create_thread): Add some more
7012         comments explaining when to set multiple_threads and when not.
7014         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7015         THREAD_ATOMIC_BIT_SET if not already defined.
7016         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7017         THREAD_ATOMIC_BIT_SET:
7018         * sysdeps/x86_64/tls.h: Likewise.
7019         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7020         THREAD_ATOMIC_CMPXCHG_VAL.
7021         (_pthread_cleanup_pop_restore): Likewise.
7022         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7023         (__pthread_enable_asynccancel_2): Likewise.
7024         (__pthread_disable_asynccancel): Likewise.
7025         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7026         (__libc_disable_asynccancel): Likewise.
7027         * init.c (sigcancel_handler): Likewise.
7028         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7029         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7031 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7033         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7034         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7035         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7036         * Makefile (tests): Add tst-cancel11.
7037         * tst-cancel11.c: New file.
7039 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7041         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7042         round, not the first.  Use specific_used flag instead of local
7043         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7044         (__free_tcb): Don't call deallocate_tsd here.
7045         (start_thread): Call deallocate_tsd here.
7046         * pthread_setspecific.c: Set specific_used flag really only when
7047         needed.
7048         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7049         * tst-tsd3.c: New file.
7050         * tst-tsd4.c: New file.
7052 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7054         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7055         Use atomic_exchange_and_add instead of __lll_add.
7056         (__lll_mutex_timedlock): Likewise.
7057         Patch by Ian Wienand.
7059 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7061         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7062         (SINGLE_THREAD_P): Fix typo.
7063         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7065 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7067         * Makefile (tests): Add tst-align.
7068         * tst-align.c: New file.
7069         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7071         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7072         function correctly.
7074         * tst-tsd2.c: Add casts to avoid warnings.
7076 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7078         * descr.h (struct pthread): Move most often used elements to the front.
7080 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7082         * Makefile (libpthread-routines): Add pthread_atfork.
7083         (libpthread-static-only-routines): Add pthread_atfork.
7085 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7087         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7088         of TLS_DTV_AT_TP.
7089         (INSTALL_DTV): Add parens.
7090         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7091         Use passed descr instead of THREAD_SELF.
7092         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7093         (__lll_mutex_timedlock_wait): Correct expected value after
7094         spurious wakeup.
7095         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7096         Release lock before waking up the waiters.
7097         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7098         criteria.  Reorderstruct passed to cleanup handler.  Fix
7099         handling of cancellation and failung pthread_mutex_unlock call.
7100         Use __pthread_enable_asynccancel_2 instead of
7101         __pthread_enable_asynccancel.
7102         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7103         Return result of lock re-get if it fails.
7104         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7105         for __pthread_cleanup_push.
7106         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7107         completely broken rwlock implementation.
7108         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7109         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7110         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7111         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7112         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7113         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7114         versioned_symbol macro.
7115         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7116         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7118 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7120         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7121         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7122         and __helper_tid.
7123         (struct timer): Remove th and bar field.
7124         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7125         debugging code.  Create only one helper thread.
7126         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7127         helper thread.
7128         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7129         Renamed.  Define statically.  Use thread info from siginfo.
7130         (__helper_once): New variable.
7131         (__helper_tid): New variable.
7132         (__reset_helper_control): New function.
7133         (__start_helper_thread): New function.
7135         * pthread_create.c (start_thread): Don't use setjmp inside
7136         __builtin_expect to work around gcc bug.
7138         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7139         timer_delete syscall fails, but not with ENOSYS, set
7140         __no_posix_timers.
7142         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7143         (timer_settime): Fix typo.
7144         * sysdeps/unix/sysv/linux/timer_getoverr.c
7145         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7147 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7149         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7150         offset of cleanupbuf.__prev.
7152 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7154         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7155         of included file.
7157 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7159         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7160         NULL provide default definition to syscall.
7162 2003-03-25  Roland McGrath  <roland@redhat.com>
7164         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7165         (timer_id2ptr): Fix typo.
7167 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7169         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7170         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7171         * sysdeps/ia64/pthreaddef.h: Likewise.
7172         * sysdeps/powerpc/pthreaddef.h: Likewise.
7173         * sysdeps/s390/pthreaddef.h: Likewise.
7174         * sysdeps/sh/pthreaddef.h: Likewise.
7175         * sysdeps/x86_64/pthreaddef.h: Likewise.
7176         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7177         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7178         being changed.
7179         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7180         SIGTIMER is not unblocked.
7181         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7182         RT signal taken.
7183         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7184         be send.
7185         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7186         pass pointer through as ID.
7187         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7188         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7189         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7190         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7191         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7192         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7193         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7194         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7195         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7196         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7197         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7198         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7199         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7200         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7201         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7202         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7203         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7204         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7205         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7206         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7207         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7208         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7209         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7210         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7211         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7212         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7213         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7214         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7215         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7216         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7217         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7218         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7219         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7221         * pthreadP.h: Remove FRAME_LEFT definition.
7222         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7223         already left frame.  Programs which have this problem are not POSIX
7224         compliant.
7225         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7227 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7229         * sysdeps/pthread/tst-timer.c: Check return values of the
7230         functions we test.
7232 2003-03-23  Roland McGrath  <roland@redhat.com>
7234         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7235         * tst-tls3mod.c: Likewise.
7236         * tst-tls1.c: Likewise.
7237         * tst-tls2.c: Likewise.
7239         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7240         undefined behavior.
7242         * tst-join5.c (tf1, tf2): Add a cast.
7244         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7246         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7247         Don't test anything.
7248         * tst-cond4.c: Likewise.
7249         * tst-cond6.c: Likewise.
7250         * tst-flock2.c: Likewise.
7251         * tst-mutex4.c: Likewise.
7252         * tst-rwlock4.c: Likewise.
7253         * tst-signal1.c: Likewise.
7254         * tst-spin2.c: Likewise.
7255         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7257         * tst-mutex4.c: Use test-skeleton.c.
7258         * tst-spin2.c: Likewise.
7259         * tst-sysconf.c: Likewise.
7260         * tst-barrier2.c: Likewise.
7261         * tst-cond4.c: Likewise.
7262         * tst-cond6.c: Likewise.
7263         * tst-rwlock4.c: Likewise.
7264         * tst-unload.c: Likewise.
7265         * tst-flock2.c (do_test): Use return instead of exit.
7267 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7269         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7271 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7273         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7274         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7275         instead of __lll_compare_and_swap.
7276         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7277         Likewise.
7278         Removed definition if __lll_compare_and_swap.
7280         * cancellation.c: Adjust for new form of compare&exchange macros.
7281         * cleanup_defer.c: Likewise.
7282         * init.c: Likewise.
7283         * libc-cancellation.c: Likewise.
7284         * old_pthread_cond_broadcast.c: Likewise.
7285         * old_pthread_cond_signal.c: Likewise.
7286         * old_pthread_cond_timedwait.c: Likewise.
7287         * old_pthread_cond_wait.c: Likewise.
7288         * pthread_cancel.c: Likewise.
7289         * pthread_create.c: Likewise.
7290         * pthread_detach.c: Likewise.
7291         * pthread_join.c: Likewise.
7292         * pthread_key_delete.c: Likewise.
7293         * pthread_setcancelstate.c: Likewise.
7294         * pthread_setcanceltype.c: Likewise.
7295         * pthread_timedjoin.c: Likewise.
7296         * pthread_tryjoin.c: Likewise.
7297         * sysdeps/pthread/createthread.c: Likewise.
7299 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7301         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7302         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7303         definitions.  Replace uses with calls to atomic_* functions.
7304         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7305         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7306         __lll_test_and_set calls with atomic_exchange_and_add and
7307         atomic_exchange calls respectively.
7308         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7309         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7310         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7311         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7312         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7313         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7314         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7316         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7317         returns the old value.
7319 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7321         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7322         int for variable OLDVAL and correct inline assembler contraint.
7323         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7324         type int for variable OLD.
7326         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7327         only for s390-32.
7328         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7329         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7330         instead of multiple_threads field in the TCB.
7332 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7334         * sysdeps/i386/i686/bits/atomic.h: Removed.
7335         * sysdeps/i386/i586/bits/atomic.h: Removed.
7336         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7337         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7338         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7339         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7340         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7341         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7342         * atomic.h: Removed.  Moved to glibc.
7344         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7345         support for clock selection.
7347         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7348         signalling waiters.
7350 2003-03-18  Roland McGrath  <roland@redhat.com>
7352         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7353         Add __lll_rel_instr first.  Add memory clobber.
7354         (lll_mutex_unlock): Use __lll_test_and_set.
7355         From Paul Mackerras <paulus@samba.org>.
7357         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7358         unconditionally.
7359         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7360         (SINGLE_THREAD_P):  Add `header.' prefix.
7361         From Paul Mackerras <paulus@samba.org>.
7363         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7364         pthread_timedjoin_np to ...
7365         (libpthread: GLIBC_2.3.3): ... here.
7366         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7368         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7369         Avoid shadowing VAL variable.
7371         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7372         New macro.
7374 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7376         * Makefile (tests): Add tst-cond11.
7377         * tst-cond11.c: New file.
7379         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7380         struct passed to cleanup handler to eliminate one more
7381         instruction.
7382         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7384         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7385         (pthrad_cond_t): Replace __unused field with __clock.
7387         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7388         waken all waiters in cleanup handler.
7389         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7390         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7392         * pthread_condattr_getclock.c: New file.
7393         * pthread_condattr_setclock.c: New file.
7394         * sysdeps/pthread/pthread.h: Declare these new functions.
7395         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7396         * Makefile (libpthread-routines): Add the new functions.
7397         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7398         Renamed field to value.  Document use of the bits.
7399         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7400         change.
7401         * pthread_condattr_setpshared.c: Likewise.
7402         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7403         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7404         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7405         Add __clock field.
7406         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7407         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7408         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7409         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7410         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7411         Implement clock selection.
7412         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7413         * pthread-errnos.sym: Add ENOSYS.
7414         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7415         _POSIX_CLOCK_SELECTION.
7416         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7418         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7419         invalid .size directive.
7421 2003-03-17  Roland McGrath  <roland@redhat.com>
7423         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7424         Formatting tweaks.
7426 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7428         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7429         Use __lll_add instead of spelling it out.  Use protected symbol names.
7430         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7431         Use __lll_add.
7432         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7433         Renamed from lll_compare_and_swap.  Use new name where necessary.
7434         (__lll_add): Defined.
7435         (__lll_dec_if_positive): Defined.
7436         (__lll_test_and_set): Defined.
7437         * sysdeps/ia64/pthread_spin_init.c: Removed.
7438         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7439         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7440         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7441         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7442         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7443         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7444         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7445         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7446         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7447         __sync_lock_release_si.
7448         Patch by Jakub Jelinek.
7450         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7451         Fix timeout handling.
7452         (__lll_timedwait_tid): Likewise.
7453         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7454         Patch by Jakub Jelinek.
7456         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7458 2003-03-17  Roland McGrath  <roland@redhat.com>
7460         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7461         * sysdeps/pthread/pthread_spin_init.c: New file.
7462         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7463         * sysdeps/powerpc/Makefile: New file.
7464         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7465         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7466         * sysdeps/powerpc/pthreaddef.h: New file.
7467         * sysdeps/powerpc/tcb-offsets.sym: New file.
7468         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7469         * sysdeps/powerpc/tls.h: New file.
7470         * sysdeps/powerpc/bits/atomic.h: New file.
7471         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7472         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7473         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7475         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7476         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7477         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7478         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7479         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7480         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7481         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7482         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7483         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7484         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7485         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7486         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7487         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7488         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7489         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7491         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7492         not gettimeofday.
7493         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7494         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7495         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7496         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7497         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7499 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7501         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7502         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7503         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7504         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7505         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7507 2003-03-16  Roland McGrath  <roland@redhat.com>
7509         * tst-fork4.c: Include <string.h>.
7510         * tst-signal2.c: Likewise.
7511         * tst-mutex5.c (do_test): exit -> return.
7512         * tst-mutex2.c: Include <stdlib.h>.
7514 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7516         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7517         (__lll_mutex_timedlock_wait): Correct expected value after
7518         spurious wakeup.  Otherwise we would never wait again.
7520         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7521         zone versus inline asm stupidity.  Use correct instructions.
7523         * tst-rwlock6.c: Add some more status output.
7525 2003-03-15  Roland McGrath  <roland@redhat.com>
7527         * sysdeps/pthread/configure.in: New file.
7528         * sysdeps/pthread/configure: New file (generated).
7530 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7532         * allocatestack.c (allocate_stack): Store the exact stack size of
7533         user allocated stacks.
7535 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7537         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7538         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7539         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7540         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7541         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7542         Use `header.' prefix.
7543         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7545 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7547         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7548         __builtin_frame_address, use stack pointer.
7550         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7551         instead of __builtin_frame_pointer.
7553 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7555         * tst-basic1.c (do_test): Add cast to avoid warning.
7556         * tst-basic2.c (do_test): Likewise.
7558         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7559         amount of stack correction.
7561         * tst-fork4.c: Use test-skeleton.c.
7563 2003-03-14  Roland McGrath  <roland@redhat.com>
7565         * init.c: Fix typo "#eli" for "#else".
7567 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7569         * allocatestack.c (__stack_user): Use hidden_data_def.
7570         * pthread_create.c (__pthread_keys): Likewise.
7572         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7574 2003-03-14  Roland McGrath  <roland@redhat.com>
7576         * tst-fork4.c: New file.
7577         * Makefile (tests): Add it.
7579         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7580         we always define the padding space.
7581         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7582         stopped supporting its own extensions fully.
7583         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7584         struct also called `header', so `header.multiple_threads' is the field
7585         name to use on all machines.
7586         * allocatestack.c (allocate_stack): Use `header.' prefix.
7587         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7588         * pthread_create.c (__pthread_create_2_1): Likewise.
7589         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7590         (THREAD_SELF): Likewise.
7591         * sysdeps/x86_64/tls.h: Likewise.
7592         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7593         (SINGLE_THREAD_P): Likewise.
7594         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7595         (SINGLE_THREAD_P): Likewise.
7596         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7597         (SINGLE_THREAD_P): Likewise.
7599         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7600         value directly.
7602 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7604         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7605         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7607         * pthread_create.c (start_thread): setjmp is expected to return 0.
7609         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7610         (THREAD_GETMEM_NC): Likewise.
7612 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7614         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7615         and the size of the stack which must be allocated is a multiple,
7616         allocate one more page.
7617         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7618         MULTI_PAGE_ALIASING.
7620 2003-03-13  Roland McGrath  <roland@redhat.com>
7622         * pthread_create.c (start_thread): Set EXITING_BIT after the
7623         event-reporting (and destructors), not before.
7625 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7627         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7628         lll_futex_wake): Declare register variables as long int instead of
7629         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7630         Make syscall arguments clobbered by the syscall.
7631         (lll_futex_wait): Define using lll_futex_timed_wait.
7633         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7634         to void *.
7636         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7637         PPID if [! NDEBUG].
7639         * allocatestack.c (nptl_ncreated): Only declare if
7640         COLORING_INCREMENT != 0.
7642         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7643         (__libc_enable_asynccancel_2): Remove prototype.
7645         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7646         ctid to match kernel.
7648 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7650         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7651         libc_multiple_threads.
7652         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7653         __libc_multiple_threads to...
7654         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7656         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7657         versioning.
7658         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7659         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7661         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7662         (__pthread_once_internal): Define.
7664         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7665         macros instead of .symver directly.
7666         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7667         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7669         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7670         * sysdeps/x86_64/tcb-offsets.sym: New file.
7671         * sysdeps/x86_64/Makefile: New file.
7673         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7674         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7675         to access own pthread_t in TCB.
7676         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7677         Likewise.
7678         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7679         Likewise.
7680         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7682 2003-03-12  Roland McGrath  <roland@redhat.com>
7684         * pthread-errnos.sym: New file.
7685         * Makefile (gen-as-const-headers): New variable, list that file.
7686         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7687         header <pthread-errnos.h> instead of defining errno values here.
7688         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7689         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7690         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7691         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7692         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7693         Likewise.
7694         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7695         Likewise.
7696         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7697         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7698         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7699         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7700         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7701         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7702         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7703         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7704         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7705         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7706         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7707         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7708         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7709         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7710         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7711         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7712         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7713         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7714         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7715         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7716         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7717         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7718         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
7719         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
7720         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
7721         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7722         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7724         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
7725         CLONE_CHILD_SETTID worked.
7727 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7729         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
7730         file.
7731         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
7732         file.
7734         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7735         (pthread_cond_t): Add padding.
7737         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
7738         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
7739         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
7741         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
7742         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
7743         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
7744         (__pthread_rwlock_timedrdlock): Likewise.
7745         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
7746         (__pthread_rwlock_wrlock): Likewise.
7747         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
7748         (__pthread_rwlock_rdlock): Likewise.
7750         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
7752         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
7753         result of lock re-get if it fails.
7755 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7757         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
7758         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7759         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7760         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7761         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7762         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7763         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7764         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7765         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7766         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7768         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
7769         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
7771         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
7772         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
7773         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
7774         (create_thread): Likewise.
7775         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
7776         * init.c (__pthread_initialize_minimal_internal): Initialize
7777         __libc_multiple_threads_ptr if necessary.
7778         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
7779         __pthread_multiple_threads and __libc_multiple_threads_ptr.
7780         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
7781         __libc_multiple_threads.
7782         (__libc_pthread_init): Return pointer to __libc_pthread_init if
7783         necessary.
7785         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
7786         (THREAD_SETMEM_NC): Likewise.
7788         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
7789         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
7790         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
7791         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
7793         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
7794         Eliminate one entire instruction.
7796         * cancellation.c (__pthread_enable_asynccancel_2): New function.
7797         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
7798         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7799         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
7800         instead of __pthread_enable_asynccancel.
7801         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7802         (__pthread_cond_wait): Likewise.
7803         * sysdeps/pthread/pthread_cond_timedwait.c
7804         (__pthread_cond_timedwait): Likewise.
7805         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
7807         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7808         (__condvar_cleanup): Wake up all waiters in case we got signaled
7809         after being woken up but before disabling asynchronous
7810         cancellation.
7811         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
7812         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
7813         (__condvar_cleanup): Likewise.
7815         * init.c (__NR_set_tid_address): If already defined, don't redefine.
7816         Make it an error if architecture has no #if case.  Add x86-64.
7818         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
7819         pt-initfini.s generation.
7821         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
7822         (TLS_INIT_TP): Fix typo.
7824 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7826         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
7827         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
7829         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
7830         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7831         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
7832         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
7833         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
7834         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7835         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7836         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7838 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7840         * sysdeps/pthread/pthread_cond_timedwait.c
7841         (__pthread_cond_timedwait): Return the result of the final
7842         locking.  If it succeeds, the regular function return value.
7844         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
7845         Return result of the final locking.
7846         * version.c (__nptl_main): Work around problems with the strange
7847         INTERNAL_SYSCALL macro on ppc32.
7848         * init.c (__pthread_initialize_minimal_internal): Unblock
7849         SIGCANCEL in case the parent blocked it.
7850         Reported by Paul Mackerras <paulus@samba.org>.
7852         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
7853         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
7854         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
7856 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7858         * sysdeps/pthread/pthread_cond_timedwait.c
7859         (__pthread_cond_timedwait): Unlock and fail if
7860         __pthread_mutex_unlock_internal failed.
7862         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
7863         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
7864         Use ARCH_CLONE.
7865         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
7866         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
7867         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
7868         ALLOCATE_STACK): New macros.
7869         (TLS_TPADJ): New macro.
7870         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
7871         (allocate_stack): Handle TLS_DTV_AT_TP and
7872         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
7873         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
7874         Don't set PD->self.
7875         * init.c [__ia64__] (__NR_set_tid_address): Define.
7877         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
7878         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
7879         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
7880         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
7881         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
7882         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
7883         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
7884         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
7885         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
7886         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
7887         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
7888         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
7889         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
7890         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
7891         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
7892         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
7893         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
7894         * sysdeps/ia64/bits/atomic.h: New file.
7895         * sysdeps/ia64/Makefile: New file.
7896         * sysdeps/ia64/pthread_spin_init.c: New file.
7897         * sysdeps/ia64/pthread_spin_lock.c: New file.
7898         * sysdeps/ia64/pthread_spin_trylock.c: New file.
7899         * sysdeps/ia64/pthread_spin_unlock.c: New file.
7900         * sysdeps/ia64/pthreaddef.h: New file.
7901         * sysdeps/ia64/tcb-offsets.sym: New file.
7902         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
7903         * sysdeps/ia64/tls.h: New file.
7905         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
7906         to syscall instead of no arguments.
7908 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
7910         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
7911         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
7912         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
7913         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
7915         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
7916         unused code.
7918         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
7920         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
7921         lowlevelbarrier.sym.
7922         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
7923         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
7924         Include lowlevelbarrier.h and don't define offsets locally.
7925         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
7927         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
7928         (__lll_mutex_lock_wait): Reverse order of first two parameters.
7929         (__lll_mutex_timedlock_wait): Likewise.
7930         (lll_mutex_lock): Adjust asm for that.
7931         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
7932         (lll_lock): Adjust asm for operand order change.
7933         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
7934         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
7936         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
7937         Reverse order of parameters.
7938         (__lll_timedwait_tid): Remove regparms attribute.
7939         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
7940         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
7942         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7943         (__lll_timedwait_tid): Remove one unnecessary instruction.
7945         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
7946         __lll_mutex_timedlock_wait only for NOT_IN_libc.
7947         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
7948         lowlevelmutex.S.
7950         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
7951         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
7952         for NOT_IN_libc.
7953         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
7954         lowlevellock.S.
7956         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
7957         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
7958         for libc.so.
7959         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
7960         define LOCK here (if UP is not defined).  The actual code is in
7961         lowlevelmutex.S.
7963         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
7964         LOCK is already defined.  Don't define lll_unlock_wake_cb and
7965         __lll_timedwait_tid for libc.so.
7966         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
7967         define LOCK here (if UP is not defined).  The actual code is in
7968         lowlevellock.S.
7970         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
7971         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
7972         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
7973         instead of lowlevelsem.h.
7974         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7975         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7976         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7978         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
7979         lowlevelrwlock.sym.
7980         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
7981         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
7982         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
7984         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
7985         register loading.
7986         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
7987         last changed.  D'oh.
7989         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
7991         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
7992         of __libc_locking_needed.
7993         (lll_trylock): Initialize %eax to zero.
7995         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
7996         pthread_cond_t definition.
7998 2003-03-10  Roland McGrath  <roland@redhat.com>
8000         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8001         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8002         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8003         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8004         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8006         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8007         Instead of setting PD->multiple_threads, set globals
8008         __pthread_multiple_threads and __libc_multiple_threads.
8009         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8010         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8011         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8013         * descr.h (struct pthread): Conditionalize first member on
8014         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8015         containing an anonymous tcbhead_t.  Move `list' member out.
8016         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8017         * allocatestack.c: Remove use of `header.data.' prefix.
8018         * pthread_create.c: Likewise.
8019         * init.c (__pthread_initialize_minimal_internal): Likewise.
8020         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8021         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8022         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8023         * sysdeps/x86_64/tls.h: Likewise.
8024         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8025         (SINGLE_THREAD_P): Likewise.
8026         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8027         (SINGLE_THREAD_P): Likewise.
8028         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8029         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8031 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8033         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8035         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8036         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8038         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8039         leftovers from the ia32 code.
8041         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8042         memory load.
8043         (clear_once_control): Don't load %esi.
8045         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8046         handling.
8048         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8050         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8051         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8053         * Makefile (tests): Add tst-cond10.
8054         * tst-cond10.c: New file.
8056 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8058         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8059         * tst-signal3.c (do_test): Likewise.
8060         * tst-sem5.c (do_test): Likewise.
8061         * tst-kill6.c (do_test): Likewise.
8062         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8064         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8065         of inc/dec.
8066         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8067         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8068         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8069         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8070         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8071         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8072         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8073         Likewise.
8074         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8075         Likewise.
8076         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8077         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8078         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8079         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8080         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8081         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8082         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8083         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8085         * allocatestack.c (allocate_stack): If mprotect() fails free the
8086         TLS memory.
8088 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8090         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8092         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8093         lll_wake_tid.  This was used only to work around kernel limits in
8094         the early days.
8095         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8096         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8097         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8098         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8100         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8101         (__pthread_initialize_minimal_internal): Change initialization of
8102         __static_tls_align_m1 appropriately.
8103         * pthreadP.h (__static_tls_align_m1): Renamed from
8104         __static_tls_align.
8105         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8106         instead of __static_tls_align-1.
8108 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8110         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8112         * pthread_create.c: Define __pthread_keys using nocommon
8113         attribute, not by placing it explicitly in bss.
8114         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8116         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8117         Use it in mmap call to allocate stacks.
8119         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8121         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8122         result of the thread function.
8124 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8126         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8127         version is just fine.
8129         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8130         (__pthread_child_handler): Renamed from pthread_child_handler,
8131         exported, and marked hidden.  Change all users.
8132         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8133         free __pthread_child_handler from child list.
8135 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8137         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8139         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8140         Fix handling of cancellation and failing pthread_mutex_unlock call.
8141         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8142         (__pthread_cond_wait): Likewise.
8144         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8145         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8146         lll_futex_timed_wait call.
8147         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8148         (pthread_rwlock_timedwrlock): Likewise.
8150         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8151         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8152         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8154         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8155         check of lll_futex_wake return value.
8157 2003-03-03  Roland McGrath  <roland@redhat.com>
8159         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8161         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8162         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8163         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8165 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8167         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8168         error for CPU clocks.
8170         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8171         _POSIX_MONOTONIC_CLOCK.
8172         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8174         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8175         recent kernels.
8177 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8179         * descr.h (struct pthread): Move cleanup field to the front.
8181 2003-03-01  Roland McGrath  <roland@redhat.com>
8183         * sem_open.c (sem_open): Braino fix.
8185 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8187         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8188         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8189         __pthread_cleanup_pop functionality.
8190         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8192         * descr.h (struct pthread): Move tid field to the front now that
8193         it is often used.
8195         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8196         (__lll_mutex_timedlock_wait): Remove.
8197         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8198         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8199         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8200         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8201         (lll_unlock_wake_cb): Don't save and restore %esi.
8202         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8203         %esi.
8204         (__lll_timedwait_tid): Add alignment.
8205         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8206         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8207         %esi.
8208         (__lll_timedwait_tid): Removed.
8209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8210         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8211         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8212         (pthread_barrier_wait): Don't save, load, and restore %esi for
8213         last thread.
8214         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8215         (__pthread_cond_signal): Don't save, load, and restore %esi.
8216         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8217         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8218         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8219         Don't save, load, and restore %esi.
8221 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8223         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8224         Release lock before waking up the waiters.
8226         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8228         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8229         (reader_thread): Likewise.
8231         * sysdeps/pthread/pthread_rwlock_unlock.c
8232         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8233         to wake up readers if there are none.
8235         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8236         Release internal lock before wake threads.
8238 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8240         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8241         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8242         predefined.
8243         * tst-rwlock9.c: Likewise.
8244         * tst-rwlock10.c: New file.
8245         * tst-rwlock11.c: New file.
8247         * Makefile (tests): Add tst-dlsym1.
8248         * tst-dlsym1.c: New file.
8250         * init.c (__pthread_initialize_minimal_internal): Set
8251         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8252         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8254 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8256         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8258         * tst-cond2.c: Fix sychronization with child.
8260         * tst-rwlock8.c (reader_thread): Remove unused variable.
8262         * Makefile: Add rules to build and run tst-tls3.
8263         * tst-tls3.c: New file.
8264         * tst-tls3mod.c: New file.
8266         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8267         * tst-rwlock8.c: New file.
8268         * tst-rwlock9.c: New file.
8269         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8270         complete broken rwlock implementation.
8271         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8272         Likewise.
8273         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8274         Likewise.
8275         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8276         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8277         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8278         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8279         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8280         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8281         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8283 2003-02-23  Roland McGrath  <roland@redhat.com>
8285         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8287 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8289         * Makefile (tests): Add tst-context1.
8290         * tst-context1.c: New file.
8292         * Makefile (tests): Add tst-tls1 and tst-tls2.
8293         * tst-tls1.c: New file.
8294         * tst-tls2.c: New file.
8296         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8297         for failed cmpxchg.
8299         * pthread_create.c (start_thread): Set EXITING_BIT early.
8301         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8302         (THREAD_GETMEM_NC): Likewise.
8304 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8306         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8307         off 3 more bytes by using offset-less instructions when possible.
8309         * Makefile: Add dependency for $(objpfx)version.d.
8311         * eintr.c (eintr_source): Add unnecessary return but the compiler
8312         insists.
8314         * tst-kill3.c: Include <unistd.h>.
8316 2003-02-21  Roland McGrath  <roland@redhat.com>
8318         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8320 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8322         * Makefile (tests): Add tst-eintr1.
8323         (distribute): Add eintr.c.
8324         * tst-eintr1.c: New file.
8325         * eintr.c: New file.
8327         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8329         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8330         Disallow sending SIGCANCEL.
8332         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8333         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8334         * tst-kill1.c: New file.
8335         * tst-kill2.c: New file.
8336         * tst-kill3.c: New file.
8337         * tst-kill5.c: New file.
8338         * tst-kill6.c: New file.
8339         * tst-basic7.c: Renamed to...
8340         * tst-kill4.c: ...this.
8342 2003-02-21  Roland McGrath  <roland@redhat.com>
8344         * Makefile (install-lib-ldscripts): New variable.
8346 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8348         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8349         * pthread_cancel.c: Use INVALID_TD_P.
8350         * pthread_detach.c: Likewise.
8351         * pthread_getschedparam.c: Likewise.
8352         * pthread_setschedparam.c: Likewise.
8353         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8354         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8355         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8356         * pthread_timedjoin.c: Likewise.
8358         * tst-basic7.c: Include <signal.h>.
8360         * pthread_join.c (pthread_join): Limited checking for invalid
8361         descriptors.
8362         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8364 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8366         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8367         beginning of the loop.  Clear the entire first block of TSD.
8368         * Makefile (tests): Add tst-key4.
8369         * tst-key4.c: New file.
8371 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8373         * Makefile (tests): Add tst-basic7.
8374         * tst-basic7.c: New file.
8376         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8377         Add some more __builtin_expect.
8379         * pthreadP.h: Define dummy version of DEBUGGING_P.
8381 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8383         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8384         _POSIX_THREAD_PRIORITY_SCHEDULING.
8385         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8386         _XOPEN_REALTIME_THREADS.
8387         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8389         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8390         kernel returns EINVAL for PID <= 0, work around it.
8392         * Makefile (tests): Add tst-signal5.
8393         * tst-signal5.c: New file.
8395         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8396         and LOGIN_NAME_MAX.
8398         * tst-cancel1.c (tf): Block all signals.
8400         * Makefile (tests): Add tst-basic6.
8401         * tst-basic6.c: New file.
8403         * tst-basic1.c: Add test for process ID.
8405         * Makefile (tests): Add tst-cancel10.
8406         * tst-cancel10.c: New file.
8408         * Makefile (tests): Add tst-signal4.
8409         * tst-signal4.c: New file.
8411         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8412         __sigismember instead of sigismember.  Add __builtin_expect.
8414 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8416         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8417         pthread_setcancelstate, and pthread_rwlock_setpshared.
8419         * tst-cancel7.c (do_test): Make sure the pid file exists before
8420         canceling the thread.
8422         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8423         pthread_rwlock_timedrdlock tests.
8424         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8425         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8426         Check for invalid tv_nsec field.
8427         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8428         Likewise.
8430         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8431         recursive mutex of overflow.
8433         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8435         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8436         going into an endless loop.
8437         * Makefile (tests): Add tst-cancel9.
8438         * tst-cancel9.c: New file.
8440         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8442 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8444         * tst-mutex5.c (do_test): Add more timedlock tests.
8446         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8447         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8449         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8450         use INLINE_SYSCALL.  Error number is returned, not -1.
8452         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8453         and __deallocate_stack with internal_function.
8454         * pthread_create.c: Adjust definitions appropriately.
8455         * allocatestack.c: Likewise.
8457         * pthread_join.c: Add one more __builtin_expect.
8458         * pthread_timedjoin.c: Likewise.
8460         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8461         not data of sequence number does not match.
8462         Add one __builtin_expect.
8464         * Makefile (tests): Add tst-clock1.
8465         * tst-clock1.c: New file.
8467         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8468         negative arguments.
8469         * Makefile (tests): Add tst-basic5.
8470         * tst-basic5.c: New file.
8472 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8474         * Makefile (tests): Add tst-basic4.
8475         * tst-basic4.c: New file.
8477         * pthreadP.h: Add declaraction for __nptl_nthreads.
8478         * pthread_create.c: Define __nptl_nthreads
8479         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8480         after thread is done.  If then zero, call exit(0).
8481         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8482         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8483         * init.c (pthread_functions): Initialize ptr_nthreads.
8484         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8485         (__reclaim_stacks): Decrement __nptl_nthreads.
8486         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8487         Define.
8488         * Makefile (tests): Add tst-basic3.
8489         * tst-basic3.c: New file.
8491         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8492         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8493         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8494         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8495         if asynchronous canceling is enabled.
8496         * pthread_join.c (pthread_join): When recognizing circular joins,
8497         take into account the other thread might be already canceled.
8498         * Makefile (tests): Add tst-join5.
8499         * tst-join5.c: New file.
8501         * Makefile (tests): Add tst-join4.
8502         * tst-join4.c: New file.
8504 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8506         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8508 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8510         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8511         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8512         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8513         warning.
8514         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8515         to avoid warning.
8516         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8517         error if lll_futex_wake failed.
8519 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8521         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8522         handling of cancellation and failung pthread_mutex_unlock call.
8523         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8524         * Makefile (tests): Add tst-cond8 and tst-cond9.
8525         * tst-cond8.c: New file.
8526         * tst-cond9.c: New file.
8528         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8530         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8531         non-standard initializers with __USE_GNU.
8533         * Makefile (tests): Add tst-cleanup3.
8534         * tst-cleanup3.c: New file.
8536 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8538         * Makefile (tests): Add tst-attr1 and tst-attr2.
8539         * tst-attr1.c: New file.
8540         * tst-attr2.c: New file.
8542         * Makefile: Add rules to build and run tst-atfork2 test.
8543         * tst-atfork2.c: New file.
8544         * tst-atfork2mod.c: New file.
8546         * sysdeps/unix/sysv/linux/unregister-atfork.c
8547         (__unregister_atfork): Free the memory allocated for the handlers
8548         after removing them from the lists.
8550         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8551         cleanup function.
8553         * tst-atfork1.c (do_test): Wait for the child we forked.
8554         Report error in child.
8556         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8558         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8560 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8562         * Makefile (tests): Add tst-cancel8.
8563         * tst-cancel8.c: New file.
8565         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8566         clearing of control variable.
8567         * Makefile (tests): Add tst-once3 and tst-once4.
8568         * tst-once3.c: New file.
8569         * tst-once4.c: New file.
8571 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8573         * sysdeps/sh/Makefile: New file.
8574         * sysdeps/sh/bits/atomic.h: New file.
8575         * sysdeps/sh/pthread_spin_init.c: New file.
8576         * sysdeps/sh/pthread_spin_lock.c: New file.
8577         * sysdeps/sh/pthread_spin_trylock.S: New file.
8578         * sysdeps/sh/pthread_spin_unlock.S: New file.
8579         * sysdeps/sh/pthreaddef.h: New file.
8580         * sysdeps/sh/tcb-offsets.sym: New file.
8581         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8582         * sysdeps/sh/tls.h: New file.
8583         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8584         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8585         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8586         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8587         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8588         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8589         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8590         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8591         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8592         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8593         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8594         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8595         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8596         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8597         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8598         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8599         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8600         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8601         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8602         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8603         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8604         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8605         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8606         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8607         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8608         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8609         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8610         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8611         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8612         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8614 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8616         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8617         according to POSIX.
8619         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8621 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8623         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8624         (TLS_GET_FS): New #define.
8625         (TLS_SET_FS): New #define.
8626         Correct value of __NR_set_thread_area.
8628         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8630 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8632         * Makefile (tests): Add tst-popen1.
8633         * tst-popen1.c: New file.
8635         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8636         but inactive generalization.
8637         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8638         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8639         Minor optimization, remove one instruction.
8640         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8642 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8644         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8646 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8648         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8649         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8650         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8651         * sysdeps/pthread/pthread_cond_signal.c: New file.
8652         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8653         * sysdeps/pthread/pthread_cond_wait.c: New file.
8654         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8655         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8656         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8657         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8658         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8659         * sysdeps/s390/Makefile: New file.
8660         * sysdeps/s390/bits/atomic.h: New file.
8661         * sysdeps/s390/pthread_spin_init.c: New file.
8662         * sysdeps/s390/pthread_spin_lock.c: New file.
8663         * sysdeps/s390/pthread_spin_trylock.c: New file.
8664         * sysdeps/s390/pthread_spin_unlock.c: New file.
8665         * sysdeps/s390/pthreaddef.h: New file.
8666         * sysdeps/s390/tcb-offsets.sym: New file.
8667         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8668         * sysdeps/s390/tls.h: New file.
8669         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8670         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8671         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8672         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8673         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8674         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8675         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8676         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8677         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8678         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8679         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8680         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8681         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8682         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8683         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8684         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8685         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8686         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8687         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8688         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8689         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8690         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8691         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8693 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8695         * atomic.h: Add a couple more default implementations.
8696         (atomic_compare_and_exchange_acq): Use
8697         __arch_compare_and_exchange_32_acq in return value definition.  It
8698         always exists.
8699         (atomic_bit_set): Renamed from atomic_set_bit.
8700         Add missing atomic_ prefixes.
8702         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8703         thread library is available, use correct value to mark initialized
8704         once variable.
8706 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8708         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8709         __sysconf to determine pagesize.
8711         * pthread_create.c: Include <atomic.h>.
8712         * allocatestack.c (allocate_stack): Implement coloring of the
8713         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8714         size minus one.  Adjust users.
8715         * sysdeps/i386/i686/Makefile: New file.
8717 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
8719         * allocatestack.c: Improve comment throughout the file.
8721         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8722         (__lll_lock_wait): Add branch prediction.
8723         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8724         (__lll_lock_wait): Likewise.
8725         (lll_unlock_wake_cb): Removed.
8727 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
8729         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
8730         _POSIX_THREAD_PRIORITY_SCHEDULING.
8732 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
8734         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8735         Fix return type of ptr___pthread_getspecific.
8737 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
8739         * Makefile (tests): Add tst-umask1.
8740         (tst-umask1-ARGS): Define.
8741         * tst-umask1.c: New file.
8743 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
8745         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
8746         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
8747         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
8748         pthread_rwlock_unlock.
8749         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
8750         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
8751         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
8752         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
8753         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8754         New file.
8755         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
8756         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8757         New file.
8758         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
8759         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
8760         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
8761         New file.
8762         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
8763         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
8764         New file.
8765         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
8766         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
8767         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
8768         New file.
8769         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
8770         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
8771         New file.
8772         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
8774         * Makefile (libpthread-routines): Remove lowlevelcond and
8775         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
8776         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
8777         and pthread_cond_broadcast.
8778         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
8779         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
8780         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
8781         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
8782         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
8783         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
8784         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
8785         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
8786         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
8787         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
8788         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
8789         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
8790         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
8791         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
8792         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
8793         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
8794         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
8795         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
8796         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
8797         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
8798         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
8799         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
8800         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
8801         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
8802         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
8803         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
8804         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
8805         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
8806         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
8807         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
8808         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
8810         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
8811         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
8812         of the code is moved to ...
8813         * sysdeps/pthread/createthread.c: ...here.  New file.
8815 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
8817         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
8818         (__new_sem_post): Clear %eax before returning.
8819         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
8821         * Makefile (tests): Add tst-cleanup2.
8822         * tst-cleanup2.c: New file.
8824         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
8825         Interpret first parameter correctly.
8827 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
8829         * Makefile (headers): Add bits/semaphore.h.
8831 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
8833         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
8834         if not SHARED.
8836 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
8838         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
8839         must be used and mapping failed.
8840         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
8842         * Makefile (CFLAGS-pthread_self.os): Define this, not
8843         CFLAGS-pthread_self.c.
8845 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8847         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
8848         lll_unlock_wake_cb.
8850         * Makefile (libpthread-routines): Add version.  Add rules to build
8851         version.os and banner.h.
8852         * version.c: New file.
8854 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
8856         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
8857         the alias unconditional.
8858         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
8860 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8862         * Makefile (CFLAGS-pthread_self.c): New definition.
8864 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8866         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
8867         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
8868         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
8869         * init.c (__pthread_initialize_minimal_internal): Likewise.
8871 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
8873         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
8875         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
8876         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8877         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8878         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
8879         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8880         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8882 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8884         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
8885         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
8886         * tst-cancel-wrappers.sh: Remove all exceptions.
8888 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
8890         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
8891         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
8893         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
8894         Use __libc_pthread_functions array if SHARED.
8896         * pthreadP.h: Move pthread_cond_2_0_t definition to...
8897         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
8899         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
8900         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
8901         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
8902         __libc_ptf_call instead of __libc_maybe_call.
8903         (PTF): New #define.
8904         (__libc_cleanup_region_start): Wrap function name with PTF call.
8905         (__libc_cleanup_region_end): Likewise.
8906         (__libc_cleanup_end): Likewise.
8908         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
8909         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
8910         * pthread_key_create.c: Add __pthread_key_create_internal alias.
8911         * pthreadP.h: Add prototypes.
8913         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
8914         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
8915         __pthread_rwlock_unlock aliases.
8916         * pthreadP.h: Add prototypes for new aliases.
8918         * pthreadP.h (struct pthead_functions): Moved to...
8919         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
8920         * init.c (pthread_functions): Add initializers for new elements.
8922         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
8923         __pthread_cleanup_pop_restore aliases.
8924         * pthreadP.h: Add prototypes.
8926         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
8927         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
8928         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
8929         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
8930         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8931         * pthreadP.h: Adjust prototypes and callers.
8933 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
8935         * Makefile (tests): Add tst-cancel7.
8936         (tst-cancel7-ARGS): New variable.
8937         * tst-cancel7.c: New file.
8939         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
8940         around gcc defficiencies.
8941         * old_pthread_cond_signal.c: Likewise.
8942         * old_pthread_cond_timedwait.c: Likewise.
8943         * old_pthread_cond_wait.c: Likewise.
8945         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
8947 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
8949         * Makefile (tests): Add tst-cond7.
8950         * tst-cond7.c: New file.
8952         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
8953         (condvar_cleanup): Get condvar address from the right place.
8955         * atomic.h: Correct definitions of atomic_full_barrier,
8956         atomic_read_barrier, atomic_write_barrier.
8958         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
8959         race-free.
8960         * old_pthread_cond_signal.c: Likewise.
8961         * old_pthread_cond_timedwait.c: Likewise.
8962         * old_pthread_cond_wait.c: Likewise.
8964 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
8966         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
8968 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
8970         * pthreadP.h (pthread_cond_2_0_t): New type.
8971         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
8972         Use new type for the 2.0 condvar function prototypes.
8973         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
8974         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
8975         parameter.
8976         * old_pthread_cond_destroy.c: Likewise.
8977         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
8978         * old_pthread_cond_signal.c: Likewise.
8979         * old_pthread_cond_timedwait.c: Likewise.
8980         * old_pthread_cond_wait.c: Likewise.
8982         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
8983         (__pthread_cond_wait): Don't save cancellation mode and seq value
8984         in same location.
8986         * herrno.c (__h_errno_location): Don't define as weak.
8988 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
8990         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
8991         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
8992         and pthread_cond_wait.
8993         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
8994         Renamed to...
8995         (__pthread_cond_broadcast_2_0): ... this.
8996         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
8997         Renamed to...
8998         (__pthread_cond_destroy_2_0): ... this.
8999         * old_pthread_cond_init.c (__old_pthread_cond_init):
9000         Renamed to...
9001         (__pthread_cond_init_2_0): ... this.
9002         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9003         Renamed to...
9004         (__pthread_cond_signal_2_0): ... this.
9005         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9006         Renamed to...
9007         (__pthread_cond_wait_2_0): ... this.
9008         * pthread_cond_destroy.c: Include shlib-compat.h.
9009         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9010         * pthread_cond_init.c: Include shlib-compat.h.
9011         (pthread_cond_init): Change strong_alias into versioned_symbol.
9012         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9013         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9014         fields.
9015         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9016         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9017         __pthread_cond_wait_2_0): New prototypes.
9018         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9019         __old_pthread_cond_init, __old_pthread_cond_signal,
9020         __old_pthread_cond_wait): Removed.
9021         * init.c: Include shlib-compat.h.
9022         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9023         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9024         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9025         ptr___pthread_cond_*_2_0 fields.
9026         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9027         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9029         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9030         LIBC_SIGACTION was not yet defined.
9031         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9032         [!defined LIBC_SIGACTION] (__sigaction): New function and
9033         libc_hidden_weak.
9034         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9035         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9037 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9039         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9041 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9043         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9044         New, larger type definition.
9045         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9046         implementation.
9047         * Versions [libpthread]: Add definitions for new pthread_cond_*
9048         interfaces for version GLIBC_2.3.2.
9049         * pthread_cond_init.c: Update initialization for new type definition.
9050         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9051         pthread_cond_timedwait, pthread_cond_signal, and
9052         pthread_cond_broadcast.  Add old_pthread_cond_init,
9053         old_pthread_cond_destroy, old_pthread_cond_wait,
9054         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9055         old_pthread_cond_broadcast.
9056         * old_pthread_cond_broadcast.c: New file.
9057         * old_pthread_cond_destroy.c: New file.
9058         * old_pthread_cond_init.c: New file.
9059         * old_pthread_cond_signal.c: New file.
9060         * old_pthread_cond_timedwait.c: New file.
9061         * old_pthread_cond_wait.c: New file.
9062         * pthreadP.h: Add prototypes for the compatibility interfaces.
9064         * pthread_cond_destroy.c: Don't include <errno.h>.
9066 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9068         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9069         unnecessary zero offset when addressing MUTEX.
9071 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9073         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9074         __register_atfork.
9075         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9076         for __register_atfork.
9078 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9080         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9081         instead of ASSEMBLER test macro.
9083         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9084         __libc_current_sigrtmax): Add libc_hidden_def.
9086         * sysdeps/pthread/list.h: Remove assert.h include.
9088 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9090         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9091         __pthread_initialize_minimal_internal not
9092         __pthread_initialize_minimal.
9094 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9096         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9097         __pthread_initialize_minimal as hidden.
9099         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9100         constructor.
9102 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9104         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9105         $(common-objpfx)format.lds, include that into the output script.
9106         Fix comment.
9107         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9109 2002-12-28  Andreas Jaeger  <aj@suse.de>
9111         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9112         nsec resolution changes.
9113         (xstat64_conv): Likewise.
9114         (xstat32_conv): Likewise.
9115         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9116         struct kernel_stat.
9117         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9118         structs stat and stat64.
9119         * time/time.h (__timespec_defined): Define for __USE_MISC.
9120         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9122 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9124         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9125         argument.
9126         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9127         (pthread_exit): Use strong_alias to avoid warnings.
9128         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9129         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9130         ptr___pthread_attr_init_2_*.
9131         * init.c (pthread_functions): Adjust.
9133 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9135         * forward.c: Make all functions available by default again.  It
9136         caused too much trouble.
9138         * pt-siglongjmp.c: Removed.
9140 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9142         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9143         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9144         * sysdeps/i386/Makefile: New file.
9145         * sysdeps/i386/tcb-offsets.sym: New file.
9146         * sysdeps/pthread/tcb-offsets.h: New file.
9147         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9148         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9150         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9151         __register_atfork...
9152         (GLIBC_2.3.2): ...here.
9154 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9156         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9157         pthread_attr_setstackaddr with __attribute_deprecated__.
9159 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9161         * pt-system.c (system): Remove cancellation handling.
9162         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9163         cancellation routines.
9165 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9167         * descr.h: Include <dl-sysdep.h>.
9168         (struct pthread): Move header.data.list to the back of the struct.
9169         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9170         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9171         (SYSINFO_OFFSEET): Likewise.
9173 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9175         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9176         Define.
9177         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9178         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9179         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9180         (USE_DL_SYSINFO): Undef.
9182 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9184         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9185         $(common-objpfx)libc.so.
9186         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9187         it is bigger than pipe buffer size even on arches with bigger
9188         page size.
9189         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9191 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9193         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9194         correct errno access for case that USE___THREAD is not defined.
9196 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9198         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9199         Patch by Marijn Ros <marijn@mad.scientist.com>.
9201 2002-12-22  Roland McGrath  <roland@redhat.com>
9203         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9205 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9207         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9209 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9211         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9212         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9213         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9215         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9216         of int $0x80.
9217         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9218         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9219         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9220         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9221         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9222         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9223         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9224         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9226         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9227         sysenter.
9228         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9230         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9232         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9233         in new TCB.
9234         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9235         that sysinfo is properly initialized.
9236         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9237         to 1 only for ld.so.
9239         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9240         RTLD_CORRECT_DYNAMIC_WEAK.
9242 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9244         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9245         Use return 0 as 6th argument to FORWARD4.
9246         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9248 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9250         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9251         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9252         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9253         (INIT_SYSINFO): New #define.
9254         (TLS_TP_INIT): Use INIT_SYSINFO.
9255         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9256         At test to make sure SYSINFO_OFFSET value is correct.
9257         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9259 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9261         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9262         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9263         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9264         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9265         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9266         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9267         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9269 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9271         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9272         macro instead of using int $0x80 directly.
9274         * sysdeps/pthread/bits/stdio-lock.h: New file.
9275         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9276         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9277         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9278         * Makefile (routines): Add libc-lowlevelmutex.
9280         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9281         __i686.get_pc_thunk.dx.
9283 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9285         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9286         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9287         ($(objpfx)tst-cancel-wrappers.out): New rule.
9288         * tst-cancel-wrappers.sh: New test.
9289         * tst-locale1.c: Include signal.h.
9290         (uselocale): Test static linking of __libc_current_sigrt*.
9292 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9294         * Makefile (tests): Add tst-cancel6.
9295         * tst-cancel6.c: New file
9297 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9299         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9300         Define meaningfully for assembler as well.
9301         * pthreadP.h (struct pthread_functions): Remove
9302         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9303         and ptr_pthread_attr_init_2_1 fields.
9304         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9305         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9306         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9307         (FORWARD3): Define using FORWARD4.
9308         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9309         versions.
9310         * pt-system.c: Remove duplicate stdlib.h include.
9312 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9314         * sem_init.c: Define sem_init@GLIBC_2.0.
9315         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9316         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9318         * flockfile.c: Moved to...
9319         * sysdeps/pthread/flockfile.c: ...here.  New file.
9320         * funlockfile.c: Moved to...
9321         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9322         * ftrylockfile.c: Moved to...
9323         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9325 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9327         * libc-cancellation.c: Guard both function with
9328         #if !defined NOT_IN_libc.
9329         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9330         automatically provided pthread wrappers.
9331         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9332         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9333         nor in libpthread.
9334         * pt-open.c: Removed.
9335         * pt-fcntl.c: Removed.
9336         * pt-fsync.c: Removed.
9337         * pt-lseek.c: Removed.
9338         * pt-msgrcv.c: Removed.
9339         * pt-msgsnd.c: Removed.
9340         * pt-msync.c: Removed.
9341         * pt-nanosleep.c: Removed.
9342         * pt-open64.c: Removed.
9343         * pt-pause.c: Removed.
9344         * pt-pread.c: Removed.
9345         * pt-pread64.c: Removed.
9346         * pt-pwrite.c: Removed.
9347         * pt-pwrite64.c: Removed.
9348         * pt-read.c: Removed.
9349         * pt-recv.c: Removed.
9350         * pt-recvfrom.c: Removed.
9351         * pt-recvmsg.c: Removed.
9352         * pt-send.c: Removed.
9353         * pt-sendto.c: Removed.
9354         * pt-sigtimedwait.c: Removed.
9355         * pt-sigwait.c: Removed.
9356         * pt-wait.c: Removed.
9357         * pt-waitpid.c: Removed.
9358         * pt-write.c: Removed.
9359         * pt-accept.c: Removed.
9360         * pt-close.c: Removed.
9361         * pt-connect.c: Removed.
9362         * pt-lseek64.c: Removed.
9363         * pt-sendmsg.c: Removed.
9364         * pt-tcdrain.c: Removed.
9366 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9368         * init.c (__pthread_initialize_minimal_internal): Renamed from
9369         __pthread_initialize_minimal.  Make old name an alias.  This
9370         converts a normal relocation into a relative relocation.
9372         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9374         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9375         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9376         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9377         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9378         pt-sigwaitinfo, pt-waitid, and pt-writev.
9379         * pt-creat.c: Removed.
9380         * pt-poll.c: Removed.
9381         * pt-pselect.c: Removed.
9382         * pt-readv.c: Removed.
9383         * pt-select.c: Removed.
9384         * pt-sigpause.c: Removed.
9385         * pt-sigsuspend.c: Removed.
9386         * pt-sigwaitinfo.c: Removed.
9387         * pt-waitid.c: Removed.
9388         * pt-writev.c: Removed.
9390         * init.c (pthread_functions): New variable.
9391         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9392         (or NULL) to __libc_pthread_init.
9393         * forward.c: Rewrite to use __libc:pthread_functions array to get
9394         function addresses.
9395         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9396         prototype.
9397         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9398         Take new parameter.  Copy content of variable pointed to by it
9399         to __libc_pthread_init.
9401         * pthreadP.h (struct pthread_functions): New type.
9402         (__libc_pthread_init): Declare.
9404         * pthread_attr_destroy.c: Add namespace protected alias.
9405         * pthread_attr_getdetachstate.c: Likewise.
9406         * pthread_attr_getinheritsched.c: Likewise.
9407         * pthread_attr_getschedparam.c: Likewise.
9408         * pthread_attr_getschedpolicy.c: Likewise.
9409         * pthread_attr_getscope.c: Likewise.
9410         * pthread_attr_setdetachstate.c: Likewise.
9411         * pthread_attr_setinheritsched.c: Likewise.
9412         * pthread_attr_setschedparam.c: Likewise.
9413         * pthread_attr_setschedpolicy.c: Likewise.
9414         * pthread_attr_setscope.c: Likewise.
9415         * pthread_cond_broadcast.c: Likewise.
9416         * pthread_cond_destroy.c: Likewise.
9417         * pthread_cond_init.c: Likewise.
9418         * pthread_cond_signal.c: Likewise.
9419         * pthread_cond_wait.c: Likewise.
9420         * pthread_condattr_destroy.c: Likewise.
9421         * pthread_condattr_init.c: Likewise.
9422         * pthread_equal.c: Likewise.
9423         * pthread_exit.c: Likewise.
9424         * pthread_getschedparam.c: Likewise.
9425         * pthread_self.c: Likewise.
9426         * pthread_setcancelstate.c: Likewise.
9427         * pthread_setschedparam.c: Likewise.
9428         * pthread_mutex_destroy.c: Likewise.
9429         * pthread_mutex_init.c: Likewise.
9430         * pthreadP.h: Add prototypes for the aliases.
9432         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9433         multiple_threads member in correct TCB to 1.
9435         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9436         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9437         member of thread decriptor, otherwise return unconditionally 1.
9439 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9441         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9442         regular Linux version.  Remove file.
9443         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9444         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9445         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9446         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9447         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9448         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9449         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9450         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9451         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9452         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9453         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9454         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9455         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9456         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9457         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9458         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9459         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9460         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9461         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9462         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9463         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9464         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9465         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9466         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9467         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9468         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9469         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9470         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9471         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9472         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9474 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9476         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9477         * sysdeps/unix/sysv/linux/open.c: Removed.
9478         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9479         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9480         * sysdeps/unix/sysv/linux/msync.c: Removed.
9481         * sysdeps/unix/sysv/linux/read.c: Removed.
9482         * sysdeps/unix/sysv/linux/close.c: Removed.
9483         * sysdeps/unix/sysv/linux/creat.c: Removed.
9484         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9485         * sysdeps/unix/sysv/linux/pause.c: Removed.
9486         * sysdeps/unix/sysv/linux/select.c: Removed.
9487         * sysdeps/unix/sysv/linux/write.c: Removed.
9489 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9491         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9492         element in TCB to see whether locking is needed.
9494         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9495         MULTIPLE_THREADS_OFFSET value is correct.
9497         * sysdeps/unix/sysv/linux/close.c: New file.
9498         * sysdeps/unix/sysv/linux/connect.S: New file.
9499         * sysdeps/unix/sysv/linux/creat.c: New file.
9500         * sysdeps/unix/sysv/linux/fsync.c: New file.
9501         * sysdeps/unix/sysv/linux/llseek.c: New file.
9502         * sysdeps/unix/sysv/linux/lseek.c: New file.
9503         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9504         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9505         * sysdeps/unix/sysv/linux/msync.c: New file.
9506         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9507         * sysdeps/unix/sysv/linux/open.c: New file.
9508         * sysdeps/unix/sysv/linux/open64.c: New file.
9509         * sysdeps/unix/sysv/linux/pause.c: New file.
9510         * sysdeps/unix/sysv/linux/poll.c: New file.
9511         * sysdeps/unix/sysv/linux/pread.c: New file.
9512         * sysdeps/unix/sysv/linux/pread64.c: New file.
9513         * sysdeps/unix/sysv/linux/pselect.c: New file.
9514         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9515         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9516         * sysdeps/unix/sysv/linux/readv.c: New file.
9517         * sysdeps/unix/sysv/linux/recv.S: New file.
9518         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9519         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9520         * sysdeps/unix/sysv/linux/select.c: New file.
9521         * sysdeps/unix/sysv/linux/send.S: New file.
9522         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9523         * sysdeps/unix/sysv/linux/sendto.S: New file.
9524         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9525         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9526         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9527         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9528         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9529         * sysdeps/unix/sysv/linux/system.c: New file.
9530         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9531         * sysdeps/unix/sysv/linux/wait.c: New file.
9532         * sysdeps/unix/sysv/linux/waitid.c: New file.
9533         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9534         * sysdeps/unix/sysv/linux/writev.c: New file.
9535         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9537         * pt-readv.c: Fix comment.
9539 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9541         * tst-cleanup1.c: Include stdlib.h.
9543         * tst-cancel5.c: New test.
9544         * Makefile (tests): Add tst-cancel5.
9545         (tst-cancel5): Link against libc.so libpthread.so in that order.
9547 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9549         * forward.c (test_loaded): Prevent recursive calls.
9551         * Makefile (routines): Add libc-cancellation.
9552         * libc-cancellation.c: New file.
9553         * descr.h (struct pthread): Add multiple_threads field.
9554         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9555         new thread descriptor to 1.
9556         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9557         Initialize multiple_thread field after successful thread creation.
9558         * cancellation.c (__do_cancel): Move to pthreadP.h.
9559         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9560         (__pthread_disable_asynccancel): Add internal_function attribute.
9561         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9562         * pthread_setcancelstate.c: Likewise.
9563         * pthread_setcanceltype.c: Likewise.
9564         * pthread_exit.c: Likewise.
9565         * pthreadP.h (CANCELLATION_P): Likewise.
9566         (__do_cancel): Define as static inline.
9567         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9568         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9569         declarations.
9570         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9571         fields.  Define MULTIPLE_THREADS_OFFSET.
9572         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9573         declaration.
9574         * sysdeps/unix/sysv/linux/accept.S: New file.
9575         * sysdeps/unix/sysv/linux/read.c: New file.
9576         * sysdeps/unix/sysv/linux/write.c: New file.
9577         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9578         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9579         initialization of __libc_locking_needed.
9580         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9581         __libc_locking_needed, use multiple_threads field in TCB.
9582         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9584 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9586         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9587         version.
9588         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9590         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9591         access to __libc_locking_needed for PIC.
9593 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9595         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9596         declare for libc.so.
9597         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9598         expression.
9599         (__libc_lock_lock): Put into statement expression.
9600         (__libc_lock_unlock): Remove trailing semicolon.
9601         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9603 2002-12-12  Roland McGrath  <roland@redhat.com>
9605         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9606         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9608 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9610         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9611         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9612         Initialize __libc_locking_needed.
9613         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9614         instead of __register_pthread_fork_handler.
9615         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9616         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9617         fork-gen with libc_pthread_init.
9618         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9619         of __register_pthread_fork_handler.
9620         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9621         of __register_pthread_fork_handler.
9622         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9623         __libc_locking_needed to determine whether lock prefix can be avoided.
9624         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9626 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9628         * Makefile (tests): Add tst-cleanup1.
9629         * tst-cleanup1.c: New file.
9630         * cancellation.c (__cleanup_thread): Removed.
9631         (__do_cancel): Remove call to __cleanup_thread.
9632         * pthreadP.h: Remove __cleanup_thread prorotype.
9634         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9635         Remember function and argument even if cancellation handler
9636         function is not available.
9637         (__libc_cleanup_region_end): Execute registered function directly if
9638         pthread functions are not available.
9639         (__libc_cleanup_end): Likewise.
9641         * init.c (__pthread_initialize_minimal): Fix initialization in
9642         static lib by preventing gcc from being too clever.
9644 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9646         * init.c (__pthread_initialize_minimal): Remove unneccesary
9647         sigaddset call.
9649         * Makefile (tests): We can run tst-locale2 now.
9651 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9653         * Versions: Remove duplicated sigwait entry.
9655 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9657         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9658         inside libpthread.
9660         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9662         * pthreadP.h: Declare __pthread_enable_asynccancel and
9663         __pthread_disable_asynccancel.
9664         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9665         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9666         * cancellation.c (__pthread_enable_asynccancel): New function.
9667         (__pthread_disable_asynccancel): New function.
9668         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9669         * pt-close.c: Likewise.
9670         * pt-connect.c: Likewise.
9671         * pt-creat.c: Likewise.
9672         * pt-fcntl.c: Likewise.
9673         * pt-fsync.c: Likewise.
9674         * pt-lseek.c: Likewise.
9675         * pt-lseek64.c: Likewise.
9676         * pt-msgrcv.c: Likewise.
9677         * pt-msgsnd.c: Likewise.
9678         * pt-msync.c: Likewise.
9679         * pt-nanosleep.c: Likewise.
9680         * pt-open.c: Likewise.
9681         * pt-open64.c: Likewise.
9682         * pt-pause.c: Likewise.
9683         * pt-poll.c: Likewise.
9684         * pt-pread.c: Likewise.
9685         * pt-pread64.c: Likewise.
9686         * pt-pselect.c: Likewise.
9687         * pt-pwrite.c: Likewise.
9688         * pt-pwrite64.c: Likewise.
9689         * pt-read.c: Likewise.
9690         * pt-readv.c: Likewise.
9691         * pt-recv.c: Likewise.
9692         * pt-recvfrom.c: Likewise.
9693         * pt-recvmsg.c: Likewise.
9694         * pt-select.c: Likewise.
9695         * pt-send.c: Likewise.
9696         * pt-sendmsg.c: Likewise.
9697         * pt-sendto.c: Likewise.
9698         * pt-sigpause.c: Likewise.
9699         * pt-sigsuspend.c: Likewise.
9700         * pt-sigtimedwait.c: Likewise.
9701         * pt-sigwait.c: Likewise.
9702         * pt-sigwaitinfo.c: Likewise.
9703         * pt-system.c: Likewise.
9704         * pt-tcdrain.c: Likewise.
9705         * pt-wait.c: Likewise.
9706         * pt-waitid.c: Likewise.
9707         * pt-waitpid.c: Likewise.
9708         * pt-write.c: Likewise.
9709         * pt-writev.c: Likewise.
9710         * pthread_join.c: Likewise.
9711         * pthread_timedjoin.c: Likewise.
9713         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9714         (__xpg_sigpause): New function.
9715         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9717 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
9719         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
9721         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
9722         _GI_pthread_cleanup_pop to pthreadP.h.
9724         * ftrylockfile.c: Use _IO_lock_trylock instead of
9725         pthread_mutex_trylock.
9727         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
9728         (CANCEL_RESET): Likewise.
9729         (__pthread_setcanceltype_): Declare.
9730         (__pthread_mutex_lock_internal): Declare.
9731         (__pthread_mutex_unlock_internal): Declare.
9732         (__pthread_once_internal): Declare.
9733         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
9734         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
9736         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
9737         and pthread_mutex_unlock.
9738         * pthread_cond_wait.c: Likewise.
9739         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
9740         * pthread_mutex_unlock.c: Likewise.
9742         * pthread_setcanceltype.c: Add additional alias
9743         __pthread_setcanceltype.
9745         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
9746         * sem_open.c (sem_open): Likewise.
9747         Use __libc_open, __libc_write, and __libc_close instead of
9748         open, write, and close respectively.
9750         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
9751         Rewrite as statement expression since it must return a value.
9753         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
9754         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
9755         __pthread_kill.
9757         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
9758         alias __pthread_once_internal.
9760         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
9762 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
9764         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
9765         * tst-stdio1.c: New file.
9766         * tst-stdio2.c: New file.
9768         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
9770         * Makefile (tests): Comment out tst-locale2 for now.
9771         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
9773         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
9774         -D_IO_MTSAFE_IO.
9775         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
9776         Use _IO_lock_init instead of explicit assignment.
9778         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
9779         Define __libc_lock_* and __libc_lock_recursive macros with
9780         lowlevellock macros, not pthread mutexes.
9782         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
9783         of pthread_mutex_lock.
9784         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
9785         instead of pthread_mutex_unlock.
9787 2002-12-06  Roland McGrath  <roland@redhat.com>
9789         * allocatestack.c (__stack_user): Use uninitialized defn.
9790         * init.c (__pthread_initialize_minimal): Initialize it here.
9792 2002-12-05  Roland McGrath  <roland@redhat.com>
9794         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
9795         string.
9796         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
9798         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
9799         missing & here too.
9801 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
9803         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9804         lowlevellock.
9805         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
9806         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
9807         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
9808         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
9809         for __libc_lock_* macros.
9810         * Makefile (routines): Add libc-lowlevellock.
9812 2002-10-09  Roland McGrath  <roland@redhat.com>
9814         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
9815         Under [__PIC__], call the function via the pointer fetched for
9816         comparison rather than a call by name that uses the PLT.
9817         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
9818         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
9819         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
9820         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
9821         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
9823 2002-12-04  Roland McGrath  <roland@redhat.com>
9825         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
9827         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
9828         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
9830         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
9832 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9834         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
9835         a completely opaque, non-integer type.
9836         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9838 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
9840         * sysdeps/i386/tls.h: Include stdlib.h.
9841         * sysdeps/x86_64/tls.h: Likewise.
9843 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9845         * Makefile (tests): Add tst-locale2.
9846         (tests-static): Likewise.
9847         * tst-locale2.c: New file.
9849         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
9850         volatile and add memory clobbers to lock operations.
9852 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
9854         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
9855         * sysdeps/i386/i486/bits/atomic.h: New file.
9856         * sysdeps/i386/i586/bits/atomic.h: New file.
9857         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
9858         include i486 version.
9859         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
9860         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
9861         Patch by Marijn Ros <marijn@mad.scientist.com>.
9863         * allocatestack.c (get_cached_stack): Don't crash if we first
9864         found a stack with a larger size then needed.
9865         Reported by Hui Huang <hui.huang@sun.com>.
9867         * Makefile (tests): Add tst-sysconf.
9868         * tst-sysconf.c: New file.
9870         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
9871         PTHREAD_THREADS_MAX.
9873 2002-12-02  Roland McGrath  <roland@redhat.com>
9875         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
9876         Declare using hidden_proto instead of attribute_hidden, so there are
9877         non-.hidden static symbols for gdb to find.
9878         (__pthread_keys): Likewise.
9879         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
9880         * allocatestack.c (__stack_user): Likewise.
9881         * pthread_create.c (__pthread_keys): Likewise.
9882         (__nptl_threads_events, __nptl_last_event): Make these static instead
9883         of hidden.
9884         * pthread_key_create.c (__pthread_pthread_keys_max,
9885         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
9887 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
9889         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
9890         statically.
9891         * tst-locale1.c: New file.
9893         * pthread_cond_timedwait.c: Include <stdlib.h>.
9895         * Makefile (tests): Add tst-fork2 and tst-fork3.
9896         * tst-fork2.c: New file.
9897         * tst-fork3.c: New file.
9899 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
9901         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
9903         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
9904         require it to 200112L.
9906         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
9907         instruction only if HAVE_CMOV is defined.
9908         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
9910         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
9912         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
9914         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
9916         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
9918 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
9920         * sysdeps/x86_64/bits/atomic.h: New file.
9922         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
9923         16-bit operations.
9925         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
9926         possible since gettid cannot fail.
9928         * sysdeps/x86_64/pthreaddef.h: New file.
9930         * sysdeps/i386/pthreaddef.h (gettid): Removed.
9932         * sysdeps/x86_64/pthread_spin_init.c: New file.
9933         * sysdeps/x86_64/pthread_spin_lock.c: New file.
9934         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
9935         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
9937         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
9938         Add missing lock prefix.  Minute optimization.
9940         * tst-spin2.c (main): Also check successful trylock call.
9942         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
9943         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
9945         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
9946         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
9948         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
9949         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
9950         value in case of an error.  Add support for INTERNAL_SYSCALL.
9952         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
9953         value in case of an error.
9955         * sysdeps/x86_64/tls.h: New file.
9957 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
9959         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
9960         takes the array member name and the index as parameters.
9961         (THREAD_SETMEM_NC): Likewise.
9962         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
9963         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
9964         interfaces.
9966         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
9967         to decide which code to use.
9968         (THREAD_SETMEM_NC): Likewise.
9970         * allocatestack.c (queue_stack): Don't remove stack from list here.
9971         Do it in the caller.  Correct condition to prematurely terminate
9972         loop to free stacks.
9973         (__deallocate_stack): Remove stack from list here.
9975 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
9977         * Makefile (tests): Add tst-stack1.
9978         * tst-stack1.c: New file.
9980         * allocatestack.c (allocate_stack): Initialize the TCB on a user
9981         provided stack.
9983         * pthread_attr_getstack.c: Return bottom of the thread area.
9985 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
9987         * Makefile (libpthread-routines): Add pt-allocrtsig and
9988         pthread_kill_other_threads.
9989         * pt-allocrtsig.c: New file.
9990         * pthread_kill_other_threads.c: New file.
9991         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
9992         all three functions.
9993         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9994         allocrtsig.
9995         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
9996         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
9997         and __libc_allocate_rtsig_private.
9998         * Versions (libpthread): Export pthread_kill_other_threads_np,
9999         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10001 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10003         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10004         the end of the stack.  Adjust computations.
10005         When mprotect call fails dequeue stack and free it.
10006         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10007         attribute.
10008         * pthread_getattr_np.c: Likewise.
10010         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10011         surprises.
10013 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10015         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10016         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10018 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10020         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10021         * pthread_setspecific.c: Likewise.
10023 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10025         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10026         definitions.  Get them from the official place.
10027         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10029         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10030         Use new CLONE_ flags in clone() calls.
10032         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10033         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10035         * Versions: Add pthread_* functions for libc.
10036         * forward.c: New file.
10038         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10039         errno-loc.
10040         * herrno.c: New file.
10041         * res.c: New file.
10043         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10044         sem_trywait, and sem_timedwait.  Add herrno and res.
10045         * sem_init.c: Don't initialize lock and waiters members.
10046         * sem_open.c: Likewise.
10047         * sem_post.c: Removed.
10048         * sem_wait.c: Removed.
10049         * sem_trywait.c: Removed.
10050         * sem_timedwait.c: Removed.
10051         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10052         Includes full implementations of sem_post, sem_wait, sem_trywait,
10053         and sem_timedwait.
10054         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10055         for new implementation.
10056         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10057         and waiters fields.
10059         * tst-sem3.c: Improve error message.
10060         * tst-signal3.c: Likewise.
10062         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10063         to tell the kernel about the termination futex and to initialize tid
10064         member.  Don't initialize main_thread.
10065         * descr.h (struct pthread): Remove main_thread member.
10066         * cancelllation.c (__do_cancel): Remove code handling main thread.
10067         The main thread is not special anymore.
10069         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10070         size of the stacks to stack_cache_actsize.
10072         * pt-readv.c: Add missing "defined".
10073         * pt-sigwait.c: Likewise.
10074         * pt-writev.c: Likewise.
10076 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10078         * Versions: Export __connect from libpthread.
10079         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10081         * Makefile (libpthread-routines): Add pt-raise.
10082         * sysdeps/unix/sysv/linux/raise.c: New file.
10083         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10084         * sysdeps/generic/pt-raise.c: New file.
10086         * pthread_cond_init.c: Initialize all data elements of the condvar
10087         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10089         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10090         * pthread_create.c: Likewise.
10092         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10093         * tst-key1.c: New file.
10094         * tst-key2.c: New file.
10095         * tst-key3.c: New file.
10097         * Versions: Export pthread_detach for version GLIBC_2.0.
10098         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10100 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10102         * pthread_key_create.c: Terminate search after an unused key was found.
10103         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10105         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10106         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10108 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10110         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10111         dynamic lookup for errno in PIC.
10113         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10114         release the stack lock as soon as possible.
10115         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10116         the static TLS block.
10117         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10119         * cancellation.c: Renamed from cancelation.c.
10120         * Makefile: Adjust accordingly.
10121         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10122         * cleanup_defer.c: Use CANCELLATION_P.
10123         * pthread_testcancel.c: Likewise.
10124         * descr.h: Fix spelling in comments.
10125         * init.c: Likewise.
10126         * pthread_getattr_np.c: Likewise.
10127         * pthread_getschedparam.c: Likewise.
10128         * pthread_setschedparam.c: Likewise.
10129         * Versions: Likewise.
10131         * pt-pselect.c: New file.
10132         * Makefile (libpthread-routines): Add pt-pselect.
10133         * Versions: Add pselect.
10135         * tst-cancel4.c: New file.
10136         * Makefile (tests): Add tst-cancel4.
10138 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10140         * pthread_mutex_lock.c: Always record lock ownership.
10141         * pthread_mutex_timedlock.c: Likewise.
10142         * pthread_mutex_trylock.c: Likewise.
10144         * pt-readv.c: New file.
10145         * pt-writev.c: New file.
10146         * pt-creat.c: New file.
10147         * pt-msgrcv.c: New file.
10148         * pt-msgsnd.c: New file.
10149         * pt-poll.c: New file.
10150         * pt-select.c: New file.
10151         * pt-sigpause.c: New file.
10152         * pt-sigsuspend.c: New file.
10153         * pt-sigwait.c: New file.
10154         * pt-sigwaitinfo.c: New file.
10155         * pt-waitid.c: New file.
10156         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10157         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10158         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10159         * Versions: Add all the new functions.
10161         * tst-exit1.c: New file.
10162         * Makefile (tests): Add tst-exit1.
10164         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10166 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10168         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10170         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10171         call.  pthread_join is an official cancellation point.
10172         * pthread_timedjoin.c: Likewise.
10174         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10175         and the condvar's mutex are retrieved.
10176         * pthread_cond_timedwait.c: Likewise.
10177         Reported by dice@saros.East.Sun.COM.
10179 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10181         * pthreadP.h: Cut out all type definitions and move them...
10182         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10183         * pthreadP.h: Include <internaltypes.h>.
10185         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10186         performance tweaks.
10188         * sem_trywait.c: Shuffle #includes around to get right order.
10189         * sem_timedwait.c: Likewise.
10190         * sem_post.c: Likewise.
10191         * sem_wait.c: Likewise.
10193         * nptl 0.3 released.
10195         * Makefile (tests): Add tst-signal3.
10196         * tst-signal3.c: New file.
10198 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10200         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10201         the asms modify the sem object.
10202         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10204         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10205         the actual members.
10206         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10207         * semaphoreP.h: Include pthreadP.h.
10208         * sem_getvalue.c: Adjust to sem_t change.
10209         * sem_init.c: Likewise.
10210         * sem_open.c: Likewise.
10211         * sem_post.c: Likewise.
10212         * sem_timedwait.c: Likewise.
10213         * sem_trywait.c: Likewise.
10214         * sem_wait.c: Likewise.
10216 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10218         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10219         * tst-basic2.c: New file.
10220         * tst-exec1.c: New file.
10221         * tst-exec2.c: New file.
10222         * tst-exec3.c: New file.
10224         * tst-fork1.c: Remove extra */.
10226         * nptl 0.2 released.  The API for IA-32 is complete.