* elf/rtld.c (dl_main): Use the page size to find the map start.
[glibc.git] / nptl / ChangeLog
blobc92e6abf45a3f7f82609bd87801cfd3eef663121
1 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
4         Use __linkin_atfork.
6 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
8         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
9         missing line continuations.
10         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
11         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
13 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
15         [BZ #5220]
16         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
17         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
18         (struct timer): Add next element.
19         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
20         enqueue timer structure into __active_timer_sigev_thread list.
21         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
22         remove timer struct from __active_timer_sigev_thread.
23         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
24         Before using timer structure make sure it is still on the
25         __active_timer_sigev_thread list.  Keep lock until done.
26         Define __active_timer_sigev_thread and
27         __active_timer_sigev_thread_lock.
29 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
31         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
32         Redefine thread_atfork for use of ATFORK_MEM.
33         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
34         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
35         function.
36         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
37         Use atomic operation when removing first element of list.
39 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
41         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
42         routine instead of an alias to __new_sem_post.
44 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
46         * init.c (__pthread_initialize_minimal): Initialize word to appease
47         valgrind.
49 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
51         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
52         libc.so just clear NAME.
53         (__libc_rwlock_fini): Nop inside of libc.so.
54         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
55         all zeros.
57 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
59         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
60         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
61         unlocking failed.
62         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
64 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
66         [BZ #4938]
67         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
68         reclaimed stack if necessary.
69         * Makefile (tests): Add tst-tsd6.
70         * tst-tsd6.c: New file.
72 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
74         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
75         Add private argument.
77 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
79         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
80         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
82 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
84         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
85         (__lll_robust_timedlock): Pass private as last argument to
86         __lll_robust_timedlock_wait.
87         (__lll_unlock): Fix a pasto.
89 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
91         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
92         sparc_old_sem): New structs.
93         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
94         (__sem_wait_cleanup): New function.
95         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
96         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
97         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
98         lll_futex_wait.
99         (__old_sem_wait): New function.
100         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
101         nptl/sysdeps/unix/sysv/linux/sparc version.
102         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
103         Likewise.
104         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
105         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
106         (__new_sem_trywait): Use sparc_old_sem structure.
107         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
108         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
109         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
110         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
111         lll_futex_timed_wait.
112         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
113         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
114         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
115         lll_futex_wake.
116         (__old_sem_post): New function.
117         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
118         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
119         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
120         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
121         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
122         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
124 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
126         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
127         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
128         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
129         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
130         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
131         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
132         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
133         Use FUTEX_WAKE_OP.
134         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
135         kernel-features.h and tcb-offsets.h.
136         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
137         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
138         process private.
139         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
140         tcb-offsets.h.
141         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
142         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
143         process private.
144         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
145         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
146         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
147         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
148         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
149         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
150         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
152 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
154         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
155         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
156         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
157         lll_futex_timed_wait.
159         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
160         __lll_robust_unlock): Rewrite as macros instead of inline functions.
161         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
162         __lll_robust_unlock, __lll_wait_tid): Likewise.
164 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
166         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
167         Fix a pasto.
168         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
169         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
170         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
171         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
172         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
173         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
174         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
175         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
176         kernel-features.h.
177         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
178         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
179         process private.  Switch DW_CFA_advance_loc1 and some
180         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
181         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
182         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
183         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
184         process private.  Switch DW_CFA_advance_loc{1,2} and some
185         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
186         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
187         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
188         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
189         Likewise.
190         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
191         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
192         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
193         Likewise.
194         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
195         (__pthread_cond_broadcast): Compare %r8 instead of
196         dep_mutex-cond_*(%rdi) with $-1.
197         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
198         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
199         of oring.
201 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
203         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
205 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
207         * allocatestack.c: Include kernel-features.h.
208         * pthread_create.c: Likewise.
209         * pthread_mutex_init.c: Likewise.
210         * init.c: Likewise.
211         * pthread_cond_timedwait.c: Likewise.
212         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
213         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
214         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
215         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
216         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
217         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
218         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
219         Likewise.
220         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
221         Likewise.
222         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
223         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
224         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
225         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
227 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
229         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
230         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
231         byte elements.  One of them is the new __shared element.
232         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
233         adjust names of other padding elements.
234         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
235         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
236         byte elements.  One of them is the new __shared element.
237         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
238         adjust names of other padding elements.
239         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
240         Renamed __pad1 element to __shared, adjust names of other padding
241         elements.
242         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
243         (pthread_rwlock_t): Likewise.
244         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
245         typo.
247 2007-08-09  Anton Blanchard  <anton@samba.org>
249         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
251 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
253         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
254         <kernel-features.h>.
255         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
257 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
259         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
260         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
261         dealing with robust mutexes.
262         * pthread_mutex_timedlock.c: Likewise.
263         * pthread_mutex_trylock.c: Likewise.
264         * pthread_mutex_unlock.c: Likewise.
265         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
267 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
269         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
270         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
271         (PTHREAD_MUTEX_PSHARED): Define.
272         * pthread_mutex_init.c (__pthread_mutex_init): Set
273         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
274         mutexes.
275         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
276         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
277         as second argument to lll_lock.
278         (LLL_MUTEX_TRYLOCK): Take mutex as argument
279         instead of its __data.__lock field.
280         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
281         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
282         to lll_robust_lock.
283         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
284         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
285         instead of mutex->__data.__kind directly, pass
286         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
287         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
288         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
289         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
290         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
291         to lll_timedlock, lll_robust_timedlock, lll_unlock and
292         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
293         of mutex->__data.__kind directly.
294         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
295         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
296         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
297         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
298         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
299         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
300         and lll_futex_wake.
301         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
302         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
303         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
304         directly.
305         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
306         Take mutex as argument instead of its __data.__lock field, pass
307         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
308         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
309         __data.__lock field.
310         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
311         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
312         to lll_robust_cond_lock.
313         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
314         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
315         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
316         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
317         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
318         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
319         lll_futex_wait.
320         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
321         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
322         lll_futex_wake.
323         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
324         pshared variable, pass it to lll_lock, lll_unlock,
325         lll_futex_timedwait and lll_futex_wake.
326         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
327         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
328         and lll_futex_wake.
329         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
330         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
331         macro.
332         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
333         lll_futex_wake_unlock): Likewise.
334         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
335         Likewise.
336         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
337         lll_futex_wake_unlock): Likewise.
338         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
339         Likewise.
340         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
341         lll_futex_wake_unlock): Likewise.
342         (lll_futex_wake): Fix a typo.
343         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
344         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
345         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
346         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
347         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
348         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
349         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
350         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
351         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
352         (__pthread_cond_timedwait): Likewise.
353         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
354         (__condvar_cleanup, __pthread_cond_wait): Likewise.
356 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
358         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
359         Don't use CGOTSETUP and CGOTRESTORE macros.
360         (CGOTSETUP, CGOTRESTORE): Remove.
361         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
362         @local symbol.
364 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
366         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
367         definitions for private futexes.
368         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
369         kernel-features.h and lowlevellock.h.  Use private futexes if
370         they are available.
371         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
372         (__lll_mutex_lock_wait): Rename to
373         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
374         (__lll_mutex_timedlock_wait): Rename to ...
375         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
376         Don't compile in for libc.so.
377         (__lll_mutex_unlock_wake): Rename to ...
378         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
379         (__lll_timedwait_tid): Use __NR_gettimeofday.
380         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
381         the header from assembler.  Renamed all lll_mutex_* resp.
382         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
383         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
384         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
385         Define.
386         (__lll_lock_wait_private): Add prototype.
387         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
388         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
389         __lll_unlock_wake): Likewise.
390         (lll_lock): Add private argument.  Call __lll_lock_wait_private
391         if private is constant LLL_PRIVATE.
392         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
393         lll_timedlock, lll_robust_timedlock): Add private argument.
394         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
395         if private is constant LLL_PRIVATE.
396         (lll_robust_unlock, lll_robust_dead): Add private argument.
397         (lll_lock_t): Remove.
398         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
399         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
400         lll_cond_wake, lll_cond_broadcast): Remove.
401         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
402         kernel-features.h and lowlevellock.h.
403         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
404         (LOAD_FUTEX_WAIT): Define.
405         (__lll_robust_mutex_lock_wait): Rename to ...
406         (__lll_robust_lock_wait): ... this.  Add private argument.
407         Use LOAD_FUTEX_WAIT macro.
408         (__lll_robust_mutex_timedlock_wait): Rename to ...
409         (__lll_robust_timedlock_wait): ... this.    Add private argument.
410         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
411         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
412         lowlevellock.h.
413         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
414         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
415         __lll_mutex_{lock,unlock}_*.
416         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
417         lowlevellock.h and pthread-errnos.h.
418         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
419         FUTEX_CMP_REQUEUE, EINVAL): Remove.
420         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
421         __lll_mutex_{lock,unlock}_*.
422         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
423         lowlevellock.h and pthread-errnos.h.
424         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
425         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
426         __lll_mutex_{lock,unlock}_*.
427         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
428         lowlevellock.h.
429         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
430         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
431         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
432         (__condvar_tw_cleanup): Likewise.
433         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
434         lowlevellock.h.
435         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
436         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
437         __lll_mutex_{lock,unlock}_*.
438         ( __condvar_w_cleanup): Likewise.
439         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
440         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
441         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
442         lowlevellock.h.
443         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
444         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
445         __lll_mutex_{lock,unlock}_*.
446         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
447         lowlevellock.h.
448         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
449         FUTEX_PRIVATE_FLAG): Remove.
450         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
451         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
452         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
453         lowlevellock.h.
454         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
455         FUTEX_PRIVATE_FLAG): Remove.
456         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
457         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
458         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
459         lowlevellock.h.
460         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
461         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
462         __lll_mutex_{lock,unlock}_*.
463         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
464         lowlevellock.h.
465         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
466         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
467         __lll_mutex_{lock,unlock}_*.
468         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
469         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
470         (__new_sem_post): Use standard initial exec code sequences.
471         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
472         lowlevellock.h.
473         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
474         FUTEX_PRIVATE_FLAG): Remove.
475         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
476         exec code sequences.
477         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
478         (__new_sem_trywait): Use standard initial exec code sequences.
479         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
480         (__new_sem_wait): Use standard initial exec code sequences.
482 2007-07-31  Anton Blanchard  <anton@samba.org>
484         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
485         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
486         atomic_full_barrier.
488 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
490         * allocatestack.c (stack_cache_lock): Change type to int.
491         (get_cached_stack, allocate_stack, __deallocate_stack,
492         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
493         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
494         as second argument to lll_lock and lll_unlock macros on
495         stack_cache_lock.
496         * pthread_create.c (__find_in_stack_list): Likewise.
497         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
498         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
499         as second argument.
500         * descr.h (struct pthread): Change lock and setxid_futex field
501         type to int.
502         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
503         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
504         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
505         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
506         Likewise.
507         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
508         * pthread_cond_init.c (__pthread_cond_init): Likewise.
509         * pthreadP.h (__attr_list_lock): Change type to int.
510         * pthread_attr_init.c (__attr_list_lock): Likewise.
511         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
512         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
513         lll_{,un}lock.
514         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
515         also for lll_futex_{wake,wait}.
516         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
517         a pointer to const.
518         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
519         LLL_SHARED as second argument to lll_{,un}lock.
520         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
521         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
522         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
523         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
524         Likewise.
525         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
526         as second argument to lll_{,un}lock macros on pd->lock.
527         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
528         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
529         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
530         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
531         Likewise.
532         * sysdeps/pthread/createthread.c (do_clone, create_thread):
533         Likewise.
534         * pthread_once.c (once_lock): Change type to int.
535         (__pthread_once): Pass LLL_PRIVATE as second argument to
536         lll_{,un}lock macros on once_lock.
537         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
538         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
539         rwlock->__data.__shared as second argument to them and similarly
540         for lll_futex_w*.
541         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
542         Likewise.
543         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
544         Likewise.
545         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
546         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
547         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
548         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
549         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
550         to lll_{,un}lock macros on __sem_mappings_lock.
551         * sem_open.c (check_add_mapping): Likewise.
552         (__sem_mappings_lock): Change type to int.
553         * semaphoreP.h (__sem_mappings_lock): Likewise.
554         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
555         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
556         instead of lll_*mutex_*, pass LLL_SHARED as last
557         argument.
558         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
559         pass LLL_SHARED as last argument.
560         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
561         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
562         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
563         pass LLL_SHARED as last argument.
564         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
565         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
566         LLL_SHARED as last argument.
567         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
568         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
569         Similarly.
570         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
571         __libc_lock_lock_recursive, __libc_lock_unlock,
572         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
573         argument to lll_{,un}lock.
574         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
575         _IO_lock_unlock): Likewise.
576         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
577         compound literal.
578         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
579         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
580         __fork_lock.
581         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
582         free_mem): Likewise.
583         (__fork_lock): Change type to int.
584         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
585         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
586         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
587         lll_futex_wake.
588         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
589         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
590         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
591         New function.
592         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
593         pass it through to lll_futex_*wait, only compile in when
594         IS_IN_libpthread.
595         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
596         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
597         argument and pass it through to lll_futex_*wait.
598         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
599         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
600         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
601         inline functions to __lll_* resp. __lll_robust_*.
602         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
603         (lll_mutex_dead): Add private argument.
604         (__lll_lock_wait_private): New prototype.
605         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
606         __lll_robust_lock_timedwait): Add private argument to prototypes.
607         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
608         call __lll_lock_wait_private, otherwise pass private to
609         __lll_lock_wait.
610         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
611         __lll_robust_timedlock): Add private argument, pass it to
612         __lll_*wait functions.
613         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
614         call __lll_unlock_wake_private, otherwise pass private to
615         __lll_unlock_wake.
616         (__lll_robust_unlock): Add private argument, pass it to
617         __lll_robust_unlock_wake.
618         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
619         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
620         argument, pass it through to __lll_* inline function.
621         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
622         (lll_lock_t): Remove.
623         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
624         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
625         lll_cond_wake, lll_cond_broadcast): Remove.
626         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
627         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
628         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
629         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
630         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
631         the header from assembler.  Renamed all lll_mutex_* resp.
632         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
633         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
634         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
635         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
636         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
637         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
638         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
639         Remove prototype.
640         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
641         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
642         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
643         (lll_trylock): Likewise, use __lll_trylock_asm, pass
644         MULTIPLE_THREADS_OFFSET as another asm operand.
645         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
646         MULTIPLE_THREADS_OFFSET as last asm operand, call
647         __lll_lock_wait_private if private is constant LLL_PRIVATE,
648         otherwise pass private as another argument to __lll_lock_wait.
649         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
650         lll_timedlock, lll_robust_timedlock): Add private argument, pass
651         private as another argument to __lll_*lock_wait call.
652         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
653         MULTIPLE_THREADS_OFFSET as another asm operand, call
654         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
655         otherwise pass private as another argument to __lll_unlock_wake.
656         (lll_robust_unlock): Add private argument, pass private as another
657         argument to __lll_unlock_wake.
658         (lll_robust_dead): Add private argument, use __lll_private_flag
659         macro.
660         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
661         LLL_MUTEX_LOCK_INITIALIZER.
662         (lll_lock_t): Remove.
663         (LLL_LOCK_INITIALIZER_WAITERS): Define.
664         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
665         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
666         lll_cond_wake, lll_cond_broadcast): Remove.
667         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
668         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
669         2007-05-2{3,9} changes.
670         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
671         kernel-features.h and lowlevellock.h.
672         (LOAD_PRIVATE_FUTEX_WAIT): Define.
673         (LOAD_FUTEX_WAIT): Rewritten.
674         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
675         define.
676         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
677         (__lll_mutex_lock_wait): Rename to ...
678         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
679         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
680         (__lll_mutex_timedlock_wait): Rename to ...
681         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
682         contains private argument.  Don't compile in for libc.so.
683         (__lll_mutex_unlock_wake): Rename to ...
684         (__lll_unlock_wake): ... this.  %ecx contains private argument.
685         Don't compile in for libc.so.
686         (__lll_timedwait_tid): Use __NR_gettimeofday.
687         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
688         kernel-features.h and lowlevellock.h.
689         (LOAD_FUTEX_WAIT): Define.
690         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
691         define.
692         (__lll_robust_mutex_lock_wait): Rename to ...
693         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
694         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
695         macro.
696         (__lll_robust_mutex_timedlock_wait): Rename to ...
697         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
698         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
699         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
700         lowlevellock.h.
701         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
702         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
703         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
704         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
705         to __lll_lock_wait in %edx.
706         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
707         Include lowlevellock.h and pthread-errnos.h.
708         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
709         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
710         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
711         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
712         pass LLL_SHARED in %ecx to both __lll_lock_wait and
713         __lll_unlock_wake.
714         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
715         Include lowlevellock.h and pthread-errnos.h.
716         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
717         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
718         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
719         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
720         pass LLL_SHARED in %ecx to both __lll_lock_wait and
721         __lll_unlock_wake.
722         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
723         Include lowlevellock.h.
724         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
725         Don't define.
726         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
727         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
728         pass LLL_SHARED in %ecx to both __lll_lock_wait and
729         __lll_unlock_wake.  Use __NR_gettimeofday.
730         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
731         Include lowlevellock.h.
732         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
733         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
734         to __lll_*, pass cond_lock address in %edx rather than %ecx to
735         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
736         and __lll_unlock_wake.
737         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
738         Include lowlevellock.h.
739         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
740         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
741         MUTEX(%ebx) address in %edx rather than %ecx to
742         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
743         and __lll_unlock_wake.  Move return value from %ecx to %edx
744         register.
745         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
746         Include lowlevellock.h.
747         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
748         Don't define.
749         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
750         MUTEX(%ebp) address in %edx rather than %ecx to
751         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
752         and __lll_unlock_wake.  Move return value from %ecx to %edx
753         register.  Use __NR_gettimeofday.
754         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
755         Include lowlevellock.h.
756         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
757         Don't define.
758         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
759         MUTEX(%ebp) address in %edx rather than %ecx to
760         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
761         and __lll_unlock_wake.  Move return value from %ecx to %edx
762         register.  Use __NR_gettimeofday.
763         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
764         Include lowlevellock.h.
765         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
766         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
767         MUTEX(%edi) address in %edx rather than %ecx to
768         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
769         and __lll_unlock_wake.
770         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
771         Include lowlevellock.h.
772         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
773         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
774         MUTEX(%ebx) address in %edx rather than %ecx to
775         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
776         and __lll_unlock_wake.  Move return value from %ecx to %edx
777         register.
778         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
779         lowlevellock.h.
780         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
781         define.
782         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
783         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
784         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
785         lowlevellock.h.
786         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
787         (sem_timedwait): Use __NR_gettimeofday.
788         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
789         lowlevellock.h.
790         (LOCK): Don't define.
791         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
792         lowlevellock.h.
793         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
794         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
795         are waiters.
796         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
797         2007-05-2{3,9} changes.
798         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
799         kernel-features.h and lowlevellock.h.
800         (LOAD_PRIVATE_FUTEX_WAIT): Define.
801         (LOAD_FUTEX_WAIT): Rewritten.
802         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
803         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
804         (__lll_mutex_lock_wait): Rename to ...
805         (__lll_lock_wait): ... this.  %esi is now private argument.
806         Don't compile in for libc.so.
807         (__lll_mutex_timedlock_wait): Rename to ...
808         (__lll_timedlock_wait): ... this.  %esi contains private argument.
809         Don't compile in for libc.so.
810         (__lll_mutex_unlock_wake): Rename to ...
811         (__lll_unlock_wake): ... this.  %esi contains private argument.
812         Don't compile in for libc.so.
813         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
814         kernel-features.h and lowlevellock.h.
815         (LOAD_FUTEX_WAIT): Define.
816         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
817         (__lll_robust_mutex_lock_wait): Rename to ...
818         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
819         Use LOAD_FUTEX_WAIT macro.
820         (__lll_robust_mutex_timedlock_wait): Rename to ...
821         (__lll_robust_timedlock_wait): ... this. %esi argument contains
822         private, use LOAD_FUTEX_WAIT macro.
823         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
824         lowlevellock.h.
825         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
826         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
827         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
828         __lll_lock_wait and __lll_unlock_wake.
829         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
830         Include lowlevellock.h and pthread-errnos.h.
831         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
832         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
833         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
834         pass LLL_SHARED in %esi to both __lll_lock_wait and
835         __lll_unlock_wake.
836         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
837         Include lowlevellock.h and pthread-errnos.h.
838         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
839         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
840         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
841         pass LLL_SHARED in %esi to both __lll_lock_wait and
842         __lll_unlock_wake.
843         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
844         Include lowlevellock.h.
845         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
846         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
847         pass LLL_SHARED in %esi to both __lll_lock_wait and
848         __lll_unlock_wake.
849         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
850         Include lowlevellock.h.
851         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
852         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
853         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
854         and __lll_unlock_wake.
855         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
856         Include lowlevellock.h.
857         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
858         Don't define.
859         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
860         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
861         and __lll_unlock_wake.
862         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
863         Include lowlevellock.h.
864         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
865         Don't define.
866         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
867         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
868         and __lll_unlock_wake.
869         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
870         Include lowlevellock.h.
871         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
872         Don't define.
873         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
874         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
875         and __lll_unlock_wake.
876         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
877         Include lowlevellock.h.
878         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
879         Don't define.
880         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
881         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
882         and __lll_unlock_wake.
883         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
884         Include lowlevellock.h.
885         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
886         Don't define.
887         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
888         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
889         and __lll_unlock_wake.
890         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
891         lowlevellock.h.
892         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
893         define.
894         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
895         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
896         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
897         lowlevellock.h.
898         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
899         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
900         lowlevellock.h.
901         (LOCK): Don't define.
902         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
903         lowlevellock.h.
904         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
905         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
906         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
907         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
908         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
909         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
910         (__lll_lock_wait_private): New function.
911         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
912         it to lll_futex_*wait.  Don't compile in for libc.so.
913         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
914         Remove.
915         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
916         (struct sparc_pthread_barrier): Remove.
917         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
918         struct sparc_pthread_barrier.  Pass
919         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
920         and lll_futex_wait macros.
921         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
922         Remove.
923         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
924         Include sparc pthread_barrier_wait.c instead of generic one.
926 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
928         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
930         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
931         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
932         %ecx.
933         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
934         (pthread_rwlock_timedwrlock): Likewise.
935         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
936         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
938 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
940         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
942 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
944         * tst-locale2.c (useless): Add return statement.
946 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
948         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
949         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
950         * pthread_create.c (start_thread): Likewise.
951         * init.c (sighandler_setxid): Likewise.
952         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
953         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
954         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
955         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
956         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
957         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
958         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
959         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
960         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
961         Likewise.
962         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
963         Likewise.
964         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
965         Likewise.
966         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
967         __rtld_notify): Likewise.
968         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
969         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
970         __pthread_once): Likewise.
971         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
972         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
973         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
974         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
975         (lll_futex_wait): Add private argument, define as wrapper around
976         lll_futex_timed_wait.
977         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
978         use __lll_private_flag macro.
979         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
980         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
981         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
982         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
983         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
984         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
985         (lll_futex_wait): Add private argument, define as wrapper around
986         lll_futex_timed_wait.
987         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
988         use __lll_private_flag macro.
989         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
990         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
991         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
992         Define.
993         (lll_futex_timed_wait, lll_futex_wake): Use it.
994         (lll_private_futex_wait, lll_private_futex_timed_wait,
995         lll_private_futex_wake): Removed.
996         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
997         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
998         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
999         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1000         (lll_futex_wait): Add private argument, define as wrapper around
1001         lll_futex_timed_wait.
1002         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1003         use __lll_private_flag macro.
1004         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1005         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1006         to lll_futex_*.
1007         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1008         (lll_private_futex_wait, lll_private_futex_timed_wait,
1009         lll_private_futex_wake): Removed.
1010         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1011         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1012         (lll_private_futex_wait, lll_private_futex_timed_wait,
1013         lll_private_futex_wake): Removed.
1014         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1015         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1016         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1017         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1018         (lll_futex_wait): Add private argument, define as wrapper around
1019         lll_futex_timed_wait.
1020         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1021         use __lll_private_flag macro.
1022         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1023         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1024         to lll_futex_*.
1025         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1026         Define.
1027         (lll_futex_timed_wait, lll_futex_wake): Use it.
1028         (lll_private_futex_wait, lll_private_futex_timed_wait,
1029         lll_private_futex_wake): Removed.
1031 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1033         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1034         of the structure for sparc32.
1036 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1038         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1040 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1042         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1043         code used when private futexes are assumed.
1044         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1045         Likewise.
1047 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1049         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1050         (__lll_private_flag): Define.
1051         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1052         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1053         __lll_private_flag.
1054         (lll_private_futex_wait, lll_private_futex_timedwait,
1055         lll_private_futex_wake): Define as wrapper around non-_private
1056         macros.
1057         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1058         (__lll_private_flag): Define.
1059         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1060         (lll_private_futex_wait, lll_private_futex_timedwait,
1061         lll_private_futex_wake): Define as wrapper around non-_private
1062         macros.
1064 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1066         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1067         parameter to lll_futex_wait call.
1068         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1070         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1071         Replace lll_futex_wait with lll_private_futex_wait.
1072         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1073         Add LLL_SHARED parameter to lll_futex_wake().
1075         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1076         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1077         lll_private_futex_wake.
1078         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1079         bit from private parm before syscall.
1080         (lll_futex_timed_wait): Likewise.
1081         (lll_futex_wake): Likewise.
1082         (lll_futex_wake_unlock): Likewise.
1083         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1084         (lll_robust_mutex_unlock): Likewise.
1085         (lll_mutex_unlock_force): Likewise.
1086         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1088 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1090         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1091         compilation when unconditionally using private futexes.
1092         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1093         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1094         Likewise.
1095         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1096         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1098 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1100         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1101         Define.
1103 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1105         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1106         kernel-features.h.
1108 2007-05-16  Roland McGrath  <roland@redhat.com>
1110         * init.c (__nptl_initial_report_events): New variable.
1111         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1112         to that.
1114 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1116         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1117         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1119 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1121         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1122         implementation.
1124 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1126         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1127         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1128         * pthread_mutex_timedlock.c: Likewise.
1129         * pthread_mutex_trylock.c: Likewise.
1130         * pthread_mutex_unlock.c: Likewise.
1132 2007-06-17  Andreas Schwab  <schwab@suse.de>
1134         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1135         sections.
1137 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1139         * allocatestack.c (allocate_stack): Make code compile if
1140         __ASSUME_PRIVATE_FUTEX is set.
1142 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1144         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1145         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1146         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1147         (__pthread_rwlock_wrlock): Likewise.
1148         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1149         (pthread_rwlock_timedrdlock): Likewise.
1150         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1151         (pthread_rwlock_timedwrlock): Likewise.
1152         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1153         (__pthread_rwlock_unlock): Likewise.
1155 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1157         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1158         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1159         Split __flags into __flags, __shared, __pad1 and __pad2.
1160         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1161         futexes if they are available.
1162         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1163         in libc-lowlevellock.S allow using private futexes.
1164         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1165         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1166         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1167         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1168         lll_private_futex_timed_wait and lll_private_futex_wake.
1169         (lll_robust_mutex_unlock): Fix typo.
1170         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1171         field in futex command setup.
1172         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1173         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1174         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1175         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1176         if they are available.  Remove clear_once_control.
1177         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1178         futexes if they are available.
1179         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1180         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1181         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1182         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1183         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1184         Wake only when there are waiters.
1185         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1186         support.  Indicate that there are waiters.  Remove unnecessary
1187         extra cancellation test.
1188         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1189         left-over duplication of __sem_wait_cleanup.
1191 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1193         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1194         parameter to lll_futex_wait, lll_futex_timed_wait, and
1195         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1196         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1197         lll_private_futex_wake.
1198         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1199         * allocatestack.c: Adjust use of lll_futex_* macros.
1200         * init.c: Likewise.
1201         * lowlevellock.h: Likewise.
1202         * pthread_barrier_wait.c: Likewise.
1203         * pthread_cond_broadcast.c: Likewise.
1204         * pthread_cond_destroy.c: Likewise.
1205         * pthread_cond_signal.c: Likewise.
1206         * pthread_cond_timedwait.c: Likewise.
1207         * pthread_cond_wait.c: Likewise.
1208         * pthread_create.c: Likewise.
1209         * pthread_mutex_lock.c: Likewise.
1210         * pthread_mutex_setprioceiling.c: Likewise.
1211         * pthread_mutex_timedlock.c: Likewise.
1212         * pthread_mutex_unlock.c: Likewise.
1213         * pthread_rwlock_timedrdlock.c: Likewise.
1214         * pthread_rwlock_timedwrlock.c: Likewise.
1215         * pthread_rwlock_unlock.c: Likewise.
1216         * sysdeps/alpha/tls.h: Likewise.
1217         * sysdeps/i386/tls.h: Likewise.
1218         * sysdeps/ia64/tls.h: Likewise.
1219         * sysdeps/powerpc/tls.h: Likewise.
1220         * sysdeps/pthread/aio_misc.h: Likewise.
1221         * sysdeps/pthread/gai_misc.h: Likewise.
1222         * sysdeps/s390/tls.h: Likewise.
1223         * sysdeps/sh/tls.h: Likewise.
1224         * sysdeps/sparc/tls.h: Likewise.
1225         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1226         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1227         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1228         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1229         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1230         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1231         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1232         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1233         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1234         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1235         Likewise.
1236         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1237         * sysdeps/x86_64/tls.h: Likewise.
1239 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1241         * pthread_getattr_np.c: No need to install a cancellation handler,
1242         this is no cancellation point.
1243         * pthread_getschedparam.c: Likewise.
1244         * pthread_setschedparam.c: Likewise.
1245         * pthread_setschedprio.c: Likewise.
1246         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1247         lll_unlock_wake_cb.
1248         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1249         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1250         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1251         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1252         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1253         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1254         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1255         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1256         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1257         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1258         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1259         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1261         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1262         whether there are more than one thread makes no sense here since
1263         we only call the slow path if the locks are taken.
1264         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1266         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1267         COND_NWAITERS_SHIFT.
1268         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1269         COND_CLOCK_BITS.
1270         * pthread_cond_init.c: Likewise.
1271         * pthread_cond_timedwait.c: Likewise.
1272         * pthread_cond_wait.c: Likewise.
1273         * pthread_condattr_getclock.c: Likewise.
1274         * pthread_condattr_setclock.c: Likewise.
1275         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1276         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1278         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1279         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1281 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1283         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1284         unistd.h.
1286         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1287         insn suffix.
1288         (THREAD_GSCOPE_GET_FLAG): Remove.
1289         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1290         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1291         changes.
1292         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1293         (THREAD_GSCOPE_GET_FLAG): Remove.
1294         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1295         instead of THREAD_GSCOPE_GET_FLAG.
1296         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1297         it.
1298         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1299         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1300         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1301         THREAD_GSCOPE_WAIT): Define.
1302         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1303         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1304         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1305         THREAD_GSCOPE_WAIT): Define.
1306         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1307         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1308         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1309         THREAD_GSCOPE_WAIT): Define.
1310         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1311         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1312         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1313         THREAD_GSCOPE_WAIT): Define.
1315 2007-05-24  Richard Henderson  <rth@redhat.com>
1317         * descr.h (struct pthread): Add header.gscope_flag.
1318         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1319         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1320         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1321         THREAD_GSCOPE_WAIT): Define.
1323 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1325         * init.c: Make it compile with older kernel headers.
1327         * tst-initializers1.c: Show through exit code which test failed.
1329         * pthread_rwlock_init.c: Also initialize __shared field.
1330         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1331         element in rwlock structure into four byte elements.  One of them is
1332         the new __shared element.
1333         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1334         Likewise.
1335         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1336         __shared, adjust names of other padding elements.
1337         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1338         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1339         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1340         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1341         FUTEX_PRIVATE_FLAG.
1342         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1343         futex to use private operations if possible.
1344         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1345         Likewise.
1346         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1347         Likewise.
1348         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1349         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1350         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1351         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1352         Likewise.
1353         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1354         Likewise.
1355         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1356         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1358 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1360         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1361         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1362         * pthread_rwlock_timedrdlock.c: Likewise.
1363         * pthread_rwlock_tryrdlock.c: Likewise.
1365         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1366         optimization.
1368         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1369         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1370         duplication of __sem_wait_cleanup.
1372         * allocatestack.c: Revert last change.
1373         * init.c: Likewise.
1374         * sysdeps/i386/tls.h: Likewise.
1375         * sysdeps/x86_64/tls.h: Likewise.
1376         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1377         header structure.
1378         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1380         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1381         Add private field.
1382         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1383         * pthread_barrier_init.c: Set private flag if pshared and private
1384         futexes are supported.
1385         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1386         private field in futex command setup.
1387         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1389 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1391         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1392         support.
1393         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1394         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1395         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1396         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1397         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1399         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1400         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1401         fields in the structure.
1402         (__old_sem_init): New function.
1403         * sem_open.c: Initialize all fields of the structure.
1404         * sem_getvalue.c: Adjust for renamed element.
1405         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1406         (gen-as-const-headers): Add structsem.sym.
1407         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1408         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1409         struct new_sem.  Add struct old_sem.
1410         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1411         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1412         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1413         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1414         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1415         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1416         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1417         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1418         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1419         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1420         * tst-sem10.c: New file.
1421         * tst-sem11.c: New file.
1422         * tst-sem12.c: New file.
1423         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1424         of struct sem.
1426 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1427             Jakub Jelinek  <jakub@redhat.com>
1429         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1430         Move __pthread_enable_asynccancel right before futex syscall.
1431         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1432         Likewise.
1434 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1436         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1437         THREAD_COPY_PRIVATE_FUTEX): Define.
1438         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1439         THREAD_COPY_PRIVATE_FUTEX): Define.
1440         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1441         * init.c (__pthread_initialize_minimal_internal): Use
1442         THREAD_SET_PRIVATE_FUTEX.
1444         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1445         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1446         THREAD_GSCOPE_FLAG_WAIT): Define.
1447         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1448         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1449         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1450         PTR_DEMANGLE.
1451         (THREAD_GSCOPE_GET_FLAG): Define.
1452         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1453         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1454         instead of ->header.gscope_flag directly.
1456 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1458         * init.c (__pthread_initialize_minimal_internal): Check whether
1459         private futexes are available.
1460         * allocatestack.c (allocate_stack): Copy private_futex field from
1461         current thread into the new stack.
1462         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1463         futexes if they are available.
1464         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1465         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1466         in libc-lowlevellock.S allow using private futexes.
1467         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1468         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1469         FUTEX_PRIVATE_FLAG.
1470         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1471         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1472         if they are available.
1473         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1474         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1475         * sysdeps/i386/tcb-offsets.sym: Likewise.
1476         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1477         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1479 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1481         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1482         Remove ptr_wait_lookup_done again.
1483         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1484         (__pthread_initialize_minimal_internal): Initialize
1485         _dl_wait_lookup_done pointer in _rtld_global directly.
1486         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1487         Remove code to code _dl_wait_lookup_done.
1488         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1489         encrypted for now.
1491 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1493         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1494         pthread_mutex_init failed with ENOTSUP.
1496 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1498         * allocatestack.c (__wait_lookup_done): New function.
1499         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1500         Add ptr_wait_lookup_done.
1501         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1502         * pthreadP.h: Declare __wait_lookup_done.
1503         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1504         Define macros to implement reference handling of global scope.
1505         * sysdeps/x86_64/tls.h: Likewise.
1506         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1507         Initialize GL(dl_wait_lookup_done).
1509 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1511         [BZ #4512]
1512         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1513         is detected.
1514         * pthread_mutex_timedlock.c: Likewise.
1515         * pthread_mutex_trylock.c: Likewise.
1516         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1518         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1519         * tst-robust9.c: New file.
1520         * tst-robustpi9.c: New file.
1522         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1523         unnecessary extra cancellation test.
1525 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1527         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1528         extra cancellation test.
1529         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1531 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1533         * descr.h (struct pthread): Rearrange members to fill hole in
1534         64-bit layout.
1536         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1537         (__pthread_setaffinity_new): If syscall was successful and
1538         RESET_VGETCPU_CACHE is defined, use it before returning.
1539         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1541 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1543         [BZ #4455]
1544         * tst-align2.c: Include stackinfo.h.
1545         * tst-getpid1.c: Likewise.
1547 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1549         [BZ #4455]
1550         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1551         * tst-getpid1.c (do_test): Likewise.
1553         [BZ #4456]
1554         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1555         (allocate_stack): Likewise.
1557 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1559         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1560         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1561         (__lll_robust_timedlock_wait): Likewise.
1562         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1564 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1566         [BZ #4465]
1567         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1568         * tst-cancel4.c (tf_fdatasync): New test.
1570 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1572         [BZ #4392]
1573         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1574         check mutexes like normal mutexes.
1576         [BZ #4306]
1577         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1578         Initialize the whole sigevent structure to appease valgrind.
1580 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1582         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1583         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1585 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1587         * tst-locale1.c: Avoid warnings.
1588         * tst-locale2.c: Likewise.
1590 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1592         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1593         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1595 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1597         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1598         __extern_always_inline where appropriate.
1599         * sysdeps/pthread/pthread.h: Likewise.
1601 2007-03-13  Richard Henderson  <rth@redhat.com>
1603         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1604         separate cfi regions for the two subsections.
1606 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1608         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1609         new thread, don't just decrement it.
1610         Patch by Suzuki K P <suzuki@in.ibm.com>.
1612 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1614         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1615         PTHFCT_CALL definition.
1617 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1619         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1620         available, don't use it.
1622 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1624         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1625         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1626         call into the kernel to delay.
1628 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1630         * tst-initializers1.c: We want to test the initializers as seen
1631         outside of libc, so undefined _LIBC.
1633         * pthread_join.c (cleanup): Avoid warning.
1635 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1637         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1638         (__lll_timedwait_tid): Add unwind info.
1640         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1641         function table, mangle the pointers.
1642         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1643         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1644         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1645         demangle pointers before use.
1646         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1647         demangle pointer.
1648         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1649         * sysdeps/pthread/setxid.h: Likewise.
1651 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1653         * tst-rwlock7.c: Show some more information in case of correct
1654         behavior.
1656 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1658         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1659         (lll_futex_timed_wait): Undo part of last change, don't negate
1660         return value.
1662 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1664         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1665         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1667 2006-12-28  David S. Miller  <davem@davemloft.net>
1669         * shlib-versions: Fix sparc64 linux target specification.
1671 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1673         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1674         Adjust include path for pthread_barrier_wait.c move.
1676 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1678         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1679         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1681 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1683         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1684         6 argument cancellable syscalls.
1685         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1686         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1687         6 argument cancellable syscalls.
1688         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1690 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1692         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1693         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1695 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1697         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1698         __sync_lock_release instead of __sync_lock_release_si.
1700 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1702         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1703         Define.
1704         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1705         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1706         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1707         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1708         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1709         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1710         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1711         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1712         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1713         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1714         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1716 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1718         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1719         * pthread_barrier_wait.c: ...here.
1720         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1721         * pthread_cond_broadcast.c: ...here.
1722         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1723         * pthread_cond_signal.c: ...here.
1724         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1725         * pthread_cond_timedwait.c: ...here.
1726         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1727         * pthread_cond_wait.c: ...here.
1728         * sysdeps/pthread/pthread_once.c: Move to...
1729         * pthread_once.c: ...here.
1730         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1731         * pthread_rwlock_rdlock.c: ...here.
1732         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1733         * pthread_rwlock_timedrdlock.c: ...here.
1734         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1735         * pthread_rwlock_timedwrlock.c: ...here.
1736         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1737         * pthread_rwlock_unlock.c: ...here.
1738         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1739         * pthread_rwlock_wrlock.c: ...here.
1740         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1741         * pthread_spin_destroy.c: ...here.
1742         * sysdeps/pthread/pthread_spin_init.c: Move to...
1743         * pthread_spin_init.c: ...here.
1744         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1745         * pthread_spin_unlock.c: ...here.
1746         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1747         * pthread_getcpuclockid.c: ...here.
1749         * init.c: USE_TLS support is now always enabled.
1750         * tst-tls5.h: Likewise.
1751         * sysdeps/alpha/tls.h: Likewise.
1752         * sysdeps/i386/tls.h: Likewise.
1753         * sysdeps/ia64/tls.h: Likewise.
1754         * sysdeps/powerpc/tls.h: Likewise.
1755         * sysdeps/s390/tls.h: Likewise.
1756         * sysdeps/sh/tls.h: Likewise.
1757         * sysdeps/sparc/tls.h: Likewise.
1758         * sysdeps/x86_64/tls.h: Likewise.
1760 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1762         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1763         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1764         failed.
1766         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1767         Define to THREAD_SELF->header.multiple_threads.
1768         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1769         Likewise.
1770         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1771         Likewise.
1772         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1773         (SINGLE_THREAD_P): Likewise.
1774         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1775         (SINGLE_THREAD_P): Likewise.
1776         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1777         (SINGLE_THREAD_P): Likewise.
1778         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1779         (SINGLE_THREAD_P): Likewise.
1780         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
1781         Likewise.
1782         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1783         (SINGLE_THREAD_P): Likewise.
1784         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1785         (SINGLE_THREAD_P): Likewise.
1786         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
1787         Likewise.
1789 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
1791         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
1792         by default rather than 2_3_3.
1794 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
1796         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1797         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
1798         atomic_* instead of catomic_* macros.
1800 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
1802         [BZ #3285]
1803         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
1804         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1805         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1806         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1807         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1808         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
1809         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1810         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1811         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1812         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
1813         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1814         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1815         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1817 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
1819         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
1820         cancelable syscalls with six parameters.
1822         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
1823         operations instead of atomic_*.
1825 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
1827         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
1829 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
1831         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
1832         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
1833         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
1834         New file.
1835         * pthread_attr_setstack.c: Allow overwriting the version number of the
1836         new symbol.
1837         * pthread_attr_setstacksize.c: Likewise.
1838         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
1839         it.
1840         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
1841         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
1843 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
1845         [BZ #3251]
1846         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
1847         Patch by Petr Baudis.
1849 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
1851         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
1853         * tst-cancel2.c (tf): Loop as long as something was written.
1855 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1857         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
1858         mutexes wake all mutexes.
1859         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
1860         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1861         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1863 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
1865         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
1866         to guarantee the thread is always canceled.
1868 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
1870         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
1871         Include stdlib.h.
1872         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
1873         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
1874         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1875         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1876         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1878 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
1880         [BZ #3123]
1881         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
1882         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1883         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1884         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1885         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1886         * Makefile (tests): Add tst-cond22.
1887         * tst-cond22.c: New file.
1889 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
1891         [BZ #3124]
1892         * descr.h (struct pthread): Add parent_cancelhandling.
1893         * sysdeps/pthread/createthread.c (create_thread): Pass parent
1894         cancelhandling value to child.
1895         * pthread_create.c (start_thread): If parent thread was canceled
1896         reset the SIGCANCEL mask.
1897         * Makefile (tests): Add tst-cancel25.
1898         * tst-cancel25.c: New file.
1900 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
1901             Ulrich Drepper  <drepper@redhat.com>
1903         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
1904         counterp if it is already zero.
1905         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
1907 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
1908             Roland McGrath  <roland@redhat.com>
1910         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
1911         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1912         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
1913         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1914         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1915         lll_robust_mutex_timedlock, lll_mutex_unlock,
1916         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1917         Add _L_*_ symbols around the subsection.
1918         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
1919         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
1921 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
1922             Roland McGrath  <roland@redhat.com>
1924         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1925         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
1926         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
1927         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
1928         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
1929         lll_robust_mutex_timedlock, lll_mutex_unlock,
1930         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
1931         Add _L_*_ symbols around the subsection.
1932         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
1933         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
1935 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
1937         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
1938         change because it can disturb too much existing code.  If real hard
1939         reader preference is needed we'll introduce another type.
1940         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1941         (pthread_rwlock_timedwrlock): Likewise.
1942         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1943         Likewise.
1945 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
1947         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
1948         reader preference.
1949         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1950         (pthread_rwlock_timedwrlock): Likewise.
1951         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
1952         Likewise.
1954 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
1956         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
1957         Only define ifdef SHARED.
1959 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
1961         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
1962         (free_stacks): ...here.
1963         (__free_stack_cache): New function.
1964         * pthreadP.h: Declare __free_stack_cache.
1965         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
1966         ptr_freeres.
1967         * init.c (pthread_functions): Initialize ptr_freeres.
1968         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
1969         New freeres function.
1971 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
1973         [BZ #3018]
1974         * Makefile (extra-objs): Add modules to extra-test-objs instead.
1976 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
1978         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1979         _XOPEN_REALTIME_THREADS.
1981 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
1983         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
1984         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
1985         HAVE_CLOCK_GETTIME_VSYSCALL.
1986         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
1988 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
1990         * sysdeps/unix/sysv/linux/bits/posix_opt.h
1991         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
1992         * descr.h (struct priority_protection_data): New type.
1993         (struct pthread): Add tpp field.
1994         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
1995         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
1996         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
1997         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
1998         TPP mutexes.
1999         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2000         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2001         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2002         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2003         * tpp.c: New file.
2004         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2005         boosted by TPP.
2006         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2007         * pthread_mutexattr_getprioceiling.c
2008         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2009         in the SCHED_FIFO priority range.
2010         * pthread_mutexattr_setprioceiling.c
2011         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2012         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2013         if mutex is not TPP.  Ceiling is now in __data.__lock.
2014         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2015         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2016         is now in __data.__lock.  Add locking.
2017         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2018         * Makefile (libpthread-routines): Add tpp.
2019         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2020         * tst-tpp.h: New file.
2021         * tst-mutexpp1.c: New file.
2022         * tst-mutexpp6.c: New file.
2023         * tst-mutexpp10.c: New file.
2024         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2025         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2027 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2029         [BZ #2843]
2030         * pthread_join.c (pthread_join): Account for self being canceled
2031         when checking for deadlocks.
2032         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2033         (tf1): Don't print anything after pthread_join returns, this would be
2034         another cancellation point.
2035         (tf2): Likewise.
2036         * tst-join6.c: New file.
2037         * Makefile (tests): Add tst-join6.
2039 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2041         [BZ #2892]
2042         * pthread_setspecific.c (__pthread_setspecific): Check
2043         out-of-range index before checking for unused key.
2045         * sysdeps/pthread/gai_misc.h: New file.
2047 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2049         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2050         file.  Don't use sysctl.
2051         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2052         overwrite the file if this is likely not true.
2054 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2056         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2057         * Makefile (tests): Add tst-getpid3.
2058         * tst-getpid3.c: New file.
2060 2006-07-30  Roland McGrath  <roland@redhat.com>
2062         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2064         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2065         (pause_not_cancel): New macro.
2066         (nanosleep_not_cancel): New macro.
2067         (sigsuspend_not_cancel): New macro.
2068         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2069         nanosleep_not_cancel macro from <not-cancel.h>.
2070         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2071         macro from <not-cancel.h>.
2073 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2074             Jakub Jelinek  <jakub@redhat.com>
2076         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2077         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2078         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2079         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2080         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2081         * pthread_mutex_lock.c: Likewise.
2082         * pthread_mutex_timedlock.c: Likewise.
2083         * pthread_mutex_trylock.c: Likewise.
2084         * pthread_mutex_unlock.c: Likewise.
2085         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2086         all mutexes.
2087         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2089         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2090         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2091         pthread-pi-defines.sym.
2092         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2093         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2094         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2095         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2096         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2097         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2098         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2099         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2100         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2101         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2102         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2103         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2104         * tst-mutex2.c: Likewise.
2105         * tst-mutex3.c: Likewise.
2106         * tst-mutex4.c: Likewise.
2107         * tst-mutex5.c: Likewise.
2108         * tst-mutex6.c: Likewise.
2109         * tst-mutex7.c: Likewise.
2110         * tst-mutex7a.c: Likewise.
2111         * tst-mutex8.c: Likewise.
2112         * tst-mutex9.c: Likewise.
2113         * tst-robust1.c: Likewise.
2114         * tst-robust7.c: Likewise.
2115         * tst-robust8.c: Likewise.
2116         * tst-mutexpi1.c: New file.
2117         * tst-mutexpi2.c: New file.
2118         * tst-mutexpi3.c: New file.
2119         * tst-mutexpi4.c: New file.
2120         * tst-mutexpi5.c: New file.
2121         * tst-mutexpi6.c: New file.
2122         * tst-mutexpi7.c: New file.
2123         * tst-mutexpi7a.c: New file.
2124         * tst-mutexpi8.c: New file.
2125         * tst-mutexpi9.c: New file.
2126         * tst-robust1.c: New file.
2127         * tst-robust2.c: New file.
2128         * tst-robust3.c: New file.
2129         * tst-robust4.c: New file.
2130         * tst-robust5.c: New file.
2131         * tst-robust6.c: New file.
2132         * tst-robust7.c: New file.
2133         * tst-robust8.c: New file.
2134         * Makefile (tests): Add the new tests.
2136         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2137         * pthread_mutex_destroy.c: Remove unneeded label.
2139 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2141         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2142         computations to compile time.
2144 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2146         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2148 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2150         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2152 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2154         * pthread_key_create.c (__pthread_key_create): Do away with
2155         __pthread_keys_lock.
2157         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2158         (__kernel_cpumask_size): Mark as hidden.
2159         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2161         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2162         * semaphoreP.h (__sem_mappings_lock): Likewise.
2164 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2166         * pthread_atfork.c: Mark __dso_handle as hidden.
2168 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2170         [BZ #2644]
2171         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2172         the reload problem.  Change the one path in pthread_cancel_init
2173         which causes the problem.  Force gcc to reload.  Simplify callers.
2174         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2175         (_Unwind_GetBSP): Undo last patch.
2177 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2179         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2180         function pointer is reloaded after pthread_cancel_init calls.
2182         [BZ #2644]
2183         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2184         pointers are reloaded after pthread_cancel_init calls.
2186 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2188         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2189         __always_inline.
2191 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2193         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2194         Allocate new object which is passed to timer_sigev_thread so that
2195         the timer can be deleted before the new thread is scheduled.
2197 2006-04-26  Roland McGrath  <roland@redhat.com>
2199         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2201 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2203         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2204         suffix for conditional jumps.
2205         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2206         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2207         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2208         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2209         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2210         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2212         * init.c (sigcancel_handler): Compare with correct PID even if the
2213         thread is in the middle of a fork call.
2214         (sighandler_setxid): Likewise.
2215         Reported by Suzuki K P <suzuki@in.ibm.com> .
2217 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2219         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2221 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2223         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2224         fails [Coverity CID 105].
2226 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2228         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2230 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2232         [BZ #2505]
2233         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2234         Define __lll_rel_instr using lwsync.
2236 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2238         * allocatestack.c (allocate_stack): Always initialize robust_head.
2239         * descr.h: Define struct robust_list_head.
2240         (struct pthread): Use robust_list_head in robust mutex list definition.
2241         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2242         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2243         (__pthread_initialize_minimal_internal): Register robust_list with
2244         the kernel.
2245         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2246         Declare __set_robust_list_avail.
2247         * pthread_create.c (start_thread): Register robust_list of new thread.
2248         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2249         waiters.
2250         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2251         number of users, it's unreliable.
2252         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2253         set_robust_list syscall is available.
2254         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2255         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2256         Set robust_head.list_op_pending before trying to lock a robust mutex.
2257         * pthread_mutex_timedlock.c: Likewise.
2258         * pthread_mutex_trylock.c: Likewise.
2259         * pthread_mutex_unlock.c: Likewise for unlocking.
2260         * Makefile (tests): Add tst-robust8.
2261         * tst-robust8.c: New file.
2263 2006-03-08  Andreas Schwab  <schwab@suse.de>
2265         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2266         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2268 2006-03-05  Roland McGrath  <roland@redhat.com>
2270         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2271         and $config_os doesn't match *linux*.
2273 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2275         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2276         Use __syscall_error.
2277         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2278         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2279         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2280         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2281         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2282         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2284 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2286         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2288 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2290         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2291         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2292         mutex.
2293         (__lll_robust_timedlock_wait): Likewise.
2294         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2295         (__lll_robust_lock_wait): Likewise.
2296         (__lll_robust_timedlock_wait): Likewise.
2297         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2298         (__lll_robust_lock_wait): Likewise.
2299         (__lll_robust_timedlock_wait): Likewise.
2301 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2303         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2304         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2305         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2306         lll_robust_mutex_unlock): Define.
2307         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2309 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2311         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2312         instead of <clone.S>.
2314 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2316         * Makefile (libpthread-routines): Add
2317         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2318         and pthread_mutex_[sg]etprioceiling.
2319         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2320         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2321         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2322         pthread_mutex_setprioceiling.
2323         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2324         PTHREAD_PRIO_PROTECT): New enum values.
2325         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2326         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2327         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2328         prototypes.
2329         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2330         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2331         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2332         Define.
2333         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2334         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2335         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2336         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2337         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2338         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2339         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2340         protocol mutexes.
2341         * pthread_mutex_getprioceiling.c: New file.
2342         * pthread_mutex_setprioceiling.c: New file.
2343         * pthread_mutexattr_getprioceiling.c: New file.
2344         * pthread_mutexattr_setprioceiling.c: New file.
2345         * pthread_mutexattr_getprotocol.c: New file.
2346         * pthread_mutexattr_setprotocol.c: New file.
2348 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2350         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2352 2006-02-27  Roland McGrath  <roland@redhat.com>
2354         * sysdeps/pthread/Subdirs: List nptl here too.
2355         * configure (libc_add_on_canonical): New variable.
2357         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2359         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2360         self to get main source tree's file.
2361         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2362         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2363         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2364         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2365         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2366         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2367         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2368         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2369         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2370         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2371         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2372         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2373         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2375         * Makefile: Use $(sysdirs) in vpath directive.
2377         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2378         (CPPFLAGS-timer_routines.c): Likewise.
2380         * Makeconfig (includes): Variable removed.
2382 2006-02-26  Roland McGrath  <roland@redhat.com>
2384         * sysdeps/generic/pt-raise.c: Moved to ...
2385         * pt-raise.c: ... here.
2386         * sysdeps/generic/lowlevellock.h: Moved to ...
2387         * lowlevellock.h: ... here.
2389 2006-02-23  Roland McGrath  <roland@redhat.com>
2391         * descr.h (struct pthread): Add final member `end_padding'.
2392         (PTHREAD_STRUCT_END_PADDING): Use it.
2394 2006-02-20  Roland McGrath  <roland@redhat.com>
2396         * sysdeps/mips: Directory removed, saved in ports repository.
2397         * sysdeps/unix/sysv/linux/mips: Likewise.
2399 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2401         * tst-robust1.c: Add second mutex to check that the mutex list is
2402         handled correctly.
2404 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2406         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2407         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2408         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2409         lll_robust_mutex_unlock): New macros.
2410         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2411         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2412         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2413         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2414         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2416 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2418         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2419         definitions.
2420         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2422 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2424         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2425         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2426         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2427         (lll_robust_mutex_unlock): Likewise.
2429 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2431         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2432         Set robust_list.__next rather than robust_list.
2433         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2434         (__pthread_list_t): New typedef.
2435         (pthread_mutex_t): Replace __next and __prev fields with __list.
2436         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2437         (__pthread_list_t): New typedef.
2438         (pthread_mutex_t): Replace __next and __prev fields with __list.
2439         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2440         (__pthread_list_t, __pthread_slist_t): New typedefs.
2441         (pthread_mutex_t): Replace __next and __prev fields with __list.
2442         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2443         (__pthread_list_t, __pthread_slist_t): New typedefs.
2444         (pthread_mutex_t): Replace __next and __prev fields with __list.
2445         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2446         (__pthread_list_t, __pthread_slist_t): New typedefs.
2447         (pthread_mutex_t): Replace __next and __prev fields with __list.
2448         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2449         (__pthread_slist_t): New typedef.
2450         (pthread_mutex_t): Replace __next field with __list.
2452 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2454         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2455         PTHREAD_MUTEX_OWNERDEAD.
2456         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2457         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2458         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2459         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2460         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2461         to PTHREAD_MUTEX_INCONSISTENT.
2462         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2463         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2464         * pthread_mutex_trylock.c: Likewise.
2465         * pthread_mutex_timedlock.c: Likewise.
2466         * pthread_mutex_unlock.c: Likewise.
2467         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2468         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2469         lowlevelrobustlock.sym.
2470         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2471         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2472         definitions.
2473         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2474         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2475         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2476         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2477         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2479 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2481         * allocatestack.c (allocate_stack): Initialize robust_list.
2482         * init.c (__pthread_initialize_minimal_internal): Likewise.
2483         * descr.h (struct xid_command): Pretty printing.
2484         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2485         robust_list.  Adjust macros.
2486         * pthread_create.c (start_thread): Adjust robust_list handling.
2487         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2488         but the owner for all robust mutex types.
2489         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2490         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2491         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2492         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2494         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2495         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2497 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2499         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2500         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2502 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2504         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2505         Return status.
2506         (lll_futex_timed_wait): Define.
2508 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2510         * tst-cancel4.c: Test ppoll.
2512 2006-01-18  Andreas Jaeger  <aj@suse.de>
2514         [BZ #2167]
2515         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2516         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2517         by Jim Gifford <patches@jg555.com>.
2519 2006-01-13  Richard Henderson  <rth@redhat.com>
2521         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2523 2006-01-10  Roland McGrath  <roland@redhat.com>
2525         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2526         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2527         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2528         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2529         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2530         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2531         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2532         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2533         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2534         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2536 2006-01-09  Roland McGrath  <roland@redhat.com>
2538         * tst-initializers1-c89.c: New file.
2539         * tst-initializers1-c99.c: New file.
2540         * tst-initializers1-gnu89.c: New file.
2541         * tst-initializers1-gnu99.c: New file.
2542         * Makefile (tests): Add them.
2543         (CFLAGS-tst-initializers1-c89.c): New variable.
2544         (CFLAGS-tst-initializers1-c99.c): New variable.
2545         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2546         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2548         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2549         Use __extension__ on anonymous union definition.
2550         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2551         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2552         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2553         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2554         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2556 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2558         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2559         Don't give the union a name because it changes the mangled name.
2560         Instead name the struct for __data.
2561         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2562         Likewise.
2563         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2564         Likewise.
2566 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2568         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2569         stack bias to mc_ftp field.
2571 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2573         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2574         being too clever and reloading the futex value where it shouldn't.
2576 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2578         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2579         correct type.
2581 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2583         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2584         Add cfi directives.
2586 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2588         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2589         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2590         rename in tcbhead_t.
2592         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2593         Don't give the union a name because it changes the mangled name.
2594         Instead name the struct for __data.
2595         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2596         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2597         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2598         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2599         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2600         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2602 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2604         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2605         Return status.
2606         (lll_futex_timed_wait): Define.
2607         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2608         * sysdeps/pthread/aio_misc.h: New file.
2610 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2612         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2614 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2616         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2617         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2618         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2620 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2622         * tst-cancel24.cc: Use C headers instead of C++ headers.
2624 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2626         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2627         sparc-linux configured glibc.
2628         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2629         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2630         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2631         atomic_compare_and_exchange_val_24_acq instead of
2632         atomic_compare_and_exchange_val_acq.
2633         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2634         instead of atomic_exchange_rel.
2635         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2636         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2637         file.
2638         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2639         file.
2640         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2641         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2642         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2643         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2644         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2645         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2646         New file.
2647         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2648         New file.
2649         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2650         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2651         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2652         file.
2653         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2654         file.
2655         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2657 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2659         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2660         mutex initializers.
2662 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2664         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2665         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2666         THREAD_COPY_POINTER_GUARD): Define.
2667         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2668         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2670 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2672         * version.c: Update copyright year.
2674 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2676         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2677         .eh_frame section, use cfi_* directives.
2678         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2680 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2682         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2683         now.
2685 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2687         * sysdeps/pthread/sigaction.c: Removed.
2688         * sigaction.c: New file.
2689         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2691 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2693         * Makefile (tests): Add tst-signal7.
2694         * tst-signal7.c: New file.
2696 2005-12-27  Roland McGrath  <roland@redhat.com>
2698         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2699         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2700         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2701         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2702         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2703         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2704         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2705         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2706         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2707         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2708         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2710 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2712         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2713         and __prev field to pthread_mutex_t.
2714         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2715         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2716         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2717         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2718         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2719         to pthread_mutex_t.
2721 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2723         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2724         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2725         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2726         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2727         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2728         and PTHREAD_MUTEXATTR_FLAG_BITS.
2729         * descr.h (struct pthread): Add robust_list field and define
2730         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2731         * pthread_mutexattr_getrobust.c: New file.
2732         * pthread_mutexattr_setrobust.c: New file.
2733         * pthread_mutex_consistent.c: New file.
2734         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2735         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2736         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2737         Adjust pthread_mutex_t initializers.
2738         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2739         field to pthread_mutex_t.
2740         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2741         and __prev field to pthread_mutex_t.
2742         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2743         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2744         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2745         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2746         * pthread_mutexattr_gettype.c: Likewise.
2747         * pthread_mutexattr_setpshared.c: Likewise.
2748         * pthread_mutexattr_settype.c: Likewise.
2749         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2750         Initialize mutex kind according to robust flag.
2751         * pthread_mutex_lock.c: Implement local robust mutex.
2752         * pthread_mutex_timedlock.c: Likewise.
2753         * pthread_mutex_trylock.c: Likewise.
2754         * pthread_mutex_unlock.c: Likewise.
2755         * pthread_create.c (start_thread): Mark robust mutexes which remained
2756         locked as dead.
2757         * tst-robust1.c: New file.
2758         * tst-robust2.c: New file.
2759         * tst-robust3.c: New file.
2760         * tst-robust4.c: New file.
2761         * tst-robust5.c: New file.
2762         * tst-robust6.c: New file.
2763         * tst-robust7.c: New file.
2764         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
2765         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2766         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
2767         tst-robust5, tst-robust6, and tst-robust7.
2769         * tst-typesizes.c: New file.
2770         * Makefile (tests): Add tst-typesizes.
2772         * tst-once3.c: More debug output.
2774 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
2776         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
2777         missing after last change.
2779         * version.c: Update copyright year.
2781 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
2783         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
2784         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
2785         * pthread_mutex_trylock.c: Likewise.
2786         * pthread_mutex_timedlock.c: Likewise.
2787         * pthread_mutex_unlock.c: Likewise.
2789 2005-12-22  Roland McGrath  <roland@redhat.com>
2791         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
2792         so that #include_next's search location is not reset to the -I..
2793         directory where <nptl/...> can be found.
2795 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
2797         [BZ #1913]
2798         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2799         Fix unwind info.  Remove useless branch prediction prefix.
2800         * tst-cancel24.cc: New file.
2801         * Makefile: Add rules to build and run tst-cancel24.
2803 2005-12-21  Roland McGrath  <roland@redhat.com>
2805         * libc-cancellation.c: Use <> rather than "" #includes.
2806         * pt-cleanup.c: Likewise.
2807         * pthread_create.c: Likewise.
2808         * pthread_join.c: Likewise.
2809         * pthread_timedjoin.c: Likewise.
2810         * pthread_tryjoin.c: Likewise.
2811         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
2812         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2813         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2814         * unwind.c: Likewise.
2816 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2818         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
2819         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
2820         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2821         THREAD_COPY_POINTER_GUARD): Define.
2823 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
2825         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
2826         rather than one.
2827         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2828         THREAD_COPY_POINTER_GUARD): Define.
2829         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
2830         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
2831         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2832         THREAD_COPY_POINTER_GUARD): Define.
2833         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
2834         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
2835         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
2836         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
2837         Use PTR_DEMANGLE for B0 if defined.
2839 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
2841         * pthread_create.c (__pthread_create_2_1): Use
2842         THREAD_COPY_POINTER_GUARD if available.
2843         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
2844         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2845         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
2846         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
2847         * sysdeps/x86_64/tls.h: Likewise.
2849 2005-12-15  Roland McGrath  <roland@redhat.com>
2851         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
2853 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
2855         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
2856         sysdeps/generic.
2857         * errno-loc.c: New file.
2859 2005-12-12  Roland McGrath  <roland@redhat.com>
2861         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
2862         adjustments before choosing stack size.  Update minimum stack size
2863         calculation to match allocate_stack change.
2865 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
2867         * allocatestack.c (allocate_stack): Don't demand that there is an
2868         additional full page available on the stack beside guard, TLS, the
2869         minimum stack.
2871 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
2873         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2874         (__cleanup_fct_attribute): Use __regparm__ not regparm.
2876         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
2877         compiling 32-bit code we must define __cleanup_fct_attribute.
2879 005-11-24  Jakub Jelinek  <jakub@redhat.com>
2881         [BZ #1920]
2882         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
2883         __attribute__ instead of __attribute.
2884         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2885         (__cleanup_fct_attribute): Likewise.
2887 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
2889         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
2890         a write barrier before writing libgcc_s_getcfa.
2892 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
2894         * sysdeps/unix/sysv/linux/configure: Removed.
2896 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
2898         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
2899         optional init_array/fini_array support.
2901 2005-10-24  Roland McGrath  <roland@redhat.com>
2903         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
2904         versioned_symbol use.
2906 2005-10-16  Roland McGrath  <roland@redhat.com>
2908         * init.c (__pthread_initialize_minimal_internal): Even when using a
2909         compile-time default stack size, apply the minimum that allocate_stack
2910         will require, and round up to page size.
2912 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
2914         * Makefile ($(test-modules)): Remove static pattern rule.
2916 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2917             Ulrich Drepper  <drepper@redhat.com>
2919         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
2920         alignment in callback function.
2921         * Makefile: Add rules to build and run tst-align3.
2922         * tst-align3.c: New file.
2924 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
2926         * allocatestack.c (setxid_signal_thread): Add
2927         INTERNAL_SYSCALL_DECL (err).
2929 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
2931         * allocatestack.c (setxid_signal_thread): Need to use
2932         atomic_compare_and_exchange_bool_acq.
2934 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
2935             Jakub Jelinek  <jakub@redhat.com>
2937         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
2938         CANCEL_RESTMASK.
2939         (struct pthread): Move specific_used field to avoid padding.
2940         Add setxid_futex field.
2941         * init.c (sighandler_setxid): Reset setxid flag and release the
2942         setxid futex.
2943         * allocatestack.c (setxid_signal_thread): New function.  Broken
2944         out of the bodies of the two loops in __nptl_setxid.  For undetached
2945         threads check whether they are exiting and if yes, don't send a signal.
2946         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
2947         * pthread_create.c (start_thread): For undetached threads, check
2948         whether setxid bit is set.  If yes, wait until signal has been
2949         processed.
2951         * allocatestack.c (STACK_VARIABLES): Initialize them.
2952         * pthread_create.c (__pthread_create_2_1): Initialize pd.
2954 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
2956         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
2957         waiters, awake all waiters on the associated mutex.
2959 2005-09-22  Roland McGrath  <roland@redhat.com>
2961         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
2962         ../sysdeps/x86_64/hp-timing.h).
2964 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
2966         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
2967         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2968         (lll_futex_wake_unlock): Define.
2969         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
2970         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2971         (lll_futex_wake_unlock): Define.
2972         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
2973         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2974         (lll_futex_wake_unlock): Define.
2975         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
2976         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2977         (lll_futex_wake_unlock): Define.
2978         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
2979         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2980         (lll_futex_wake_unlock): Define.
2981         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
2982         lll_futex_wake_unlock.
2983         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2984         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2985         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2986         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2987         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
2988         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
2990 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2992         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2993         Fix typo in register name.
2995 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
2997         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2998         Use __sigfillset.  Document that sigfillset does the right thing wrt
2999         to SIGSETXID.
3001 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3003         [BZ #1102]
3004         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3005         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3006         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3007         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3008         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3009         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3010         in the structure.
3011         * Makefile (tests): Add tst-initializers1.
3012         (CFLAGS-tst-initializers1.c): Set.
3013         * tst-initializers1.c: New test.
3015 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3017         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3018         Make sure __flags are located at offset 48 from the start of the
3019         structure.
3021 2005-07-02  Roland McGrath  <roland@redhat.com>
3023         * Makeconfig: Comment fix.
3025 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3027         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3028         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3029         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3030         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3031         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3032         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3033         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3034         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3035         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3036         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3038 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3040         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3041         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3042         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3043         fields.
3044         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3045         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3046         field.  Put in sysinfo field unconditionally.
3047         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3048         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3049         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3050         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3051         fields.
3052         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3053         * pthread_create.c (__pthread_create_2_1): Use
3054         THREAD_COPY_STACK_GUARD macro.
3055         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3056         tests.
3057         * tst-stackguard1.c: New file.
3058         * tst-stackguard1-static.c: New file.
3060 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3062         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3063         Invoke CGOTSETUP and CGOTRESTORE.
3064         (CGOTSETUP, CGOTRESTORE): Define.
3066 2005-05-29  Richard Henderson  <rth@redhat.com>
3068         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3069         (tf_write, tf_writev): Use it.
3070         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3071         the system minimum.
3073 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3075         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3076         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3077         __librt_*_asynccancel@local.
3079 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3081         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3082         all occurrences of JUMPTARGET.  Instead append @local to labels.
3084 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3086         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3087         size/alignment of struct pthread rather than tcbhead_t.
3088         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3089         Likewise.
3090         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3091         Likewise.
3092         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3093         Likewise.
3095 2005-05-19  Richard Henderson  <rth@redhat.com>
3097         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3098         __sync_val_compare_and_swap, not explicit _si variant.
3099         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3101 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3103         [BZ #915]
3104         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3106 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3108         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3109         .eh_frame section, use cfi_* directives.
3111 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3113         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3114         of "" includes.
3116 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3118         [BZ #1075]
3119         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3120         aio_write blocks.
3122 2005-04-27  Roland McGrath  <roland@redhat.com>
3124         * Makefile (tests): Remove tst-clock2.
3126         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3127         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3128         translating to the kernel clockid_t for our own process/thread clock.
3130         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3132 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3134         * old_pthread_cond_init.c: Include <errno.h>.
3135         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3136         process shared or uses clock other than CLOCK_REALTIME.
3137         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3139 2005-04-13  David S. Miller  <davem@davemloft.net>
3141         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3142         * sysdeps/sparc/sparc64/clone.S: New file.
3144 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3146         [BZ #1102]
3147         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3148         __inline instead of inline.
3149         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3151 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3153         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3154         functionally equivalent, but shorter instructions.
3155         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3156         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3157         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3158         Likewise.
3159         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3160         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3161         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3162         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3163         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3164         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3165         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3166         Likewise.
3167         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3168         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3169         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3170         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3171         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3173 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3175         * sysdeps/mips/Makefile: New file.
3176         * sysdeps/mips/nptl-sysdep.S: New file.
3177         * sysdeps/mips/tcb-offsets.sym: New file.
3178         * sysdeps/mips/pthread_spin_lock.S: New file.
3179         * sysdeps/mips/pthread_spin_trylock.S: New file.
3180         * sysdeps/mips/pthreaddef.h: New file.
3181         * sysdeps/mips/tls.h: New file.
3182         * sysdeps/mips/jmpbuf-unwind.h: New file.
3183         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3184         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3185         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3186         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3187         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3188         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3189         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3190         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3191         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3192         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3194 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3196         [BZ #1112]
3197         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3198         variable to scerr.
3200 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3202         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3204 2005-02-25  Roland McGrath  <roland@redhat.com>
3206         * alloca_cutoff.c: Correct license text.
3207         * tst-unload.c: Likewise.
3208         * sysdeps/pthread/allocalim.h: Likewise.
3209         * sysdeps/pthread/pt-initfini.c: Likewise.
3210         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3211         * sysdeps/pthread/bits/sigthread.h: Likewise.
3212         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3213         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3215 2005-02-16  Roland McGrath  <roland@redhat.com>
3217         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3218         Use unsigned int * for ptr_nthreads.
3220 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3222         [BZ #721]
3223         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3224         gcc4.
3226 2005-02-07  Richard Henderson  <rth@redhat.com>
3228         [BZ #787]
3229         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3230         argument.
3232 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3234         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3235         order of arguments in invocation of atomic_add_zero.
3237 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3239         [BZ #737]
3240         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3241         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3242         at least gotntpoff relocation and addition.
3243         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3244         Likewise.
3245         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3246         Likewise.
3247         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3248         Likewise.
3250 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3252         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3253         entry for static tls deallocation fix.
3254         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3255         also contains information whether the memory pointed to is static
3256         TLS or not.
3257         * sysdeps/i386/tls.h: Likewise.
3258         * sysdeps/ia64/tls.h: Likewise.
3259         * sysdeps/powerpc/tls.h: Likewise.
3260         * sysdeps/s390/tls.h: Likewise.
3261         * sysdeps/sh/tls.h: Likewise.
3262         * sysdeps/sparc/tls.h: Likewise.
3263         * sysdeps/x86_64/tls.h: Likewise.
3265 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3267         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3269 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3271         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3272         %esp.
3273         * Makefile (tests): Add tst-align2.
3274         * tst-align2.c: New test.
3275         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3276         -mpreferred-stack-boundary=4.
3278 2004-12-18  Roland McGrath  <roland@redhat.com>
3280         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3281         New file removed withdrawn for the moment.
3283 2004-12-17  Richard Henderson  <rth@redhat.com>
3285         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3286         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3288 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3290         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3291         Increased PTHREAD_STACK_MIN.
3293         * tst-context1.c (stacks): Use bigger stack size.
3295 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3297         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3298         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3300 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3302         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3303         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3304         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3306 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3308         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3310 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3312         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3313         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3315         * tst-getpid1.c: If child crashes, report this first.  Print which
3316         signal.
3318 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3320         * init.c (__pthread_initialize_minimal_internal): Also unblock
3321         SIGSETXID.
3323 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3325         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3326         _POSIX_THREAD_CPUTIME): Define to 0.
3327         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3328         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3329         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3330         __timer_signal_thread_tclk): Remove.
3331         (init_module): Remove their initialization.
3332         (thread_cleanup): Remove their cleanup assertions.
3333         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3334         __timer_signal_thread_tclk): Remove.
3335         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3336         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3337         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3339 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3341         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3342         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3344         * Makefile (tests): Add tst-getpid2.
3345         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3346         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3347         * tst-getpid2.c: New test.
3349 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3351         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3353 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3355         * Makefile (tests): Add tst-getpid1.
3356         * tst-getpid1.c: New file.
3357         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3358         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3360 2004-12-02  Roland McGrath  <roland@redhat.com>
3362         * Makefile (libpthread-nonshared): Variable removed.
3363         ($(objpfx)libpthread_nonshared.a): Target removed.
3364         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3365         These are now handled by generic magic from
3366         libpthread-static-only-routines being set.
3368 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3370         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3371         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3372         _POSIX_THREAD_PRIO_PROTECT): Define.
3373         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3374         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3375         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3377 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3379         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3380         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3381         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3382         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3383         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3384         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3385         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3387 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3389         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3391         * Makefile (libpthread-routines): Add pthread_setschedprio.
3392         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3393         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3394         * pthread_setschedprio.c: New file.
3396 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3398         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3399         * pthread_cancel.c (pthread_create): Likewise.
3401         * Makefile (libpthread-routines): Add vars.
3402         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3403         * init.c (__default_stacksize, __is_smp): Remove.
3404         * vars.c: New file.
3405         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3406         and define a wrapper macro.
3407         (PTHREAD_STATIC_FN_REQUIRE): Define.
3408         * allocatestack.c (__find_thread_by_id): Undefine.
3409         * pthread_create (__pthread_keys): Remove.
3410         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3411         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3412         PTHREAD_STATIC_FN_REQUIRE.
3414 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3416         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3417         parameter to REGISTER macro.
3419 2004-11-17  Roland McGrath  <roland@redhat.com>
3421         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3422         Make sure SIGCANCEL is blocked as well.
3424 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3426         * sysdeps/pthread/setxid.h: New file.
3427         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3428         (struct xid_command): Add forward decl.
3429         (struct pthread_functions): Change return type of __nptl_setxid hook
3430         to int.
3431         * pthreadP.h (__nptl_setxid): Change return type to int.
3432         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3433         calling thread, return its return value and set errno on failure.
3434         * descr.h (struct xid_command): Change id type to long array.
3436         * Makefile: Add rules to build and test tst-setuid1 and
3437         tst-setuid1-static.
3438         * tst-setuid1.c: New test.
3439         * tst-setuid1-static.c: New test.
3441 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3443         * Makefile (tests): Add tst-exit3.
3444         * tst-exit3.c: New test.
3446 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3448         * Makefile (tests): Add tst-exit2.
3449         * tst-exit2.c: New file.
3451 2004-11-09  Roland McGrath  <roland@redhat.com>
3453         [BZ #530]
3454         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3455         here, before calling clone.
3456         * pthread_create.c (start_thread): Don't do it here.
3458 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3460         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3462 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3464         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3465         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3466         assembler warning.
3468 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3470         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3471         if sched_priority is not between minprio and maxprio.
3473 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3475         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3476         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3478         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3479         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3481 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3483         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3484         not-cancelable I/O functions.
3486 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3488         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3489         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3490         make sure 2 is stored in the futex and we looked at the old value.
3491         Fix a few other problems to return the correct value.
3493 2004-10-14  Richard Henderson  <rth@redhat.com>
3495         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3496         make gcc4 happy.
3498 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3500         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3501         of pthread-functions.h and pthreaddef.h.
3502         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3504         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3505         Change __data.__nwaiters from int to unsigned int.
3507         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3508         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3510         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3511         before return type.
3513         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3514         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3516 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3518         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3519         test fails, remove message queue.
3520         (tf_msgsnd): Likewise.
3522 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3524         * tst-clock1.c: Change #ifdef to #if defined.
3525         * tst-clock2.c: Likewise.
3526         * tst-cond11.c: Likewise.
3528         * sysdeps/pthread/timer_create.c (timer_create): Use
3529         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3530         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3531         THREAD_CPUTIME.
3533 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3535         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3536         _POSIX_THREAD_CPUTIME): Define to 0.
3538 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3540         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3541         and _POSIX_THREAD_CPUTIME to zero.
3542         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3543         * tst-barrier2.c: Fix testing for POSIX feature.
3544         * tst-clock1.c: Likewise.
3545         * tst-clock2.c: Likewise.
3546         * tst-cond11.c: Likewise.
3547         * tst-cond4.c: Likewise.
3548         * tst-cond6.c: Likewise.
3549         * tst-flock2.c: Likewise.
3550         * tst-mutex4.c: Likewise.
3551         * tst-mutex9.c: Likewise.
3552         * tst-rwlock12.c: Likewise.
3553         * tst-rwlock4.c: Likewise.
3554         * tst-signal1.c: Likewise.
3555         * tst-spin2.c: Likewise.
3556         * sysdeps/pthread/posix-timer.h: Likewise.
3557         * sysdeps/pthread/timer_create.c: Likewise.
3558         * sysdeps/pthread/timer_routines.c: Likewise.
3560 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3562         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3563         (__lll_mutex_timedlock_wait): Address futex correctly.
3565         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3566         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3567         make sure 2 is stored in the futex and we looked at the old value.
3568         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3569         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3570         which might very well made the code not working at all before.
3571         [BZ #417]
3573 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3575         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3576         allow SIGSETXID to be sent.
3577         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3578         for SIGSETXID to be defined.
3579         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3580         SIGSETXID cannot be blocked.
3582         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3583         Add __extension__ to long long types.
3584         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3585         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3586         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3587         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3588         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3589         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3590         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3592 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3594         * descr.h (struct pthread): Add stopped_start field.
3595         * sysdeps/pthread/createthread.c (create_thread): Set
3596         start_stopped flag in descriptor for new thread appropriately.
3597         * pthread_create.c (start_thread): Only take lock to be stopped on
3598         startup if stopped_start flag says so.
3600 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3602         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3603         is created detached and if yes, do not try to free the stack in case
3604         the thread creation failed.
3605         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3606         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3607         case there has been no error.  [BZ #405]
3609         * pthread_create.c (start_thread): Don't wait for scheduler data
3610         etc to be set at the beginning of the function.  The cancellation
3611         infrastructure must have been set up.  And enable async
3612         cancellation before potentially going to sleep.  [BZ #401]
3614 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3616         * Versions: Remove exports for pthread_set*id_np functions.
3617         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3618         for now.
3619         * Makefile: Don't build pthread_set*id code for now.
3621 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3623         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3624         internal use.
3625         * allocatestack.c (__nptl_setxid): New function.
3626         * descr.h (struct xid_command): Define type.
3627         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3628         (sighandler_setxid): New function.
3629         (__pthread_initialize_minimal): Register sighandler_setxid for
3630         SIGCANCEL.
3631         * pt-allocrtsig.c: Update comment.
3632         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3633         Declare __nptl_setxid.
3634         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3635         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3636         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3637         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3638         and pthread_setresuid_np.
3639         * pthread_setgid_np.c: New file.
3640         * pthread_setuid_np.c: New file.
3641         * pthread_setegid_np.c: New file.
3642         * pthread_seteuid_np.c: New file.
3643         * pthread_setregid_np.c: New file.
3644         * pthread_setreuid_np.c: New file.
3645         * pthread_setresgid_np.c: New file.
3646         * pthread_setresuid_np.c: New file.
3647         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3648         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3649         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3650         and pthread_setresuid_np.
3651         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3652         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3653         pthread_setregid, and pthread_setresgid.
3655 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3657         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3658         ENOMEM when out of memory.
3660 2004-09-10  Roland McGrath  <roland@redhat.com>
3662         [BZ #379]
3663         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3664         code, since we don't try to use the broken CLONE_STOPPED any more.
3665         * pthread_create.c (start_thread): Likewise.
3667 2004-09-15  Richard Henderson  <rth@redhat.com>
3669         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3671 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3673         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3674         (__libc_unwind_longjmp): Delete macro and declare as function.
3675         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3676         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3677         nptl directory.
3678         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3679         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3680         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3682 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3684         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3685         for __USE_XOPEN2K.
3686         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3687         types also for __USE_XOPEN2K.
3688         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3689         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3690         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3691         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3692         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3693         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3694         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3695         [BZ #320]
3697 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3699         * sysdeps/pthread/pthread.h
3700         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3701         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3702         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3703         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3704         [BZ #375]
3706 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3708         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3709         PSEUDO to be used with . prefix.
3711         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3712         Use atomic_increment instead of atomic_exchange_and_add.
3713         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3714         Likewise.
3715         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3716         Likewise.
3717         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3718         Likewise.
3720         * allocatestack.c (allocate_stack): Use atomic_increment_val
3721         instead of atomic_exchange_and_add.
3722         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3723         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3724         Likewise.
3725         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3726         Likewise.
3728         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3729         the initialization function might throw.
3731 2005-09-05  Richard Henderson  <rth@redhat.com>
3733         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3734         Move definition inside libpthread, libc, librt check.  Provide
3735         definition for rtld.
3737 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3739         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3740         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3741         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3742         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3743         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3744         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3745         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3746         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3747         * unwind.c: Use it.
3749         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3750         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3751         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3752         Likewise.
3753         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3754         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3755         this is the last waiter, signal pthread_cond_destroy caller and
3756         avoid using the pthread_cond_t structure after unlock.
3757         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3758         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3759         Read clock type from the least significant bits of __nwaiters instead
3760         of __clock.
3761         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3762         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
3764 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
3766         [BZ #342]
3767         * Makefile (tests): Add tst-cond20 and tst-cond21.
3768         * tst-cond20.c: New test.
3769         * tst-cond21.c: New test.
3770         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3771         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
3772         it unsigned int.
3773         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3774         Likewise.
3775         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3776         (pthread_cond_t): Likewise.
3777         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3778         Likewise.
3779         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3780         Likewise.
3781         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3782         Likewise.
3783         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
3784         (cond_nwaiters): New.
3785         (clock_bits): New.
3786         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
3787         if there are waiters not signalled yet.
3788         Wait until all already signalled waiters wake up.
3789         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
3790         __nwaiters.  If pthread_cond_destroy has been called and this is the
3791         last waiter, signal pthread_cond_destroy caller and avoid using
3792         the pthread_cond_t structure after unlock.
3793         (__pthread_cond_wait): Increment __nwaiters in the beginning,
3794         decrement it when leaving.  If pthread_cond_destroy has been called
3795         and this is the last waiter, signal pthread_cond_destroy caller.
3796         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3797         Likewise.  Read clock type from the least significant bits of
3798         __nwaiters instead of __clock.
3799         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
3800         whether clock ID can be encoded in COND_CLOCK_BITS bits.
3801         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
3802         clock type just from the last COND_CLOCK_BITS bits of value.
3803         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
3804         instead of __clock, just from second bit of condattr's value.
3806 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
3808         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
3809         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
3810         != 64.
3811         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3813 2004-08-15  Roland McGrath  <roland@frob.com>
3815         * pthread_atfork.c: Update copyright terms including special exception
3816         for these trivial files, which are statically linked into executables
3817         that use dynamic linking for the significant library code.
3819 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3821         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
3822         pthread_rwlock_rdlock.
3823         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
3824         Decrease __nr_readers_queued after reacquiring lock.
3825         * sysdeps/pthread/pthread_rwlock_timedrdlock
3826         (pthread_rwlock_timedrdlock): Likewise.
3827         Reported by Bob Cook <bobcook47@hotmail.com>.
3829 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
3831         * tst-rwlock14.c (tf): Read main thread handle from *ARG
3832         before pthread_barrier_wait.
3834 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
3836         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3837         Remove unnecessary exception handling data.
3839 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
3841         [BZ #284]
3842         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
3843         instead of clockid_t.
3845 2004-07-21  Roland McGrath  <roland@redhat.com>
3847         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
3849 2004-07-19  Roland McGrath  <roland@redhat.com>
3851         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
3853 2004-07-02  Roland McGrath  <roland@redhat.com>
3855         * configure: Don't exit.
3857 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3859         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3860         (__pthread_cond_timedwait): Check for invalid nanosecond in
3861         timeout value.
3863 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
3865         * Makefile: Add rules to build and run tst-fini1.
3866         * tst-fini1.c: New file.
3867         * tst-fini1mod.c: New file.
3869 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
3871         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
3872         if no cancellation support is needed.
3873         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3874         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3875         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3876         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3877         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3878         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3879         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3880         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3881         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3883         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
3884         only if not already defined.
3886 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
3888         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
3889         constraint "m" instead of "0" for futex.
3891         * shlib-versions: Add powerpc64-.*-linux.*.
3893 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
3895         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
3896         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
3897         for valid tv_nsec.
3898         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
3899         1 billion and 64-bit tv_nsec which is valid when truncated to 32
3900         bits.
3902 2004-06-29  Roland McGrath  <roland@redhat.com>
3904         * Banner: NPTL no longer has its own version number.
3905         * Makefile (nptl-version): Variable removed.
3906         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
3907         using $(version), the glibc version number.
3909 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3911         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
3912         Fix branch offset for a PLT entry.
3913         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
3914         Likewise.
3915         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3916         Likewise.
3917         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
3918         Likewise.
3919         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
3920         Likewise.
3922 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3924         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
3925         unconditionally.
3927 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
3929         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3930         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
3931         instead of tv_sec.
3932         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
3933         (pthread_rwlock_timedrdlock): Likewise.
3935 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
3937         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
3938         Set __r7 to val, not mutex.
3940 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
3942         * Makefile: Add rules to build tst-rwlock14.
3943         * tst-rwlock14.c: New file.
3945 2004-06-24  Boris Hu  <boris.hu@intel.com>
3947         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
3948         check.
3949         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3951 2004-06-19  Andreas Jaeger  <aj@suse.de>
3953         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
3954         assembler in last patch.
3956 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
3958         * sysdeps/pthread/pthread_cond_timedwait.c
3959         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
3960         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3961         (__pthread_cond_timedwait): Check for invalid nanosecond in
3962         timeout value.
3963         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3964         * tst-cond19.c: New file.
3965         * Makefile: Add rules to build and run tst-cond19.
3967 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
3969         * tst-context1.c (GUARD_PATTERN): Defined.
3970         (tst_context_t): Define struct containing ucontext_t & guard words.
3971         (ctx): Declare as an array of tst_context_t.
3972         (fct): Verify uc_link & guard words are still valid.
3973         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
3975 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3977         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3978         Add __data.__futex field, reshuffle __data.__clock.
3979         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
3980         (__pthread_cond_signal): Increment __futex at the same time as
3981         __wakeup_seq or __total_seq.  Pass address of __futex instead of
3982         address of low 32-bits of __wakeup_seq to futex syscall.
3983         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
3984         (__pthread_cond_wait): Likewise.  Pass __futex value from before
3985         releasing internal lock to FUTEX_WAIT.
3986         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3987         (__pthread_cond_timedwait): Likewise.
3988         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
3989         (FUTEX_CMP_REQUEUE): Define.
3990         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
3991         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
3992         Pass __futex value from before the unlock and __futex address instead
3993         of address of low 32-bits of __wakeup_seq to futex syscall.
3994         Fallback to FUTEX_WAKE all on any errors.
3996 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
3998         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
3999         comment typo.
4000         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4001         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4002         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4003         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4004         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4006 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4008         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4009         Add memory clobber to inline assembly.
4010         (__lll_mutex_trylock): Likewise.
4011         (__lll_mutex_cond_trylock): Likewise.
4013 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4015         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4016         Pass val argument as 6th system call argument in %r7.
4018 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4020         * Makefile (tests): Add tst-cond16.
4021         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4022         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4023         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4024         Add __data.__futex field, reshuffle __data.__clock.
4025         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4026         (__pthread_cond_signal): Increment __futex at the same time as
4027         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4028         address of low 32-bits of __wakeup_seq to futex syscall.
4029         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4030         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4031         releasing internal lock to FUTEX_WAIT.
4032         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4033         (__pthread_cond_timedwait): Likewise.
4034         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4035         (FUTEX_CMP_REQUEUE): Define.
4036         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4037         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4038         Pass __futex value from before the unlock and __futex address instead
4039         of address of low 32-bits of __wakeup_seq to futex syscall.
4040         Fallback to FUTEX_WAKE all on any errors.
4041         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4042         Define.
4043         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4044         internally.  Return non-zero if error, zero if success.
4045         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4046         Add __data.__futex field, reshuffle __data.__clock.
4047         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4048         Define.
4049         (lll_futex_requeue): Add val argument, return 1 unconditionally
4050         for the time being.
4051         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4052         Add __data.__futex field, reshuffle __data.__clock.
4053         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4054         Define.
4055         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4056         internally.  Return non-zero if error, zero if success.
4057         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4058         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4059         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4060         Define.
4061         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4062         internally.  Return non-zero if error, zero if success.
4063         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4064         Add __data.__futex field, reshuffle __data.__clock.
4065         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4066         Define.
4067         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4068         internally.  Return non-zero if error, zero if success.
4069         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4070         Add __data.__futex field, reshuffle __data.__clock.
4071         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4072         Add __data.__futex field, reshuffle __data.__clock.
4073         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4074         Increment __futex at the same time as __wakeup_seq or __total_seq.
4075         Pass address of __futex instead of address of low 32-bits of
4076         __wakeup_seq to futex syscall.
4077         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4078         Pass __futex value from before releasing internal lock
4079         to FUTEX_WAIT.
4080         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4081         Likewise.  Avoid unnecessary shadowing of variables.
4082         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4083         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4084         unlock and __futex address instead of address of low 32-bits of
4085         __wakeup_seq to futex_requeue macro, adjust for new return value
4086         meaning.
4087         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4088         (__pthread_cond_signal): Increment __futex at the same time as
4089         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4090         address of low 32-bits of __wakeup_seq to futex syscall.
4091         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4092         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4093         releasing internal lock to FUTEX_WAIT.
4094         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4095         (__pthread_cond_timedwait): Likewise.
4096         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4097         (FUTEX_CMP_REQUEUE): Define.
4098         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4099         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4100         Pass __futex value from before the unlock and __futex address instead
4101         of address of low 32-bits of __wakeup_seq to futex syscall.
4102         Fallback to FUTEX_WAKE all on any errors.
4104 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4106         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4107         Add nop to align the end of critical section.
4108         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4110 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4112         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4113         Add __broadcast_seq field.
4114         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4115         all waiters as woken with woken_seq and bump broadcast counter.
4116         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4117         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4118         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4119         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4121 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4123         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4124         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4125         Reported by Kaz Kojima.
4127 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4129         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4131 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4133         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4134         __broadcast_seq with bc_seq after acquiring internal lock instead of
4135         before it.
4137 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4139         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4140         compilation.
4141         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4142         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4143         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4144         (pthread_cond_t): Add __data.__broadcast_seq field.
4145         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4146         (FRAME_SIZE): Define.
4147         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4148         Comment typo fixes.
4149         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4150         Define.
4151         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4152         typo fixes.
4153         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4154         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4155         fixes.
4157 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4159         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4160         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4161         Add __broadcast_seq field.
4162         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4163         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4164         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4165         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4166         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4167         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4168         all waiters as woken with woken_seq and bump broadcast counter.
4169         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4170         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4171         __broadcast_seq field.
4172         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4173         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4174         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4175         * pthread_cond_init.c: Initialize __broadcast_seq field.
4176         * Makefile (tests): Add tst-cond17 and tst-cond18.
4177         Add .NOTPARALLEL goal.
4178         * tst-cond16.c: New file.  From Jakub.
4179         * tst-cond17.c: New file.  From Jakub.
4180         * tst-cond18.c: New file.  From Jakub.
4182 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4184         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4185         unwind info.
4187         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4188         Parametrize frame size.  Correct some unwind info.
4189         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4191 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4193         * tst-stack3.c: Note testing functionality beyond POSIX.
4195 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4197         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4198         Change conditional from ifdef to if.
4200 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4202         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4203         SYSDEP_CANCEL_ERROR): Define.
4204         (PSEUDO): Use it.
4206 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4208         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4210 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4212         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4214 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4216         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4217         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4218         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4219         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4221 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4223         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4224         thread has all signals blocked.
4226 2004-04-18  Andreas Jaeger  <aj@suse.de>
4228         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4229         (SEM_VALUE_MAX): Add missing brace.
4231 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4233         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4234         in rt subdir.
4235         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4236         * sysdeps/pthread/tst-mqueue8x.c: New test.
4237         * tst-cancel4.c: Update comment about message queues.
4239         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4240         return it_value { 0, 0 }.
4241         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4242         like SIGEV_SIGNAL.
4243         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4244         assertion for SIGEV_NONE.
4245         (thread_attr_compare): Compare all attributes, not just a partial
4246         subset.
4248 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4250         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4252 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4254         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4255         Just use a plain number.
4256         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4257         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4258         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4259         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4260         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4261         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4262         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4264 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4266         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4267         frame info.
4268         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4270 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4272         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4273         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4274         of calling sigwaitinfo.
4276 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4278         * allocatestack.c (allocate_stack): Set reported_guardsize
4279         unconditionally.
4280         * pthread_getattr_np.c (pthread_getattr_np): Use
4281         reported_guardsize instead of guardsize.
4282         * descr.h (struct pthread): Add reported_guardsize field.
4284 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4286         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4288 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4290         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4292 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4294         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4295         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4296         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4297         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4298         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4299         Define.
4300         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4301         (_POSIX_MESSAGE_PASSING): Define.
4302         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4303         (_POSIX_MESSAGE_PASSING): Define.
4304         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4305         (_POSIX_MESSAGE_PASSING): Define.
4307 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4309         * tst-context1.c (fct): Check whether correct stack is used.
4311 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4313         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4314         matching constraints for asm mem parameters.
4316         * tst-clock2.c (tf): Don't define unless needed.
4318 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4320         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4321         $(gnulib).
4323 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4325         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4326         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4327         * pthreadP.h: Declare __nptl_deallocate_tsd.
4328         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4329         Adjust caller.
4331         * Makefile (tests): Add tst-tsd5.
4332         * tst-tsd5.c: New file.
4334 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4336         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4337         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4338         is SHLIB_COMPAT check.
4339         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4340         (__pthread_attr_getaffinity_old): Likewise.
4341         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4342         (__pthread_getaffinity_old): Likewise.
4343         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4344         (__pthread_setaffinity_old): Likewise.
4346 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4348         * allocatestack.c (_make_stacks_executable): Call
4349         _dl_make_stack_executable first.
4351 2004-03-24  Roland McGrath  <roland@redhat.com>
4353         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4354         constraint instead of "0".
4356 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4358         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4359         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4361         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4362         code to avoid warning.
4364 2004-03-24  Andreas Jaeger  <aj@suse.de>
4366         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4367         (__pthread_attr_setaffinity_old): Remove const.
4369 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4371         * sysdeps/unix/sysv/linux/smp.h: New file.
4372         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4373         * init.c: Define __is_smp.
4374         (__pthread_initialize_minimal_internal): Call is_smp_system to
4375         initialize __is_smp.
4376         * pthreadP.h: Declare __is_smp.
4377         Define MAX_ADAPTIVE_COUNT is necessary.
4378         * pthread_mutex_init.c: Add comment regarding __spins field.
4379         * pthread_mutex_lock.c: Implement adaptive mutex type.
4380         * pthread_mutex_timedlock.c: Likewise.
4381         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4382         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4383         Add __spins field.
4384         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4385         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4386         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4387         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4388         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4389         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4390         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4391         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4392         lll_mutex_cond_trylock.
4393         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4394         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4395         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4396         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4397         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4398         Define BUSY_WAIT_NOP.
4399         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4400         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4402         * tst-mutex5.c: Add support for testing adaptive mutexes.
4403         * tst-mutex7.c: Likewise.
4404         * tst-mutex5a.c: New file.
4405         * tst-mutex7a.c: New file.
4406         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4408         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4409         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4410         vgettimeofday call might destroy the content.
4412         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4413         @pause in the loop.
4415         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4416         No need to restrict type of ret.  Make it int.  Add comment.
4418         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4419         Remove unnecessary setne instruction.
4421 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4423         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4424         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4425         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4426         If realloc fails, break out of the loop.
4428 2004-03-20  Andreas Jaeger  <aj@suse.de>
4430         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4431         (__pthread_setaffinity_old): Fix interface.
4432         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4433         (__pthread_getaffinity_old): Likewise.
4435         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4436         (__pthread_setaffinity_new): Remove duplicate declaration.
4438 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4440         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4441         the return value to a safe register.
4442         (CDISABLE): Set the function argument correctly.
4444 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4446         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4447         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4448         Rewrite so that only one locked memory operation per round is needed.
4449         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4450         (pthread_barrier_wait): After wakeup, release lock only when the
4451         last thread stopped using the barrier object.
4452         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4453         (__pthread_cond_wait): Don't store mutex address if the current
4454         value is ~0l.  Add correct cleanup support and unwind info.
4455         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4456         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4457         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4458         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4459         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4460         Add correct cleanup support and unwind info.
4461         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4462         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4463         information for syscall wrappers.
4465 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4467         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4468         cpusetsize field, remove next.
4469         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4470         parameter for size of the CPU set.
4471         (pthread_setaffinity_np): Likewise.
4472         (pthread_attr_getaffinity_np): Likewise.
4473         (pthread_attr_setaffinity_np): Likewise.
4474         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4475         interface change, keep compatibility code.
4476         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4477         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4478         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4479         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4480         __pthread_getaffinity_np.
4481         * Versions: Add version for changed interfaces.
4482         * tst-attr3.c: Adjust test for interface change.
4483         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4484         increasing buffer sizes.
4485         * pthread_attr_destroy.c: Remove unused list handling.
4486         * pthread_attr_init.c: Likewise.
4488 2004-03-17  Roland McGrath  <roland@redhat.com>
4490         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4491         first argument to clock_getres so we ever enable kernel timers.
4493 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4495         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4497 2004-03-12  Richard Henderson  <rth@redhat.com>
4499         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4500         oldvalue from CENABLE to CDISABLE.
4502 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4504         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4505         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4506         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4507         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4509 2004-03-11  Richard Henderson  <rth@redhat.com>
4511         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4512         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4513         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4515 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4517         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4518         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4519         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4521 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4523         * forward.c (__pthread_cond_broadcast_2_0,
4524         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4525         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4526         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4528 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4530         * sysdeps/sh/tcb-offsets.sym: Add PID.
4531         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4532         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4534 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4536         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4537         include <sysdep-cancel.h>, vfork is no cancellation point.
4538         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4539         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4540         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4542 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4544         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4545         libc_hidden_def.
4546         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4547         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4548         Likewise.
4549         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4550         Likewise.
4551         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4552         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4553         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4554         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4555         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4557         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4558         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4559         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4560         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4561         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4562         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4564         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4565         a local register for saving old PID.  Negate PID in parent upon exit.
4567         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4568         tcb-offsets.h.
4569         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4570         before syscall, set to the old value in the parent afterwards.
4571         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4572         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4573         tcb-offsets.h.
4574         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4575         before syscall, set to the old value in the parent afterwards.
4576         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4577         * sysdeps/s390/tcb-offsets.sym: Add PID.
4579         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4580         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4581         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4582         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4583         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4584         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4586 2004-03-10  Andreas Schwab  <schwab@suse.de>
4588         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4589         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4590         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4592 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4594         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4595         * tst-cancel21.c (do_one_test): Likewise.
4596         Reported by Gordon Jin <gordon.jin@intel.com>.
4598 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4600         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4601         if non-zero and set to INT_MIN if zero.
4602         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4603         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4604         (SAVE_PID, RESTORE_PID): Define.
4605         (__vfork): Use it.
4606         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4607         Use relative path to avoid including NPTL i386/vfork.S.
4608         (SAVE_PID, RESTORE_PID): Define.
4609         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4610         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4611         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4612         tst-vfork2x.
4613         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4614         * tst-vfork1.c: New test.
4615         * tst-vfork2.c: New test.
4616         * tst-vfork1x.c: New test.
4617         * tst-vfork2x.c: New test.
4619 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4621         * sysdeps/i386/tcb-offsets.sym: Add PID.
4622         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4623         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4624         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4626 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4628         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4630 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4632         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4633         _rtld_global_ro.
4635 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4637         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4638         _rtld_global_ro.
4640         * tst-once4.c: Remove unnecessary macro definition.
4642         * tst-mutex7.c (do_test): Limit thread stack size.
4643         * tst-once2.c (do_test): Likewise.
4644         * tst-tls3.c (do_test): Likewise.
4645         * tst-tls1.c (do_test): Likewise.
4646         * tst-signal3.c (do_test): Likewise.
4647         * tst-kill6.c (do_test): Likewise.
4648         * tst-key4.c (do_test): Likewise.
4649         * tst-join4.c (do_test): Likewise.
4650         * tst-fork1.c (do_test): Likewise.
4651         * tst-context1.c (do_test): Likewise.
4652         * tst-cond2.c (do_test): Likewise.
4653         * tst-cond10.c (do_test): Likewise.
4654         * tst-clock2.c (do_test): Likewise.
4655         * tst-cancel10.c (do_test): Likewise.
4656         * tst-basic2.c (do_test): Likewise.
4657         * tst-barrier4.c (do_test): Likewise.
4659 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4661         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4663 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4665         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4666         (__pthread_cond_timedwait): Optimize wakeup test.
4667         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4668         (__pthread_cond_wait): Likewise.
4669         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4670         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4671         Likewise.
4673 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4675         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4676         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4677         the atomic instruction needed.
4678         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4679         (__lll_mutex_lock_wait): Likewise.
4681 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4683         * Makefile (tests): Add tst-cond14 and tst-cond15.
4684         * tst-cond14.c: New file.
4685         * tst-cond15.c: New file.
4687 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4689         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4690         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4691         needs to be implemented differently to be useful.
4693 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4695         * pthread_attr_setschedparam.c: Don't test priority against limits
4696         here.  Set ATTR_FLAG_SCHED_SET flag.
4697         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4698         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4699         from parent thread to child.  If attribute is used and scheduling
4700         parameters are not inherited, copy parameters from attribute or
4701         compute them.  Check priority value.
4702         * pthread_getschedparam.c: If the parameters aren't known yet get
4703         them from the kernel.
4704         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4705         ATTR_FLAG_POLICY_SET flag for thread.
4706         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4707         and ATTR_FLAG_POLICY_SET.
4709         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4711         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4712         fail if stack address hasn't been set.  Just return 0.
4714 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4716         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4717         libpthread for the files in this list.
4718         (CFLAGS-tst-unload): Removed.
4719         * tst-unload.c (do_test): Don't use complete path for
4720         LIBPHREAD_SO.
4722         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4723         tst-_res1mod2.
4725 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4727         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4728         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4729         operation per round is needed.
4730         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4731         (__lll_mutex_lock_wait): Likewise.
4733 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4735         * tst-cancel9.c (cleanup): Don't print to stderr.
4737 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4739         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4741 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4743         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4744         (__syscall_error_handler2): Call CDISABLE.
4745         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4746         (__syscall_error_handler2): Call CDISABLE.
4748         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4749         Release lock before the loop, don't reacquire it.
4751         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4753 2004-02-19  Andreas Schwab  <schwab@suse.de>
4755         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4756         Fix last change.
4758 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
4760         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4761         (pthread_barrier_wait): After wakeup, release lock only when the
4762         last thread stopped using the barrier object.
4763         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
4764         (pthread_barrier_wait): Likewise.
4765         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4766         Likewise.
4767         * Makefile (tests): Add tst-barrier4.
4768         * tst-barrier4.c: New file.
4770         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4771         (__pthread_cond_timedwait): Perform timeout test while holding
4772         internal lock to prevent wakeup race.
4773         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4774         * sysdeps/pthread/pthread_cond_timedwait.c
4775         (__pthread_cond_timedwait): Likewise.
4776         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4777         (__pthread_cond_timedwait): Likewise.
4779 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
4781         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
4782         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
4783         * Makefile (tests): Add tst-rwlock13.
4784         * tst-rwlock13.c: New test.
4786 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
4788         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4789         (__condvar_tw_cleanup): Little optimization.
4790         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4792 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
4794         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
4795         libpthread as "lib" parameter to SHLIB_COMPAT.
4796         (__novmx_siglongjmp): Fix typo in function name.
4797         (__novmx_longjmp): Fix typo in function name.
4799 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4801         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
4802         __builtin_expect.
4804         * sysdeps/generic/pt-longjmp.c: Moved to...
4805         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
4807 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
4809         * Makefile (libpthread-routines): Add pt-cleanup.
4810         * pt-longjmp.c: Removed.
4811         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
4812         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
4813         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
4814         Version longjmp, siglongjmp for GLIBC_2.3.4.
4815         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
4817 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4819         * sysdeps/pthread/pthread_cond_timedwait.c
4820         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
4821         Reuse code.  Add __builtin_expects.
4823         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4824         (__pthread_cond_timedwait): Get internal lock in case timeout has
4825         passed before the futex syscall.
4826         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4828 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
4830         * allocatestack.c: Pretty printing.
4832         * sysdeps/pthread/createthread.c (create_thread): Don't add
4833         CLONE_DETACHED bit if it is not necessary.
4835 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
4837         * pthread_getattr_np.c: Include ldsodefs.h.
4839 2004-01-16  Richard Henderson  <rth@redhat.com>
4841         * allocatestack.c: Don't declare __libc_stack_end.
4842         * init.c (__pthread_initialize_minimal_internal): Likewise.
4843         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
4845 2004-01-15  Richard Henderson  <rth@redhat.com>
4847         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
4848         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
4849         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
4850         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
4851         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
4852         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
4853         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
4854         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
4856 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
4858         * init.c (pthread_functions): Make array const.
4860 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
4862         * allocatestack.c (__make_stacks_executable): Change interface.
4863         Check parameters.  Pass parameter on to libc counterpart.
4864         * pthreadP.h: Change declaration.
4866 2004-01-13  Richard Henderson  <rth@redhat.com>
4868         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
4869         prototype form.
4870         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
4871         Likewise.
4873         * sysdeps/alpha/Makefile: New file.
4874         * sysdeps/alpha/tcb-offsets.sym: New file.
4875         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4876         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
4878         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
4879         on powerpc version.
4881 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
4883         * Makefile (tests): Add tst-backtrace1.
4884         * tst-backtrace1.c: New test.
4886 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
4888         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
4889         register as second parameter to the REGISTER macro.
4890         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
4891         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
4892         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
4893         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
4894         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
4895         of thread register as second parameter to REGISTER macro in 64 case.
4897 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
4899         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
4900         (CFLAGS-getpid.o): Defined.
4901         (CFLAGS-getpid.os): Defined.
4903 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
4905         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
4906         returned for main thread does not overlap with any other VMA.
4907         Patch by Jakub Jelinek.
4909 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
4911         * tst-raise1.c: Include stdio.h.
4913 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
4915         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
4916         setting with __ASSUME_TGKILL || defined __NR_tgkill.
4917         If pid is 0, set it to selftid.
4918         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
4919         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
4920         != 0, return self->tid without doing a syscall.
4921         * descr.h (struct pthread): Move pid field after tid.
4923         * Makefile (tests): Add tst-raise1.
4924         * tst-raise1.c: New file.
4926 2003-12-23  Roland McGrath  <roland@redhat.com>
4928         * tst-oddstacklimit.c: New file.
4929         * Makefile (tests): Add it.
4930         (tst-oddstacklimit-ENV): New variable.
4932         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
4933         value up to page size for __default_stacksize.
4935 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
4937         * Makefile (tests): Add tst-eintr5.
4938         * tst-eintr5.c: New file.
4940         * eintr.c (eintr_source): Prevent sending signal to self.
4942         * tst-eintr2.c (tf1): Improve error message.
4944 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
4946         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
4947         * sysdeps/unix/sysv/linux/getpid.c: New file.
4948         * pthread_cancel.c: Add comment explaining use of PID field.
4949         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4950         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
4951         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
4952         temporarily to signal the field must not be relied on and updated
4953         by getpid().
4954         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
4955         temporarily negative.
4956         * sysdeps/unix/sysv/linux/raise.c: Likewise.
4958 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
4960         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
4961         (eintr_source): If ARG != NULL, use pthread_kill.
4962         * tst-eintr1.c: Adjust for this change.
4963         * tst-eintr2.c: Likewise.
4964         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
4965         * tst-eintr3.c: New file.
4966         * tst-eintr4.c: New file.
4968 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
4970         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
4971         if CANCELSTATE_BITMASK is set.
4972         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
4973         Likewise.
4975         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
4976         (tests-reverse): Add tst-cancel23.
4977         * tst-cancel22.c: New test.
4978         * tst-cancel23.c: New test.
4980 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
4982         * tst-eintr1.c: Better error messages.
4984         * Makefile (tests): Add tst-eintr2.
4985         * tst-eintr2.c: New file.
4987 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
4989         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
4990         (CFLAGS-tst-cancelx21.c): Set.
4991         * tst-cancel21.c: New test.
4992         * tst-cancelx21.c: New test.
4994         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
4995         comparison operand.
4996         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
4997         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
4998         * pt-longjmp.c: Include jmpbuf-unwind.h.
4999         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5000         _JMPBUF_UNWINDS.  Adjust compared pointers.
5001         * init.c (__pthread_initialize_minimal_internal): Initialize
5002         pd->stackblock_size.
5003         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5004         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5005         * sysdeps/i386/jmpbuf-unwind.h: New file.
5006         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5007         * sysdeps/s390/jmpbuf-unwind.h: New file.
5008         * sysdeps/sh/jmpbuf-unwind.h: New file.
5009         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5010         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5011         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5012         (_JMPBUF_CFA_UNWINDS): Remove.
5013         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5015 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5017         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5018         (CFLAGS-tst-cancelx20.c): Set.
5019         * tst-cancel20.c: New test.
5020         * tst-cancelx20.c: New test.
5022 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5024         * init.c (__pthread_initialize_minimal_internal): Don't treat
5025         architectures with separate register stack special here when
5026         computing default stack size.
5028 2003-12-17  Roland McGrath  <roland@redhat.com>
5030         * Makefile (tst-cancelx7-ARGS): New variable.
5031         Reportd by Greg Schafer <gschafer@zip.com.au>.
5033 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5035         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5036         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5037         (tst-stack3-ENV): Set.
5038         ($(objpfx)tst-stack3-mem): New.
5039         * tst-stack3.c: New test.
5041 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5043         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5044         Add unwind directives.  Drop unused .regstk directive.
5045         (_fini_EPILOG_BEGINS): Add unwind directives.
5047 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5049         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5050         Assume parameter is a pointer.
5051         (lll_futex_wake): Likewise.
5052         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5053         Likewise.
5054         (lll_futex_wake): Likewise.
5055         Reported by Boris Hu.
5056         * sysdeps/unix/sysv/linux/unregister-atfork.c
5057         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5059         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5061 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5063         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5064         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5065         __rtld_lock_initialize for ld.so lock.
5066         Patch in part by Adam Li <adam.li@intel.com>.
5068 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5070         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5071         in $(gnulib).  Also, remove stale comment.
5073 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5075         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5076         advantage of new syscall stub and optimize accordingly.
5078         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5079         from SYS_futex, to match expectations of
5080         sysdep.h:DO_INLINE_SYSCALL.
5081         (lll_futex_clobbers): Remove.
5082         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5083         (lll_futex_wake): Likewise.
5084         (lll_futex_requeue): Likewise.
5085         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5086         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5087         Jelinek).
5088         (__lll_mutex_lock): Likewise.
5089         (__lll_mutex_cond_lock): Likewise.
5090         (__lll_mutex_timed_lock): Likewise.
5091         (__lll_mutex_unlock): Likewise.
5092         (__lll_mutex_unlock_force): Likewise.
5094         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5095         comes before the include of <sysdep.h>.
5096         (THREAD_SELF_SYSINFO): New macro.
5097         (THREAD_SYSINFO): Likewise.
5098         (INIT_SYSINFO): New macro.
5099         (TLS_INIT_TP): Call INIT_SYSINFO.
5101         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5103         * sysdeps/pthread/createthread.c (create_thread): Use
5104         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5105         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5106         THREAD_SELF_SYSINFO instead of open code.
5107         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5108         (THREAD_SYSINFO): Likewise.
5110         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5112         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5114 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5116         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5117         instead of .init.  Patch by David Mosberger.
5119 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5121         * sysdeps/pthread/configure.in: Remove broken declaration in C
5122         cleanup handling check.
5124 2003-11-30  Andreas Jaeger  <aj@suse.de>
5126         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5127         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5128         Likewise.
5130 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5132         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5133         * pthread_attr_destroy.c: Include shlib-compat.h.
5134         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5135         is set in iattr->flags.
5136         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5138 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5140         * Makefile (distribute): Add tst-cleanup4aux.c.
5142         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5143         include.
5145 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5147         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5148         pthread_cond_signal.
5150         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5151         store mutex address if the current value is ~0l.
5152         * sysdeps/pthread/pthread_cond_timedwait.c
5153         (__pthread_cond_timedwait): Likewise.
5154         * sysdeps/pthread/pthread_cond_broadcast.c
5155         (__pthread_cond_broadcast): Don't use requeue for pshared
5156         condvars.
5158         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5159         (__pthread_cond_wait): Don't store mutex address if the current
5160         value is ~0l.
5161         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5162         (__pthread_cond_timedwait): Likewise.
5163         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5164         (__pthread_cond_broadcast): Don't use requeue for pshared
5165         condvars.
5167         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5168         element with ~0l for pshared condvars, with NULL otherwise.
5170         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5171         (__pthread_cond_wait): Don't store mutex address if the current
5172         value is ~0l.
5173         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5174         (__pthread_cond_timedwait): Likewise.
5175         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5176         (__pthread_cond_broadcast): Don't use requeue for pshared
5177         condvars.
5179         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5180         * tst-cond12.c: New file.
5181         * tst-cond13.c: New file.
5183 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5185         * sysdeps/pthread/configure.in: Make missing forced unwind support
5186         fatal.
5188 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5190         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5192 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5194         * Makefile: Add magic to clean up correctly.
5196 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5198         * unwind.c (FRAME_LEFT): Define.
5199         (unwind_stop): Handle old style cleanups here.
5200         (__pthread_unwind): Handle old style cleanups only if
5201         !HAVE_FORCED_UNWIND.
5202         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5203         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5204         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5205         ($(objpfx)tst-cleanupx4): Likewise.
5206         * tst-cleanup4.c: New test.
5207         * tst-cleanup4aux.c: New.
5208         * tst-cleanupx4.c: New test.
5210 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5212         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5213         lll_mutex_*lock macros to skip atomic operations on some archs.
5215 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5217         * sysdeps/pthread/tst-timer.c (main): Initialize
5218         sigev2.sigev_value as well.
5220 2003-10-15  Roland McGrath  <roland@redhat.com>
5222         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5223         is missing.
5224         * sysdeps/pthread/configure: Regenerated.
5226 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5228         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5229         locking macros.  No distinction between normal and mutex locking
5230         anymore.
5231         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5232         Merge bits from lowlevelmutex.S we still need.
5233         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5234         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5235         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5236         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5237         new mutex implementation.
5238         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5239         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5240         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5241         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5242         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5243         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5244         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5245         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5246         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5247         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5248         symbol for entry point to avoid cancellation.
5250 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5252         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5253         changes.
5254         (SAVE_OLDTYPE_0): Fix a typo.
5256 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5258         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5259         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5261 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5263         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5264         correct offset.
5266 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5268         * Makefile (tests): Add tst-cancel19.
5269         * tst-cancel19.c: New test.
5271 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5273         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5274         restoring of the old cancellation type.
5276 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5278         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5280 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5282         * sysdeps/pthread/malloc-machine.h: New file
5284 2003-09-24  Roland McGrath  <roland@redhat.com>
5286         * allocatestack.c (__make_stacks_executable): Don't ignore return
5287         value from _dl_make_stack_executable.
5289 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5291         * allocatestack.c (__make_stacks_executable): Also change
5292         permission of the currently unused stacks.
5294         * allocatestack.c (change_stack_perm): Split out from
5295         __make_stacks_executable.
5296         (allocate_stack): If the required permission changed between the time
5297         we started preparing the stack and queueing it, change the permission.
5298         (__make_stacks_executable): Call change_stack_perm.
5300         * Makefile: Build tst-execstack-mod locally.
5301         * tst-execstack-mod.c: New file.
5303 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5305         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5307 2003-09-23  Roland McGrath  <roland@redhat.com>
5309         * tst-execstack.c: New file.
5310         * Makefile (tests): Add it.
5311         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5312         (LDFLAGS-tst-execstack): New variable.
5314         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5315         whether to use PROT_EXEC for stack mmap.
5316         (__make_stacks_executable): New function.
5317         * pthreadP.h: Declare it.
5318         * init.c (__pthread_initialize_minimal_internal): Set
5319         GL(dl_make_stack_executable_hook) to that.
5321 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5323         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5324         recommendation from AMD re avoidance of lock prefix.
5326 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5328         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5329         lll_futex_timed_wait instead of lll_futex_wait.
5330         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5331         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5332         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5333         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5334         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5335         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5336         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5337         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5338         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5339         Completely revamp the locking macros.  No distinction between
5340         normal and mutex locking anymore.
5341         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5342         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5343         __lll_lock_timedwait): Fix prototypes.
5344         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5345         __lll_lock_timedwait): Likewise.
5346         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5347         macros, add __builtin_expect.
5348         (lll_mutex_timedlock): Likewise.  Fix return value.
5349         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5350         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5351         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5352         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5353         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5354         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5355         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5356         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5358 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5360         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5361         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5362         operation if possible.
5364         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5365         like jumping over the lock prefix.
5367 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5369         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5370         locking macros.  No distinction between normal and mutex locking
5371         anymore.
5372         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5373         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5374         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5375         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5376         locking.  Merge bits from lowlevelmutex.S we still need.
5377         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5378         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5379         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5380         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5381         * Makefile (routines): Remove libc-lowlevelmutex.
5382         (libpthread-rountines): Remove lowlevelmutex.
5383         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5384         for new mutex implementation.
5385         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5386         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5387         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5388         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5389         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5390         Likewise.
5391         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5392         Likewise.
5393         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5394         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5395         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5396         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5397         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5398         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5399         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5400         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5401         Likewise.
5402         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5403         Likewise.
5404         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5405         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5406         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5407         Don't use requeue.
5408         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5409         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5411 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5413         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5414         in parameters of asm with output parameters.
5416         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5417         type of DECR parameter to int.
5418         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5420 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5422         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5423         guardsize for each thread.
5425 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5427         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5428         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5429         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5431         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5432         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5433         NULL.
5434         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5435         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5436         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5437         (pthread_getaffinity_np): Add hidden_def.
5439         * Makefile (tests): Add tst-attr3.
5440         * tst-attr3.c: New test.
5442         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5444 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5446         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5447         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5449 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5451         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5452         * tst-align.c: Include tst-stack-align.h.
5453         (tf, do_test): Use TEST_STACK_ALIGN macro.
5455 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5457         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5458         variable.
5460 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5462         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5463         stack-related values for the initial thread.
5465 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5467         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5469 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5471         * pthread_mutex_lock.c: Minor code rearrangements.
5473 2003-09-05  Roland McGrath  <roland@redhat.com>
5475         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5476         Instead, include ../nptl_db/db_info.c to do its magic.
5477         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5478         (__pthread_pthread_key_2ndlevel_size): Likewise.
5479         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5480         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5481         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5482         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5483         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5484         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5485         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5486         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5487         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5488         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5489         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5490         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5491         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5492         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5493         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5494         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5495         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5497 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5499         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5500         of pthread_t to be compatible with LT.
5501         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5502         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5503         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5504         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5505         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5506         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5507         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5509 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5511         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5513 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5515         * unwind-forcedunwind.c: Move to...
5516         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5517         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5518         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5519         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5520         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5521         * unwind.c: Include jmpbuf-unwind.h.
5522         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5524 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5526         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5527         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5528         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5529         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5530         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5531         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5532         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5533         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5534         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5535         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5536         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5537         function.
5538         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5539         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5540         * Makefile (tests): Add tst-stack2.
5541         * tst-stack2.c: New test.
5542         * tst-stack1.c: Include limits.h and sys/param.h.
5543         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5545         * pthread_condattr_setpshared.c: Include errno.h.
5546         (pthread_condattr_setpshared): Return EINVAL if pshared
5547         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5549         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5550         defined symbol for entry point to avoid cancellation.
5551         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5552         Likewise.
5553         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5554         Likewise.
5555         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5556         Likewise.
5557         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5558         Likewise.
5559         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5560         Likewise.
5561         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5562         __close_nocancel, __read_nocancel, __write_nocancel,
5563         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5564         libpthread.so or librt.so, define to corresponding function
5565         without _nocancel suffix.
5566         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5567         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5568         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5570         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5572 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5574         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5575         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5577         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5578         in subsections has a symbol associated with it.
5580         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5581         defined symbol for entry point to avoid cancellation.
5582         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5584 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5586         * Makefile (tests): Add tst-tls5.
5587         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5588         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5589         ($(objpfx)tst-tls5): New.
5590         ($(objpfx)tst-tls6.out): Likewise.
5591         (tests): Depend on $(objpfx)tst-tls6.out.
5592         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5593         (do_test): Check pthread_self () return value alignment.
5594         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5595         (tf): Check pthread_self () return value alignment.
5596         * tst-tls5.c: New test.
5597         * tst-tls5.h: New.
5598         * tst-tls5mod.c: New.
5599         * tst-tls5moda.c: New.
5600         * tst-tls5modb.c: New.
5601         * tst-tls5modc.c: New.
5602         * tst-tls5modd.c: New.
5603         * tst-tls5mode.c: New.
5604         * tst-tls5modf.c: New.
5605         * tst-tls6.sh: New test.
5607         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5608         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5609         * init.c (pthread_functions): Initialize them.
5610         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5611         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5612         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5613         pthread_cond_timedwait@@GLIBC_2.3.2.
5615 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5617         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5618         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5619         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5620         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5621         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5622         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5624         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5626         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5627         _POSIX_THREAD_PRIORITY_SCHEDULING.
5628         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5630 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5632         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5633         nested function, use static inline function from libio.h.
5634         Code by Richard Henderson.
5636         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5637         weak.
5639 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5641         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5642         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5643         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5644         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5645         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5646         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5647         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5648         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5649         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5650         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5651         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5652         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5653         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5654         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5655         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5656         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5657         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5658         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5659         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5660         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5661         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5662         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5663         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5664         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5665         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5666         * sysdeps/sparc/tls.h: New file.
5667         * sysdeps/sparc/tcb-offsets.sym: New file.
5668         * sysdeps/sparc/Makefile: New file.
5669         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5670         * init.c [__sparc__] (__NR_set_tid_address): Define.
5672 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5674         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5675         _IO_release_lock): Define.
5677 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5679         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5680         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5682 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5684         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5685         (__pthread_cleanup_class): Add missing return types of member
5686         functions.
5688 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5690         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5691         (lll_mutex_unlock_force): Add memory barrier between store and futex
5692         syscall.
5694 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5696         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5697         tempmsg in first loop.
5699 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5701         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5702         _POSIX_THREAD_PRIORITY_SCHEDULING.
5703         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5705 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5707         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5708         (__rtld_lock_default_lock_recursive,
5709         __rtld_lock_default_unlock_recursive): Define.
5710         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5711         __rtld_lock_unlock_recursive): Define using
5712         GL(_dl_rtld_*lock_recursive).
5713         * init.c (__pthread_initialize_minimal_internal): Initialize
5714         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5715         Lock GL(_dl_load_lock) the same number of times as
5716         GL(_dl_load_lock) using non-mt implementation was nested.
5718         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5719         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5721 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5723         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5724         PIPE_BUF.
5726 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5728         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5730 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5732         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5733         to first syscall error check.  Move syscall error check for tkill
5734         into __ASSUME_CLONE_STOPPED #ifdef.
5736 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5738         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5739         is not defined, do explicit synchronization.
5740         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5741         is not defined also unlock pd->lock for non-debugging case in case
5742         it is necessary.
5743         * pthread_create.c (start_thread): Always get and release pd->lock
5744         if __ASSUME_CLONE_STOPPED is not defined.
5745         (start_thread_debug): Removed.  Adjust users.
5746         * allocatestack.c (allocate_stack): Always initialize lock if
5747         __ASSUME_CLONE_STOPPED is not defined.
5748         * Makefile (tests): Add tst-sched1.
5749         * tst-sched1.c: New file.
5751         * sysdeps/pthread/createthread.c (do_clone): Only use
5752         sched_setschduler and pass correct parameters.
5754 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5756         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
5757         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
5758         PTHREAD_STACK_MIN in comments.
5760 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5762         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5763         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
5764         argument.
5765         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
5766         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
5767         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
5768         (__pthread_cleanup_upto): Fix prototype.
5769         (_longjmp_unwind): Adjust caller.
5770         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
5771         Change second argument to const struct pointer.
5772         * tst-sem8.c (main): Remove unused s2 and s3 variables.
5773         * tst-sem9.c (main): Likewise.
5774         * unwind.c: Include string.h for strlen prototype.
5776 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
5778         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5779         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
5780         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
5781         Define HAVE_CMOV.
5782         Patch by Nicholas Miell <nmiell@attbi.com>.
5784 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
5786         * init.c (__pthread_initialize_minimal_internal): Initialize
5787         GL(dl_init_static_tls).
5788         * pthreadP.h (__pthread_init_static_tls): New prototype.
5789         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
5790         New functions.
5791         * Makefile (tests): Add tst-tls4.
5792         (modules-names): Add tst-tls4moda and tst-tls4modb.
5793         ($(objpfx)tst-tls4): Link against libdl and libpthread.
5794         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
5795         tst-tls4modb.so.
5796         * tst-tls4.c: New file.
5797         * tst-tls4moda.c: New file.
5798         * tst-tls4modb.c: New file.
5800 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
5802         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
5803         before __timer_dealloc.
5804         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
5805         Don't call list_unlink.
5807 2003-07-29  Roland McGrath  <roland@redhat.com>
5809         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
5811 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
5813         * tst-cancel17.c (do_test): Check if aio_cancel failed.
5814         Don't reuse struct aiocb A if it failed.
5815         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
5816         not just one byte, as that does not block.
5818 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
5820         * sysdeps/pthread/unwind-resume.c: New file.
5821         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
5822         unwind-resume in csu subdir.
5823         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
5824         exceptions.
5825         (librt-sysdep_routines, librt-shared-only-routines): Add
5826         rt-unwind-resume.
5827         * sysdeps/pthread/rt-unwind-resume.c: New file.
5828         * unwind-forcedunwind.c: New file.
5829         * Makefile (libpthread-routines): Add unwind-forcedunwind.
5830         (libpthread-shared-only-routines): Likewise.
5831         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
5832         * pthreadP.h (pthread_cancel_init): New prototype.
5833         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
5835         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
5836         attr argument const struct pthread_attr *.
5838         * res.c (__res_state): Return __resp.
5839         * descr.h: Include resolv.h.
5840         (struct pthread): Add res field.
5841         * pthread_create.c: Include resolv.h.
5842         (start_thread): Initialize __resp.
5843         * Makefile (tests): Add tst-_res1.
5844         (module-names): Add tst-_res1mod1, tst-_res1mod2.
5845         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
5846         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
5847         libpthread.
5848         * tst-_res1.c: New file.
5849         * tst-_res1mod1.c: New file.
5850         * tst-_res1mod2.c: New file.
5852 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
5854         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
5856         * Makefile: Define various *-no-z-defs variables for test DSOs
5857         which has undefined symbols.
5859 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
5861         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
5862         Retry if the stwcx fails to store once_control.
5864 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
5866         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
5867         pthread_attr_setaffinity.
5868         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
5869         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
5870         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
5871         * pthread_attr_destroy.c: Free cpuset element if allocated.
5872         * pthread_create.c: Pass iattr as additional parameter to
5873         create_thread.
5874         * sysdeps/pthread/createthread.c: If attribute is provided and
5875         a new thread is created with affinity set or scheduling parameters,
5876         start thread with CLONE_STOPPED.
5877         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
5878         pthread_attr_setaffinity.
5879         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5880         cpuset element.
5882 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
5884         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
5886 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
5888         * sysdeps/pthread/configure.in: Require CFI directives also for
5889         ppc and s390.
5891 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
5893         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5894         Add cfi directives.
5896 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5898         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
5899         CLEANUP_JMP_BUF.
5900         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
5901         registers as variables.  Call __pthread_mutex_unlock_usercnt.
5902         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5903         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
5904         not self pointer in __writer.  Compare with TID to determine
5905         deadlocks.
5906         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5907         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
5908         Likewise.
5909         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
5910         Likewise.
5911         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
5912         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5913         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
5914         macros also when compiling librt.
5916 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
5918         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
5919         -fasynchronous-unwind-tables.
5920         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
5921         (PSEUDO): Add cfi directives.
5922         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
5923         Likewise.
5924         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5925         Likewise.
5927 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
5929         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
5930         __pthread_unregister_cancel): Add prototypes and hidden_proto.
5931         * unwind.c (__pthread_unwind_next): Add hidden_def.
5932         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
5933         Likewise.
5934         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
5935         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5936         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
5937         Likewise.
5938         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
5939         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
5940         Likewise.
5941         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
5942         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
5943         __pthread_unregister_cancel and __pthread_unwind_next.
5945 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
5947         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
5948         different symbol for the cancellation syscall wrapper and
5949         non-cancellation syscall wrapper.
5950         (PSEUDO_END): Define.
5952 2003-07-05  Richard Henderson  <rth@redhat.com>
5954         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
5955         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
5956         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
5957         return actual return value from the syscall, not 0.
5959 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
5961         * descr.h (struct pthread): Add pid field.
5962         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
5963         (__reclaim_stacks): Likewise.
5964         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
5965         also check for PID of the signal source.
5966         (__pthread_initialize_minimal_internal): Also initialize pid field
5967         of initial thread's descriptor.
5968         * pthread_cancel.c: Use tgkill instead of tkill if possible.
5969         * sysdeps/unix/sysv/linux/fork.c: Likewise.
5970         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
5971         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5972         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5974 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
5976         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
5977         Fix use of parameter.
5978         (__libc_cleanup_pop): Likewise.
5980 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
5982         * init.c (sigcancel_handler): Change parameters to match handler
5983         for SA_SIGACTION.  Check signal number and code to recognize
5984         invalid invocations.
5986 2003-07-03  Roland McGrath  <roland@redhat.com>
5988         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
5989         Apply sizeof (struct pthread) bias to r13 value.
5991 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
5993         * sysdeps/pthread/configure.in: Require CFI directives.
5995         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
5996         definition.
5997         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
5998         libpthread compilation.
5999         * unwind.c (__pthread_unwind): Add hidden_def.
6000         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6002 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6004         * libc-cancellation.c (__libc_cleanup_routine): Define.
6005         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6006         (__pthread_cleanup_pop): Define.
6008 2003-07-01  Richard Henderson  <rth@redhat.com>
6010         * sysdeps/alpha/elf/pt-initfini.c: New file.
6011         * sysdeps/alpha/pthread_spin_lock.S: New file.
6012         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6013         * sysdeps/alpha/pthreaddef.h: New file.
6014         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6015         * sysdeps/alpha/tls.h: New file.
6016         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6017         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6018         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6019         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6020         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6021         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6022         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6023         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6024         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6025         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6027 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6029         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6030         cleanup support and unwind info.
6032 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6034         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6035         Use correct cleanup handler registration.  Add unwind info.
6036         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6037         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6038         * tst-once3.c: Add cleanup handler and check it is called.
6039         * tst-once4.c: Likewise.
6040         * tst-oncex3.c: New file.
6041         * tst-oncex4.c: New file.
6042         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6044 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6046         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6048 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6050         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6051         (tf_msgsnd): Likewise.
6053         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6054         premature returns a bit more.
6056 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6058         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6059         definition to the front.
6061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6062         the cleanup functions to make the names unique.  Fix dwarf opcode
6063         un unwind table.
6064         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6065         functions to make the names unique.  Fix CFA offset for two blocks.
6067 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6069         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6070         missing closing braces.
6071         Patch by Christophe Saout <christophe@saout.de>.
6073 2003-06-24  Roland McGrath  <roland@redhat.com>
6075         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6077 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6079         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6080         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6082         * pthreadP.h: Declare __find_thread_by_id.
6083         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6084         * pthread_clock_gettime.c: Allow using other thread's clock.
6085         * pthread_clock_settime.c: Likewise.
6086         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6087         * Makefile: Add rules to build and run tst-clock2.
6088         * tst-clock2.c: New file.
6090 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6092         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6093         to use exception-based cleanup handler.
6094         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6096         * tst-cond8.c (ch): Announce that we are done.
6098         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6100         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6101         Also test aio_suspend with timeout value.
6103 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6105         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6106         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6107         attribute_hidden.
6109         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6110         (__pthread_mutex_lock_internal): Likewise.
6111         (__pthread_mutex_unlock_internal): Likewise.
6112         (__pthread_mutex_unlock_usercnt): Declare.
6113         * pthread_mutex_destroy.c: Always fail if used in any way.
6114         * pthread_mutex_init.c: Update comment.
6115         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6116         * pthread_mutex_timedlock.c: Adjust __nusers.
6117         * pthread_mutex_trylock.c: Adjust __nusers.
6118         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6119         and public interfaces are wrapper with pass additional parameter.
6120         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6121         parameter zero.
6122         * tst-mutex8.c: New file.
6123         * Makefile (tests): Add tst-mutex8.
6124         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6125         __pthread_mutex_unlock_usercnt.
6126         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6127         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6128         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6129         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6130         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6131         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6132         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6133         Add __nusers.
6134         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6135         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6136         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6137         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6138         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6140         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6141         * pthread_mutex_timedlock.c: Likewise.
6142         * pthread_mutex_trylock.c: Adjust __nusers.
6143         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6144         * tst-mutex9.c: New file.
6145         * Makefile (tests): Add tst-mutex9.
6146         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6147         * sysdeps/ia64/tls.h: Likewise.
6148         * sysdeps/powerpc/tls.h: Likewise.
6149         * sysdeps/s390/tls.h: Likewise.
6150         * sysdeps/sh/tls.h: Likewise.
6151         * sysdeps/x86_64/tls.h: Likewise.
6152         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6153         Change type of __owner.
6154         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6155         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6156         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6157         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6158         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6160 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6162         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6163         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6165         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6166         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6167         instead of nr to lll_futex_wake.  Only set errno and return -1
6168         if err < 0.
6170         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6171         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6172         return actual return value from the syscall, not 0.
6174 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6176         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6177         find a random value.
6178         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6179         errno==EIDRM.
6181         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6182         compat_timer_settime.
6183         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6184         compat_timer_gettime.
6185         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6186         compat_timer_getoverrun.
6187         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6188         compat_timer_delete.
6190         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6191         error-checking mutex detect busy mutexes.
6193 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6195         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6196         Add ax to clobber list.
6197         (lll_mutex_cond_lock): Likewise.
6198         (lll_mutex_unlock): Likewise.
6199         (lll_lock): Likewise.
6200         (lll_unlock): Likewise.
6202         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6203         * tst-cancel18.c: New file.
6204         * tst-cancelx18.c: New file.
6206         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6207         and tcdrain.
6209         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6210         * tst-cancel17.c: New file.
6211         * tst-cancelx17.c: New file.
6213         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6214         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6215         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6217         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6219 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6221         * sysdeps/pthread/createthread.c (create_thread): Set
6222         header.multiple_threads unconditionally.
6223         * allocatestack.c (allocate_stack): Likewise.
6224         * descr.h (struct pthread): Add header.multiple_threads
6225         unconditionally.
6226         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6227         Define for librt.  #error if neither libpthread, libc nor librt.
6228         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6229         Likewise.
6230         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6231         CDISABLE): Likewise.
6232         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6233         CDISABLE): Likewise.
6234         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6235         CDISABLE): Likewise.
6236         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6237         CDISABLE): Likewise.  Access header.multiple_threads outside of
6238         libc and libpthread.
6239         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6240         Likewise.
6241         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6242         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6244 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6246         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6247         Also test early cancellation before the thread reaches the cancellation
6248         point.
6250         * Makefile: Compile forward.c with exceptions.
6252         * sysdeps/unix/sysv/linux/sleep.c: New file.
6254 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6256         * Makefile: Add CFLAGS definition to compile function wrappers
6257         duplicated from libc with exceptions.
6258         * tst-cancel4.c: Also check cancellation handlers.
6260         * Makefile: Add rules to build and run tst-cancel16 and
6261         tst-cancelx16.  Add missing CFLAGS definitions.
6262         * tst-cancel16.c: New file.
6263         * tst-cancelx16.c: New file.
6265 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6267         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6268         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6269         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6270         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6272         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6273         (LIBC_CANCEL_RESET): Likewise.
6274         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6275         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6276         librt-cancellation.
6277         (CFLAGS-libcrt-cancellation.c): Define.
6278         * sysdeps/pthread/librt-cancellation.c: New file.
6279         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6280         macros also when compiling librt.
6281         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6282         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6283         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6284         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6285         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6286         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6287         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6289         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6290         compat_timer_create.
6292 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6294         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6296         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6297         __register_atfork.
6298         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6299         Add libc_hidden_def.
6301 2003-06-13  Roland McGrath  <roland@redhat.com>
6303         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6304         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6306 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6308         * allocatestack.c (queue_stack): Always inline.
6309         * ptreadhP.h (__do_cancel): Likewise.
6311 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6313         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6314         a typo.
6316 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6318         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6319         (__pthread_cond_signal): Remove incorrect second addition for
6320         cond_lock!=0.
6322 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6324         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6325         (__pthread_cond_signal): Use correct futex pointer in
6326         __lll_mutex_lock_wait call.
6328         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6329         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6331 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6333         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6334         cancelable.
6335         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6336         Likewise.
6338         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6339         hand-written CFI generation code.  Since ENTRY/END also initiated
6340         CFI frames this caused two CFI sets to be generated.
6342 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6344         * cleanup_routine.c: New file.
6345         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6346         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6347         cleanup handling.
6348         * Makefile (libpthread-routines): Add cleanup_routine.
6349         Add more CFLAGS variables to compile with exceptions.  Add comments
6350         why which file needs unwind tables.
6351         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6352         tests.
6353         * tst-cancelx1.c: New file.
6354         * tst-cancelx2.c: New file.
6355         * tst-cancelx3.c: New file.
6356         * tst-cancelx4.c: New file.
6357         * tst-cancelx5.c: New file.
6358         * tst-cancelx6.c: New file.
6359         * tst-cancelx7.c: New file.
6360         * tst-cancelx8.c: New file.
6361         * tst-cancelx9.c: New file.
6362         * tst-cancelx10.c: New file.
6363         * tst-cancelx11.c: New file.
6364         * tst-cancelx12.c: New file.
6365         * tst-cancelx13.c: New file.
6366         * tst-cancelx14.c: New file.
6367         * tst-cancelx15.c: New file.
6368         * tst-cleanupx0.c: New file.
6369         * tst-cleanupx0.expect: New file.
6370         * tst-cleanupx1.c: New file.
6371         * tst-cleanupx2.c: New file.
6372         * tst-cleanupx3.c: New file.
6374         * tst-cleanup0.c: Make standard compliant.
6375         * tst-cleanup1.c: Likewise.
6377         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6378         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6379         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6380         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6381         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6382         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6383         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6384         CLEANUP_JMP_BUF.
6385         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6386         * tst-cancel12.c: New file.
6387         * tst-cancel13.c: New file.
6388         * tst-cancel14.c: New file.
6389         * tst-cancel15.c: New file.
6390         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6391         and tst-cancel15.
6393         * tst-cancel1.c: Add some comments.
6395         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6396         timeout correctly.
6398 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6400         * Makefile (CFLAGS-pthread_cancel.c): Define.
6402 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6404         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6405         Change type of __writer element to int.
6406         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6407         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6408         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6409         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6410         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6411         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6412         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6413         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6414         Compare with TID to determine deadlocks.
6415         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6416         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6417         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6418         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6419         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6420         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6421         Likewise.
6422         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6423         Likewise.
6424         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6425         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6426         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6427         Likewise.
6428         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6429         Likewise.
6430         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6431         * Makefile (tests): Add tst-rwlock12.
6432         * tst-rwlock12.c: New file.
6434 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6436         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6437         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6438         Remove bogus hidden_proto.
6439         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6440         Likewise.
6441         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6442         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6443         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6444         ___lll_mutex_timedlock): Likewise.
6446 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6448         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6449         (__pthread_cond_signal): Add some code to eventually handle
6450         cond_lock!=0.
6452 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6454         * Makefile (tests): Add tst-exec4.
6455         (tst-exec4-ARGS): Define.
6456         * tst-exec4.c: New file.
6458 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6460         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6461         Also fail if tv_nsec < 0.
6462         (__lll_timedwait_tid): Likewise.
6463         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6464         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6465         Likewise.
6466         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6467         Likewise.
6468         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6469         Likewise.
6470         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6471         Likewise.
6472         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6473         Likewise.
6474         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6475         Likewise.
6477         * Makefile (tests): Add tst-sem8 and tst-sem9.
6478         * tst-sem8.c: New file.
6479         * tst-sem9.c: New file.
6480         * sem_open.c: Fix creation of in_use record if the file exists but
6481         no internal record.
6483         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6484         definitions.
6486         * sysdeps/pthread/timer_create.c (timer_create): In case
6487         evp==NULL, assign timer ID to sival_ptr.
6489         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6490         struct pthread_unwind_buf *.
6491         (struct pthread): Likewise for cleanup_jmp_buf element.
6493         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6494         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6495         * unwind.c (__pthread_unwind_next): Likewise.
6497 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6499         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6500         (lll_futex_timed_wait): Use int for futex value parameter.
6501         (lll_futex_wake): Likewise.
6502         (lll_futex_requeue): Likewise.
6504         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6505         Replace one memory operation with one register operation.
6507         * tst-join4.c (do_test): Fix error message.
6509         * tst-rwlock6.c (do_test): Use correct format specifier.
6511         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6512         (__lll_mutex_lock_wait): Replace one memory operation with one
6513         register operation.
6514         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6515         (__lll_mutex_lock_wait): Likewise.
6517         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6518         (__lll_mutex_cond_lock): Add one to value parameter of
6519         __lll_lock_wait to reflect reality in the futex syscall.
6520         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6521         (lll_mutex_cond_lock): Likewise.
6523 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6525         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6526         New function.
6527         (lll_mutex_cond_lock): Define.
6529 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6531         * Makefile (tests): Add tst-signal6.
6532         * tst-signal6.c: New file.
6534         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6535         (__lll_mutex_unlock_force): New function
6536         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6538         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6539         (__lll_mutex_unlock_force): New function.
6540         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6542         * tst-rwlock7.c (do_test): Use correct format specifier.
6544         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6545         Find break parameter in correct asm argument.
6547 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6549         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6550         Remove out4.
6551         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6552         error occured.
6553         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6554         Add __mutex.
6555         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6556         lll_futex_requeue, lll_mutex_unlock_force): Define.
6558 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6560         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6561         (pthread_cond_t): Add __mutex.
6562         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6563         lll_futex_requeue, lll_mutex_unlock_force): Define.
6565 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6567         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6568         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6569         Add __mutex field.
6570         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6571         Define.
6572         (lll_futex_wait, lll_futex_wake): Define.
6573         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6574         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6575         FUTEX_REQUEUE instead of FUTEX_WAIT.
6576         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6577         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6578         mutex which was used in condvar structure.  Call
6579         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6580         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6582         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6583         include tcb-offsets.h.  Read wakeup value in locked region.
6584         Use the value of gbr register as THREAD_ID.
6585         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6586         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6587         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6589         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6590         macros.
6592 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6594         * sysdeps/pthread/pthread_cond_broadcast.c
6595         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6597 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6599         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6600         typo in register name.
6601         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6602         correctly.  Actually use requeue.  Little optimization.
6603         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6604         mutex address early.  Handle cancellation state as 32-bit value.
6605         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6606         Remove unnecessary label.
6608 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6610         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6611         instead of FUTEX_WAIT.
6612         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6613         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6615         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6616         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6617         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6618         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6619         of __pthread_mutex_lock_internal.
6620         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6621         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6622         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6623         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6624         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6625         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6626         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6627         Add pthread_mutex_cond_lock.
6628         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6629         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6630         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6631         lll_mutex_cond_lock.
6632         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6633         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6634         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6635         Add __mutex field.
6636         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6637         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6639         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6640         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6642         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6643         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6644         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6645         macro don't define aliases.
6647         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6648         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6649         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6650         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6651         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6652         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6653         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6654         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6655         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6657 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6659         * sem_open.c: Fix one endless loop.  Implement correct semantics
6660         wrt opening the same semaphore more then once.
6661         * sem_close.c: Adjust for sem_open change.
6662         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6663         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6664         * Makefile (tests): Add tst-sem7.
6665         * tst-sem7.c: New file.
6667 2003-05-16  Roland McGrath  <roland@redhat.com>
6669         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6670         uninitialized variable braino.
6672 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6674         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6675         test for syscall availability.
6677         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6678         __no_posix_timers to -1 if the syscalls don't exist.
6680         * pthread_join.c (pthread_join): Set tid field of the joined
6681         thread to -1.  This isn't necessary but helps to recognize some
6682         error conditions with almost no cost.
6684         * allocatestack.c (FREE_P): Also negative values indicate an
6685         unused stack.
6687         * unwind.c: Include <unistd.h>.
6689 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6691         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6693 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6695         * Makefile (crti-objs, crtn-objs): New variables.
6696         (omit-deps, extra-objs): Add crtn.
6697         ($(objpfx)libpthread.so): Depend on both crti and crtn
6698         and links to them in multidir.
6699         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6701 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6703         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6704         (lll_mutex_unlock): Use atomic_exchange_rel.
6706 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6708         * cond-perf.c (cons): Add missing locking around setting of alldone.
6710 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6712         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6713         related macros.
6714         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6716 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6718         * tst-sem6.c: New file.
6719         * Makefile (tests): Add tst-sem6.
6721         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6722         Use atomic_exchange_rel instead of atomic_exchange.
6723         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6724         Likewise.
6726         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6727         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6728         vsyscall is possible.
6730         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6731         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6732         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6733         pthread_setaffinity_np.
6734         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6735         and pthread_setaffinity_np.
6736         * Makefile (libpthread-routines): Add pthread_getaffinity and
6737         pthread_setaffinity.
6739         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6740         use it in case mmap to allocate the stack fails.
6741         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6742         ARCH_MAP_FLAGS here.
6743         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6744         ARCH_RETRY_MMAP.
6746 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6748         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6749         handler implementation.  It is now lockless in fork().
6750         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6751         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6752         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6753         declare the __fork_*_lists.
6754         (struct fork_handler): Include pointers to all three functions.
6755         Add next, refcntr and need_signal elements.
6756         (__fork_handlers): New declaration.
6757         (__register_atfork_malloc): Remove declaration.
6758         (HAVE_register_atfork_malloc): Remove definition.
6759         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
6760         __pthread_child_handler variable.
6761         (__libc_pthread_init): Use __register_atfork instead of explicitly
6762         adding to the list.
6763         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
6764         and lll_futex_wake.
6765         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6767         * unwind.c (unwind_cleanup): Print error message and then abort.  This
6768         function must never be reached.
6770         * cond-perf.c: New file.
6772 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
6774         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
6776 2003-05-04  Roland McGrath  <roland@redhat.com>
6778         * Makefile ($(objpfx)../libc.so): New target.
6780 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
6782         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6783         (pthread_condattr_t): Size is only an int, don't use long for
6784         alignment.
6785         (pthread_mutexattr_t): Likewise.
6786         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6787         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6788         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6790 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
6792         * sysdeps/i386/tls.h: Define THREAD_ID.
6793         * sysdeps/ia64/tls.h: Likewise.
6794         * sysdeps/powerpc/tls.h: Likewise.
6795         * sysdeps/s390/tls.h: Likewise.
6796         * sysdeps/sh/tls.h: Likewise.
6797         * sysdeps/x86_64/tls.h: Likewise.
6798         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
6799         record ownership.
6800         * pthread_mutex_timedlock.c: Likewise.
6801         * pthread_mutex_trylock.c: Likewise.
6802         * pthread_mutex_unlock.c: Likewise.
6803         * pthread_rwlock_trywrlock.c: Likewise.
6804         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
6805         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6806         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6807         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6809         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
6810         flag.
6812 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
6814         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6815         (__SIZEOF_PTHREAD_COND_T): Define to 48.
6816         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
6817         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6818         Make __align long long instead of long.
6819         (pthread_rwlock_t): Formatting.
6820         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
6821         (pthread_rwlock_t): Formatting.
6822         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6823         (pthread_cond_t): Make __align long long instead of long.
6824         (pthread_rwlock_t): Move __flags field to the same position as in
6825         linuxthreads.
6827 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
6829         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
6830         * tst-rwlock7.c (do_test): Likewise.
6832 2003-04-26  Roland McGrath  <roland@redhat.com>
6834         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
6836 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
6838         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
6839         sizeof (struct pthread).
6840         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
6841         1 struct pthread.
6842         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
6843         to 0.
6844         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
6845         struct pthread.
6846         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
6847         to 32-bit bytes.
6848         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
6849         tcbp.
6850         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
6851         unneccessarily.
6852         (NO_TLS_OFFSET): Define.
6853         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
6854         add TLS_TCB_SIZE unnecessarily.
6856 2003-04-22  Roland McGrath  <roland@redhat.com>
6858         * Makeconfig (shared-thread-library): Reverse link order to work
6859         around linker bug.
6861 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
6863         * semaphore.h: Fix typo in comment.
6865 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
6867         * sysdeps/pthread/sigfillset.c: New file.
6869         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
6870         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
6871         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
6872         * sysdeps/pthread/sigaction.c: Likewise.
6873         * sysdeps/pthread/sigprocmask.c: New file.
6874         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
6875         __SIGRTMIN+1.
6876         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
6877         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
6878         in this case.
6880 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
6882         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6883         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
6885         * sysdeps/unix/sysv/linux/unregister-atfork.c
6886         (__unregister_atfork): Don't free memory not allocated dynamically.
6888         * semaphore.h: Remove __THROW marker from cancellation points.
6889         * nptl/sysdeps/pthread/pthread.h: Likewise.
6891 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
6893         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
6894         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
6895         __THROW.
6897 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
6899         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
6901 2003-04-15  Roland McGrath  <roland@redhat.com>
6903         * forward.c (__pthread_unwind): Tweak to avoid warning.
6905 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
6907         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
6909 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
6911         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
6912         overflow CFA advance instructions.
6913         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6915 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
6917         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
6918         * sysdeps/i386/pthread_spin_lock.c: Likewise.
6919         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
6920         defined.
6922         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
6923         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
6924         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
6925         DW_CFA_advance_loc for .Laddl-.Lsubl.
6927 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
6929         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
6930         position-independent unwind data for static libraries.
6931         Add missing unwind info.  Add comments.
6933         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
6934         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6935         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6936         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6938 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
6940         * Makefile: Make sure all cancellation points are compiled with
6941         exception and asynchronous unwind tables.
6943         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
6944         which mishandles loading of global object addresses in PIC.
6945         (THREAD_SETMEM_NC): Likewise.
6947 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
6949         * pthread.h: Define new data structure for cleanup buffer.  Declare
6950         new cleanup handler interfaces.
6951         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
6952         (struct pthread): Add cleanup_jmp_buf pointer.  Define
6953         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
6954         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
6955         it.  Declare old cleanup handler installation functions.
6956         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
6957         handling.
6958         * cleanup_defer.c: Likewise.
6959         * cleanup_compat.c: New file.  Old cleanup code.
6960         * cleanup_def_compat.c: New file.  Old cleanup code.
6961         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
6962         if own thread descriptor.
6963         * unwind.c: New file.
6964         * forward.c: Add __pthread_unwind.
6965         * init.c (pthread_functions): Add __pthread_unwind.
6966         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
6967         Add ptr___pthread_unwind.
6968         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
6969         and unwind function.
6970         * Makefile (libpthread-routines): Add cleanup_compat,
6971         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
6972         table generation if necessary.
6973         * version.c: Record whether unwind support is compiled in.
6974         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
6975         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
6976         handler interfaces.
6977         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
6978         complication to generate unwind information for syscall wrappers.
6979         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6980         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
6981         __cleanup_fct_attribute.
6983         * Makefile: Add rules to build and run tst-cleanup0.
6984         * tst-cleanup0.c: New file.
6985         * tst-cleanup0.expect: New file.
6987         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
6988         caller.  Optimize to avoid often unecessary local variable.
6990 2003-04-11  Roland McGrath  <roland@redhat.com>
6992         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
6993         sets variable `multidir'; include that.
6994         (generated): Add it.
6995         ($(objpfx)$(multidir)/crti.o): New target.
6996         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
6998 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7000         * tst-attr2.c (do_test): Add cast to avoid warning.
7001         * tst-mutex4.c (do_test): Likewise.
7003 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7005         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7006         in child.
7008 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7010         * Makefile (tests): Add tst-detach1.
7011         * tst-detach1.c: New file.
7013 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7015         * sysdeps/pthread/pthread.h: Remove duplicate
7016         pthread_cleanup_{push,pop} definitions.
7018         * tst-barrier2.c: Eliminate warnings.
7019         * tst-cancel4.c: Likewise.
7020         * tst-cond4.c: Likewise.
7021         * tst-cond6.c: Likewise.
7022         * tst-detach1.c: Likewise.
7023         * tst-rwlock4.c: Likewise.
7024         * tst-rwlock6.c: Likewise.
7025         * tst-rwlock7.c: Likewise.
7026         * tst-sem3.c: Likewise.
7027         * tst-spin2.c: Likewise.
7028         * tst-umask1.c: Likewise.
7030 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7032         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7034 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7036         * descr.h (struct pthread): Move cancelhandling member to the front.
7038 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7040         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7041         malloc_parent, and malloc_child statically.
7042         (__register_atfork_malloc): New function.
7043         (free_mem): Don't free any of the malloc_* variables on the list.
7044         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7045         Define HAVE_register_atfork_malloc.
7047 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7049         * sysdeps/pthread/createthread.c (create_thread): Add some more
7050         comments explaining when to set multiple_threads and when not.
7052         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7053         THREAD_ATOMIC_BIT_SET if not already defined.
7054         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7055         THREAD_ATOMIC_BIT_SET:
7056         * sysdeps/x86_64/tls.h: Likewise.
7057         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7058         THREAD_ATOMIC_CMPXCHG_VAL.
7059         (_pthread_cleanup_pop_restore): Likewise.
7060         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7061         (__pthread_enable_asynccancel_2): Likewise.
7062         (__pthread_disable_asynccancel): Likewise.
7063         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7064         (__libc_disable_asynccancel): Likewise.
7065         * init.c (sigcancel_handler): Likewise.
7066         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7067         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7069 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7071         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7072         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7073         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7074         * Makefile (tests): Add tst-cancel11.
7075         * tst-cancel11.c: New file.
7077 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7079         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7080         round, not the first.  Use specific_used flag instead of local
7081         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7082         (__free_tcb): Don't call deallocate_tsd here.
7083         (start_thread): Call deallocate_tsd here.
7084         * pthread_setspecific.c: Set specific_used flag really only when
7085         needed.
7086         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7087         * tst-tsd3.c: New file.
7088         * tst-tsd4.c: New file.
7090 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7092         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7093         Use atomic_exchange_and_add instead of __lll_add.
7094         (__lll_mutex_timedlock): Likewise.
7095         Patch by Ian Wienand.
7097 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7099         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7100         (SINGLE_THREAD_P): Fix typo.
7101         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7103 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7105         * Makefile (tests): Add tst-align.
7106         * tst-align.c: New file.
7107         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7109         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7110         function correctly.
7112         * tst-tsd2.c: Add casts to avoid warnings.
7114 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7116         * descr.h (struct pthread): Move most often used elements to the front.
7118 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7120         * Makefile (libpthread-routines): Add pthread_atfork.
7121         (libpthread-static-only-routines): Add pthread_atfork.
7123 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7125         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7126         of TLS_DTV_AT_TP.
7127         (INSTALL_DTV): Add parens.
7128         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7129         Use passed descr instead of THREAD_SELF.
7130         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7131         (__lll_mutex_timedlock_wait): Correct expected value after
7132         spurious wakeup.
7133         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7134         Release lock before waking up the waiters.
7135         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7136         criteria.  Reorderstruct passed to cleanup handler.  Fix
7137         handling of cancellation and failung pthread_mutex_unlock call.
7138         Use __pthread_enable_asynccancel_2 instead of
7139         __pthread_enable_asynccancel.
7140         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7141         Return result of lock re-get if it fails.
7142         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7143         for __pthread_cleanup_push.
7144         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7145         completely broken rwlock implementation.
7146         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7147         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7148         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7149         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7150         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7151         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7152         versioned_symbol macro.
7153         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7154         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7156 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7158         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7159         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7160         and __helper_tid.
7161         (struct timer): Remove th and bar field.
7162         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7163         debugging code.  Create only one helper thread.
7164         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7165         helper thread.
7166         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7167         Renamed.  Define statically.  Use thread info from siginfo.
7168         (__helper_once): New variable.
7169         (__helper_tid): New variable.
7170         (__reset_helper_control): New function.
7171         (__start_helper_thread): New function.
7173         * pthread_create.c (start_thread): Don't use setjmp inside
7174         __builtin_expect to work around gcc bug.
7176         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7177         timer_delete syscall fails, but not with ENOSYS, set
7178         __no_posix_timers.
7180         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7181         (timer_settime): Fix typo.
7182         * sysdeps/unix/sysv/linux/timer_getoverr.c
7183         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7185 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7187         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7188         offset of cleanupbuf.__prev.
7190 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7192         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7193         of included file.
7195 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7197         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7198         NULL provide default definition to syscall.
7200 2003-03-25  Roland McGrath  <roland@redhat.com>
7202         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7203         (timer_id2ptr): Fix typo.
7205 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7207         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7208         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7209         * sysdeps/ia64/pthreaddef.h: Likewise.
7210         * sysdeps/powerpc/pthreaddef.h: Likewise.
7211         * sysdeps/s390/pthreaddef.h: Likewise.
7212         * sysdeps/sh/pthreaddef.h: Likewise.
7213         * sysdeps/x86_64/pthreaddef.h: Likewise.
7214         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7215         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7216         being changed.
7217         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7218         SIGTIMER is not unblocked.
7219         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7220         RT signal taken.
7221         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7222         be send.
7223         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7224         pass pointer through as ID.
7225         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7226         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7227         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7228         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7229         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7230         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7231         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7232         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7233         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7234         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7235         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7236         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7237         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7238         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7239         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7240         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7241         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7242         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7243         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7244         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7245         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7246         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7247         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7248         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7249         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7250         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7251         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7252         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7253         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7254         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7255         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7256         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7257         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7259         * pthreadP.h: Remove FRAME_LEFT definition.
7260         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7261         already left frame.  Programs which have this problem are not POSIX
7262         compliant.
7263         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7265 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7267         * sysdeps/pthread/tst-timer.c: Check return values of the
7268         functions we test.
7270 2003-03-23  Roland McGrath  <roland@redhat.com>
7272         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7273         * tst-tls3mod.c: Likewise.
7274         * tst-tls1.c: Likewise.
7275         * tst-tls2.c: Likewise.
7277         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7278         undefined behavior.
7280         * tst-join5.c (tf1, tf2): Add a cast.
7282         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7284         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7285         Don't test anything.
7286         * tst-cond4.c: Likewise.
7287         * tst-cond6.c: Likewise.
7288         * tst-flock2.c: Likewise.
7289         * tst-mutex4.c: Likewise.
7290         * tst-rwlock4.c: Likewise.
7291         * tst-signal1.c: Likewise.
7292         * tst-spin2.c: Likewise.
7293         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7295         * tst-mutex4.c: Use test-skeleton.c.
7296         * tst-spin2.c: Likewise.
7297         * tst-sysconf.c: Likewise.
7298         * tst-barrier2.c: Likewise.
7299         * tst-cond4.c: Likewise.
7300         * tst-cond6.c: Likewise.
7301         * tst-rwlock4.c: Likewise.
7302         * tst-unload.c: Likewise.
7303         * tst-flock2.c (do_test): Use return instead of exit.
7305 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7307         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7309 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7311         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7312         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7313         instead of __lll_compare_and_swap.
7314         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7315         Likewise.
7316         Removed definition if __lll_compare_and_swap.
7318         * cancellation.c: Adjust for new form of compare&exchange macros.
7319         * cleanup_defer.c: Likewise.
7320         * init.c: Likewise.
7321         * libc-cancellation.c: Likewise.
7322         * old_pthread_cond_broadcast.c: Likewise.
7323         * old_pthread_cond_signal.c: Likewise.
7324         * old_pthread_cond_timedwait.c: Likewise.
7325         * old_pthread_cond_wait.c: Likewise.
7326         * pthread_cancel.c: Likewise.
7327         * pthread_create.c: Likewise.
7328         * pthread_detach.c: Likewise.
7329         * pthread_join.c: Likewise.
7330         * pthread_key_delete.c: Likewise.
7331         * pthread_setcancelstate.c: Likewise.
7332         * pthread_setcanceltype.c: Likewise.
7333         * pthread_timedjoin.c: Likewise.
7334         * pthread_tryjoin.c: Likewise.
7335         * sysdeps/pthread/createthread.c: Likewise.
7337 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7339         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7340         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7341         definitions.  Replace uses with calls to atomic_* functions.
7342         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7343         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7344         __lll_test_and_set calls with atomic_exchange_and_add and
7345         atomic_exchange calls respectively.
7346         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7347         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7348         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7349         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7350         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7351         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7352         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7354         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7355         returns the old value.
7357 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7359         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7360         int for variable OLDVAL and correct inline assembler contraint.
7361         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7362         type int for variable OLD.
7364         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7365         only for s390-32.
7366         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7367         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7368         instead of multiple_threads field in the TCB.
7370 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7372         * sysdeps/i386/i686/bits/atomic.h: Removed.
7373         * sysdeps/i386/i586/bits/atomic.h: Removed.
7374         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7375         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7376         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7377         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7378         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7379         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7380         * atomic.h: Removed.  Moved to glibc.
7382         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7383         support for clock selection.
7385         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7386         signalling waiters.
7388 2003-03-18  Roland McGrath  <roland@redhat.com>
7390         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7391         Add __lll_rel_instr first.  Add memory clobber.
7392         (lll_mutex_unlock): Use __lll_test_and_set.
7393         From Paul Mackerras <paulus@samba.org>.
7395         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7396         unconditionally.
7397         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7398         (SINGLE_THREAD_P):  Add `header.' prefix.
7399         From Paul Mackerras <paulus@samba.org>.
7401         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7402         pthread_timedjoin_np to ...
7403         (libpthread: GLIBC_2.3.3): ... here.
7404         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7406         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7407         Avoid shadowing VAL variable.
7409         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7410         New macro.
7412 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7414         * Makefile (tests): Add tst-cond11.
7415         * tst-cond11.c: New file.
7417         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7418         struct passed to cleanup handler to eliminate one more
7419         instruction.
7420         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7422         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7423         (pthrad_cond_t): Replace __unused field with __clock.
7425         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7426         waken all waiters in cleanup handler.
7427         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7428         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7430         * pthread_condattr_getclock.c: New file.
7431         * pthread_condattr_setclock.c: New file.
7432         * sysdeps/pthread/pthread.h: Declare these new functions.
7433         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7434         * Makefile (libpthread-routines): Add the new functions.
7435         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7436         Renamed field to value.  Document use of the bits.
7437         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7438         change.
7439         * pthread_condattr_setpshared.c: Likewise.
7440         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7441         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7442         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7443         Add __clock field.
7444         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7445         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7446         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7447         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7448         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7449         Implement clock selection.
7450         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7451         * pthread-errnos.sym: Add ENOSYS.
7452         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7453         _POSIX_CLOCK_SELECTION.
7454         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7456         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7457         invalid .size directive.
7459 2003-03-17  Roland McGrath  <roland@redhat.com>
7461         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7462         Formatting tweaks.
7464 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7466         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7467         Use __lll_add instead of spelling it out.  Use protected symbol names.
7468         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7469         Use __lll_add.
7470         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7471         Renamed from lll_compare_and_swap.  Use new name where necessary.
7472         (__lll_add): Defined.
7473         (__lll_dec_if_positive): Defined.
7474         (__lll_test_and_set): Defined.
7475         * sysdeps/ia64/pthread_spin_init.c: Removed.
7476         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7477         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7478         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7479         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7480         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7481         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7482         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7483         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7484         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7485         __sync_lock_release_si.
7486         Patch by Jakub Jelinek.
7488         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7489         Fix timeout handling.
7490         (__lll_timedwait_tid): Likewise.
7491         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7492         Patch by Jakub Jelinek.
7494         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7496 2003-03-17  Roland McGrath  <roland@redhat.com>
7498         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7499         * sysdeps/pthread/pthread_spin_init.c: New file.
7500         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7501         * sysdeps/powerpc/Makefile: New file.
7502         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7503         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7504         * sysdeps/powerpc/pthreaddef.h: New file.
7505         * sysdeps/powerpc/tcb-offsets.sym: New file.
7506         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7507         * sysdeps/powerpc/tls.h: New file.
7508         * sysdeps/powerpc/bits/atomic.h: New file.
7509         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7510         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7511         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7513         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7514         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7515         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7516         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7517         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7518         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7519         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7520         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7521         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7522         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7523         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7524         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7525         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7526         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7527         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7529         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7530         not gettimeofday.
7531         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7532         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7533         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7534         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7535         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7537 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7539         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7540         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7541         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7542         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7543         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7545 2003-03-16  Roland McGrath  <roland@redhat.com>
7547         * tst-fork4.c: Include <string.h>.
7548         * tst-signal2.c: Likewise.
7549         * tst-mutex5.c (do_test): exit -> return.
7550         * tst-mutex2.c: Include <stdlib.h>.
7552 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7554         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7555         (__lll_mutex_timedlock_wait): Correct expected value after
7556         spurious wakeup.  Otherwise we would never wait again.
7558         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7559         zone versus inline asm stupidity.  Use correct instructions.
7561         * tst-rwlock6.c: Add some more status output.
7563 2003-03-15  Roland McGrath  <roland@redhat.com>
7565         * sysdeps/pthread/configure.in: New file.
7566         * sysdeps/pthread/configure: New file (generated).
7568 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7570         * allocatestack.c (allocate_stack): Store the exact stack size of
7571         user allocated stacks.
7573 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7575         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7576         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7577         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7578         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7579         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7580         Use `header.' prefix.
7581         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7583 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7585         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7586         __builtin_frame_address, use stack pointer.
7588         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7589         instead of __builtin_frame_pointer.
7591 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7593         * tst-basic1.c (do_test): Add cast to avoid warning.
7594         * tst-basic2.c (do_test): Likewise.
7596         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7597         amount of stack correction.
7599         * tst-fork4.c: Use test-skeleton.c.
7601 2003-03-14  Roland McGrath  <roland@redhat.com>
7603         * init.c: Fix typo "#eli" for "#else".
7605 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7607         * allocatestack.c (__stack_user): Use hidden_data_def.
7608         * pthread_create.c (__pthread_keys): Likewise.
7610         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7612 2003-03-14  Roland McGrath  <roland@redhat.com>
7614         * tst-fork4.c: New file.
7615         * Makefile (tests): Add it.
7617         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7618         we always define the padding space.
7619         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7620         stopped supporting its own extensions fully.
7621         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7622         struct also called `header', so `header.multiple_threads' is the field
7623         name to use on all machines.
7624         * allocatestack.c (allocate_stack): Use `header.' prefix.
7625         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7626         * pthread_create.c (__pthread_create_2_1): Likewise.
7627         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7628         (THREAD_SELF): Likewise.
7629         * sysdeps/x86_64/tls.h: Likewise.
7630         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7631         (SINGLE_THREAD_P): Likewise.
7632         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7633         (SINGLE_THREAD_P): Likewise.
7634         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7635         (SINGLE_THREAD_P): Likewise.
7637         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7638         value directly.
7640 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7642         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7643         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7645         * pthread_create.c (start_thread): setjmp is expected to return 0.
7647         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7648         (THREAD_GETMEM_NC): Likewise.
7650 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7652         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7653         and the size of the stack which must be allocated is a multiple,
7654         allocate one more page.
7655         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7656         MULTI_PAGE_ALIASING.
7658 2003-03-13  Roland McGrath  <roland@redhat.com>
7660         * pthread_create.c (start_thread): Set EXITING_BIT after the
7661         event-reporting (and destructors), not before.
7663 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7665         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7666         lll_futex_wake): Declare register variables as long int instead of
7667         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7668         Make syscall arguments clobbered by the syscall.
7669         (lll_futex_wait): Define using lll_futex_timed_wait.
7671         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7672         to void *.
7674         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7675         PPID if [! NDEBUG].
7677         * allocatestack.c (nptl_ncreated): Only declare if
7678         COLORING_INCREMENT != 0.
7680         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7681         (__libc_enable_asynccancel_2): Remove prototype.
7683         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7684         ctid to match kernel.
7686 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7688         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7689         libc_multiple_threads.
7690         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7691         __libc_multiple_threads to...
7692         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7694         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7695         versioning.
7696         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7697         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7699         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7700         (__pthread_once_internal): Define.
7702         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7703         macros instead of .symver directly.
7704         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7705         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7707         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7708         * sysdeps/x86_64/tcb-offsets.sym: New file.
7709         * sysdeps/x86_64/Makefile: New file.
7711         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7712         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7713         to access own pthread_t in TCB.
7714         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7715         Likewise.
7716         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7717         Likewise.
7718         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7720 2003-03-12  Roland McGrath  <roland@redhat.com>
7722         * pthread-errnos.sym: New file.
7723         * Makefile (gen-as-const-headers): New variable, list that file.
7724         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7725         header <pthread-errnos.h> instead of defining errno values here.
7726         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7727         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7728         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7729         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7730         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7731         Likewise.
7732         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7733         Likewise.
7734         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7735         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7736         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7737         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7738         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7739         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7740         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7741         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7742         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7743         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7744         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7745         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7746         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7747         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7748         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7749         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7750         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7751         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7752         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7753         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7754         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7755         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7756         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
7757         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
7758         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
7759         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7760         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7762         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
7763         CLONE_CHILD_SETTID worked.
7765 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7767         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
7768         file.
7769         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
7770         file.
7772         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7773         (pthread_cond_t): Add padding.
7775         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
7776         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
7777         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
7779         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
7780         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
7781         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
7782         (__pthread_rwlock_timedrdlock): Likewise.
7783         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
7784         (__pthread_rwlock_wrlock): Likewise.
7785         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
7786         (__pthread_rwlock_rdlock): Likewise.
7788         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
7790         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
7791         result of lock re-get if it fails.
7793 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7795         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
7796         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7797         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7798         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7799         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7800         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7801         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7802         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7803         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7804         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7806         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
7807         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
7809         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
7810         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
7811         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
7812         (create_thread): Likewise.
7813         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
7814         * init.c (__pthread_initialize_minimal_internal): Initialize
7815         __libc_multiple_threads_ptr if necessary.
7816         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
7817         __pthread_multiple_threads and __libc_multiple_threads_ptr.
7818         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
7819         __libc_multiple_threads.
7820         (__libc_pthread_init): Return pointer to __libc_pthread_init if
7821         necessary.
7823         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
7824         (THREAD_SETMEM_NC): Likewise.
7826         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
7827         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
7828         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
7829         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
7831         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
7832         Eliminate one entire instruction.
7834         * cancellation.c (__pthread_enable_asynccancel_2): New function.
7835         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
7836         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7837         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
7838         instead of __pthread_enable_asynccancel.
7839         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7840         (__pthread_cond_wait): Likewise.
7841         * sysdeps/pthread/pthread_cond_timedwait.c
7842         (__pthread_cond_timedwait): Likewise.
7843         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
7845         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7846         (__condvar_cleanup): Wake up all waiters in case we got signaled
7847         after being woken up but before disabling asynchronous
7848         cancellation.
7849         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
7850         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
7851         (__condvar_cleanup): Likewise.
7853         * init.c (__NR_set_tid_address): If already defined, don't redefine.
7854         Make it an error if architecture has no #if case.  Add x86-64.
7856         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
7857         pt-initfini.s generation.
7859         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
7860         (TLS_INIT_TP): Fix typo.
7862 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7864         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
7865         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
7867         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
7868         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7869         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
7870         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
7871         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
7872         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7873         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7874         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7876 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7878         * sysdeps/pthread/pthread_cond_timedwait.c
7879         (__pthread_cond_timedwait): Return the result of the final
7880         locking.  If it succeeds, the regular function return value.
7882         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
7883         Return result of the final locking.
7884         * version.c (__nptl_main): Work around problems with the strange
7885         INTERNAL_SYSCALL macro on ppc32.
7886         * init.c (__pthread_initialize_minimal_internal): Unblock
7887         SIGCANCEL in case the parent blocked it.
7888         Reported by Paul Mackerras <paulus@samba.org>.
7890         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
7891         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
7892         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
7894 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7896         * sysdeps/pthread/pthread_cond_timedwait.c
7897         (__pthread_cond_timedwait): Unlock and fail if
7898         __pthread_mutex_unlock_internal failed.
7900         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
7901         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
7902         Use ARCH_CLONE.
7903         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
7904         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
7905         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
7906         ALLOCATE_STACK): New macros.
7907         (TLS_TPADJ): New macro.
7908         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
7909         (allocate_stack): Handle TLS_DTV_AT_TP and
7910         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
7911         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
7912         Don't set PD->self.
7913         * init.c [__ia64__] (__NR_set_tid_address): Define.
7915         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
7916         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
7917         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
7918         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
7919         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
7920         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
7921         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
7922         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
7923         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
7924         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
7925         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
7926         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
7927         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
7928         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
7929         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
7930         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
7931         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
7932         * sysdeps/ia64/bits/atomic.h: New file.
7933         * sysdeps/ia64/Makefile: New file.
7934         * sysdeps/ia64/pthread_spin_init.c: New file.
7935         * sysdeps/ia64/pthread_spin_lock.c: New file.
7936         * sysdeps/ia64/pthread_spin_trylock.c: New file.
7937         * sysdeps/ia64/pthread_spin_unlock.c: New file.
7938         * sysdeps/ia64/pthreaddef.h: New file.
7939         * sysdeps/ia64/tcb-offsets.sym: New file.
7940         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
7941         * sysdeps/ia64/tls.h: New file.
7943         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
7944         to syscall instead of no arguments.
7946 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
7948         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
7949         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
7950         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
7951         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
7953         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
7954         unused code.
7956         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
7958         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
7959         lowlevelbarrier.sym.
7960         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
7961         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
7962         Include lowlevelbarrier.h and don't define offsets locally.
7963         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
7965         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
7966         (__lll_mutex_lock_wait): Reverse order of first two parameters.
7967         (__lll_mutex_timedlock_wait): Likewise.
7968         (lll_mutex_lock): Adjust asm for that.
7969         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
7970         (lll_lock): Adjust asm for operand order change.
7971         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
7972         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
7974         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
7975         Reverse order of parameters.
7976         (__lll_timedwait_tid): Remove regparms attribute.
7977         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
7978         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
7980         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7981         (__lll_timedwait_tid): Remove one unnecessary instruction.
7983         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
7984         __lll_mutex_timedlock_wait only for NOT_IN_libc.
7985         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
7986         lowlevelmutex.S.
7988         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
7989         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
7990         for NOT_IN_libc.
7991         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
7992         lowlevellock.S.
7994         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
7995         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
7996         for libc.so.
7997         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
7998         define LOCK here (if UP is not defined).  The actual code is in
7999         lowlevelmutex.S.
8001         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8002         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8003         __lll_timedwait_tid for libc.so.
8004         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8005         define LOCK here (if UP is not defined).  The actual code is in
8006         lowlevellock.S.
8008         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8009         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8010         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8011         instead of lowlevelsem.h.
8012         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8013         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8014         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8016         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8017         lowlevelrwlock.sym.
8018         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8019         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8020         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8022         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8023         register loading.
8024         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8025         last changed.  D'oh.
8027         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8029         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8030         of __libc_locking_needed.
8031         (lll_trylock): Initialize %eax to zero.
8033         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8034         pthread_cond_t definition.
8036 2003-03-10  Roland McGrath  <roland@redhat.com>
8038         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8039         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8040         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8041         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8042         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8044         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8045         Instead of setting PD->multiple_threads, set globals
8046         __pthread_multiple_threads and __libc_multiple_threads.
8047         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8048         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8049         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8051         * descr.h (struct pthread): Conditionalize first member on
8052         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8053         containing an anonymous tcbhead_t.  Move `list' member out.
8054         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8055         * allocatestack.c: Remove use of `header.data.' prefix.
8056         * pthread_create.c: Likewise.
8057         * init.c (__pthread_initialize_minimal_internal): Likewise.
8058         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8059         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8060         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8061         * sysdeps/x86_64/tls.h: Likewise.
8062         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8063         (SINGLE_THREAD_P): Likewise.
8064         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8065         (SINGLE_THREAD_P): Likewise.
8066         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8067         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8069 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8071         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8073         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8074         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8076         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8077         leftovers from the ia32 code.
8079         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8080         memory load.
8081         (clear_once_control): Don't load %esi.
8083         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8084         handling.
8086         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8088         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8089         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8091         * Makefile (tests): Add tst-cond10.
8092         * tst-cond10.c: New file.
8094 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8096         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8097         * tst-signal3.c (do_test): Likewise.
8098         * tst-sem5.c (do_test): Likewise.
8099         * tst-kill6.c (do_test): Likewise.
8100         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8102         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8103         of inc/dec.
8104         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8105         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8106         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8107         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8108         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8109         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8110         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8111         Likewise.
8112         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8113         Likewise.
8114         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8115         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8116         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8117         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8119         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8120         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8121         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8123         * allocatestack.c (allocate_stack): If mprotect() fails free the
8124         TLS memory.
8126 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8128         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8130         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8131         lll_wake_tid.  This was used only to work around kernel limits in
8132         the early days.
8133         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8134         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8135         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8136         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8138         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8139         (__pthread_initialize_minimal_internal): Change initialization of
8140         __static_tls_align_m1 appropriately.
8141         * pthreadP.h (__static_tls_align_m1): Renamed from
8142         __static_tls_align.
8143         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8144         instead of __static_tls_align-1.
8146 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8148         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8150         * pthread_create.c: Define __pthread_keys using nocommon
8151         attribute, not by placing it explicitly in bss.
8152         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8154         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8155         Use it in mmap call to allocate stacks.
8157         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8159         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8160         result of the thread function.
8162 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8164         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8165         version is just fine.
8167         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8168         (__pthread_child_handler): Renamed from pthread_child_handler,
8169         exported, and marked hidden.  Change all users.
8170         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8171         free __pthread_child_handler from child list.
8173 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8175         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8177         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8178         Fix handling of cancellation and failing pthread_mutex_unlock call.
8179         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8180         (__pthread_cond_wait): Likewise.
8182         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8183         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8184         lll_futex_timed_wait call.
8185         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8186         (pthread_rwlock_timedwrlock): Likewise.
8188         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8189         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8190         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8192         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8193         check of lll_futex_wake return value.
8195 2003-03-03  Roland McGrath  <roland@redhat.com>
8197         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8199         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8200         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8201         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8203 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8205         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8206         error for CPU clocks.
8208         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8209         _POSIX_MONOTONIC_CLOCK.
8210         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8212         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8213         recent kernels.
8215 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8217         * descr.h (struct pthread): Move cleanup field to the front.
8219 2003-03-01  Roland McGrath  <roland@redhat.com>
8221         * sem_open.c (sem_open): Braino fix.
8223 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8225         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8226         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8227         __pthread_cleanup_pop functionality.
8228         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8230         * descr.h (struct pthread): Move tid field to the front now that
8231         it is often used.
8233         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8234         (__lll_mutex_timedlock_wait): Remove.
8235         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8236         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8237         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8238         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8239         (lll_unlock_wake_cb): Don't save and restore %esi.
8240         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8241         %esi.
8242         (__lll_timedwait_tid): Add alignment.
8243         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8244         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8245         %esi.
8246         (__lll_timedwait_tid): Removed.
8247         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8248         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8249         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8250         (pthread_barrier_wait): Don't save, load, and restore %esi for
8251         last thread.
8252         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8253         (__pthread_cond_signal): Don't save, load, and restore %esi.
8254         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8255         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8256         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8257         Don't save, load, and restore %esi.
8259 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8261         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8262         Release lock before waking up the waiters.
8264         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8266         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8267         (reader_thread): Likewise.
8269         * sysdeps/pthread/pthread_rwlock_unlock.c
8270         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8271         to wake up readers if there are none.
8273         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8274         Release internal lock before wake threads.
8276 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8278         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8279         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8280         predefined.
8281         * tst-rwlock9.c: Likewise.
8282         * tst-rwlock10.c: New file.
8283         * tst-rwlock11.c: New file.
8285         * Makefile (tests): Add tst-dlsym1.
8286         * tst-dlsym1.c: New file.
8288         * init.c (__pthread_initialize_minimal_internal): Set
8289         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8290         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8292 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8294         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8296         * tst-cond2.c: Fix sychronization with child.
8298         * tst-rwlock8.c (reader_thread): Remove unused variable.
8300         * Makefile: Add rules to build and run tst-tls3.
8301         * tst-tls3.c: New file.
8302         * tst-tls3mod.c: New file.
8304         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8305         * tst-rwlock8.c: New file.
8306         * tst-rwlock9.c: New file.
8307         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8308         complete broken rwlock implementation.
8309         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8310         Likewise.
8311         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8312         Likewise.
8313         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8314         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8315         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8316         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8317         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8318         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8319         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8321 2003-02-23  Roland McGrath  <roland@redhat.com>
8323         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8325 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8327         * Makefile (tests): Add tst-context1.
8328         * tst-context1.c: New file.
8330         * Makefile (tests): Add tst-tls1 and tst-tls2.
8331         * tst-tls1.c: New file.
8332         * tst-tls2.c: New file.
8334         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8335         for failed cmpxchg.
8337         * pthread_create.c (start_thread): Set EXITING_BIT early.
8339         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8340         (THREAD_GETMEM_NC): Likewise.
8342 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8344         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8345         off 3 more bytes by using offset-less instructions when possible.
8347         * Makefile: Add dependency for $(objpfx)version.d.
8349         * eintr.c (eintr_source): Add unnecessary return but the compiler
8350         insists.
8352         * tst-kill3.c: Include <unistd.h>.
8354 2003-02-21  Roland McGrath  <roland@redhat.com>
8356         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8358 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8360         * Makefile (tests): Add tst-eintr1.
8361         (distribute): Add eintr.c.
8362         * tst-eintr1.c: New file.
8363         * eintr.c: New file.
8365         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8367         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8368         Disallow sending SIGCANCEL.
8370         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8371         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8372         * tst-kill1.c: New file.
8373         * tst-kill2.c: New file.
8374         * tst-kill3.c: New file.
8375         * tst-kill5.c: New file.
8376         * tst-kill6.c: New file.
8377         * tst-basic7.c: Renamed to...
8378         * tst-kill4.c: ...this.
8380 2003-02-21  Roland McGrath  <roland@redhat.com>
8382         * Makefile (install-lib-ldscripts): New variable.
8384 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8386         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8387         * pthread_cancel.c: Use INVALID_TD_P.
8388         * pthread_detach.c: Likewise.
8389         * pthread_getschedparam.c: Likewise.
8390         * pthread_setschedparam.c: Likewise.
8391         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8392         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8393         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8394         * pthread_timedjoin.c: Likewise.
8396         * tst-basic7.c: Include <signal.h>.
8398         * pthread_join.c (pthread_join): Limited checking for invalid
8399         descriptors.
8400         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8402 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8404         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8405         beginning of the loop.  Clear the entire first block of TSD.
8406         * Makefile (tests): Add tst-key4.
8407         * tst-key4.c: New file.
8409 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8411         * Makefile (tests): Add tst-basic7.
8412         * tst-basic7.c: New file.
8414         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8415         Add some more __builtin_expect.
8417         * pthreadP.h: Define dummy version of DEBUGGING_P.
8419 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8421         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8422         _POSIX_THREAD_PRIORITY_SCHEDULING.
8423         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8424         _XOPEN_REALTIME_THREADS.
8425         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8427         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8428         kernel returns EINVAL for PID <= 0, work around it.
8430         * Makefile (tests): Add tst-signal5.
8431         * tst-signal5.c: New file.
8433         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8434         and LOGIN_NAME_MAX.
8436         * tst-cancel1.c (tf): Block all signals.
8438         * Makefile (tests): Add tst-basic6.
8439         * tst-basic6.c: New file.
8441         * tst-basic1.c: Add test for process ID.
8443         * Makefile (tests): Add tst-cancel10.
8444         * tst-cancel10.c: New file.
8446         * Makefile (tests): Add tst-signal4.
8447         * tst-signal4.c: New file.
8449         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8450         __sigismember instead of sigismember.  Add __builtin_expect.
8452 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8454         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8455         pthread_setcancelstate, and pthread_rwlock_setpshared.
8457         * tst-cancel7.c (do_test): Make sure the pid file exists before
8458         canceling the thread.
8460         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8461         pthread_rwlock_timedrdlock tests.
8462         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8463         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8464         Check for invalid tv_nsec field.
8465         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8466         Likewise.
8468         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8469         recursive mutex of overflow.
8471         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8473         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8474         going into an endless loop.
8475         * Makefile (tests): Add tst-cancel9.
8476         * tst-cancel9.c: New file.
8478         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8480 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8482         * tst-mutex5.c (do_test): Add more timedlock tests.
8484         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8485         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8487         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8488         use INLINE_SYSCALL.  Error number is returned, not -1.
8490         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8491         and __deallocate_stack with internal_function.
8492         * pthread_create.c: Adjust definitions appropriately.
8493         * allocatestack.c: Likewise.
8495         * pthread_join.c: Add one more __builtin_expect.
8496         * pthread_timedjoin.c: Likewise.
8498         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8499         not data of sequence number does not match.
8500         Add one __builtin_expect.
8502         * Makefile (tests): Add tst-clock1.
8503         * tst-clock1.c: New file.
8505         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8506         negative arguments.
8507         * Makefile (tests): Add tst-basic5.
8508         * tst-basic5.c: New file.
8510 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8512         * Makefile (tests): Add tst-basic4.
8513         * tst-basic4.c: New file.
8515         * pthreadP.h: Add declaraction for __nptl_nthreads.
8516         * pthread_create.c: Define __nptl_nthreads
8517         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8518         after thread is done.  If then zero, call exit(0).
8519         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8520         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8521         * init.c (pthread_functions): Initialize ptr_nthreads.
8522         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8523         (__reclaim_stacks): Decrement __nptl_nthreads.
8524         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8525         Define.
8526         * Makefile (tests): Add tst-basic3.
8527         * tst-basic3.c: New file.
8529         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8530         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8531         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8532         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8533         if asynchronous canceling is enabled.
8534         * pthread_join.c (pthread_join): When recognizing circular joins,
8535         take into account the other thread might be already canceled.
8536         * Makefile (tests): Add tst-join5.
8537         * tst-join5.c: New file.
8539         * Makefile (tests): Add tst-join4.
8540         * tst-join4.c: New file.
8542 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8544         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8546 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8548         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8549         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8550         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8551         warning.
8552         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8553         to avoid warning.
8554         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8555         error if lll_futex_wake failed.
8557 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8559         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8560         handling of cancellation and failung pthread_mutex_unlock call.
8561         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8562         * Makefile (tests): Add tst-cond8 and tst-cond9.
8563         * tst-cond8.c: New file.
8564         * tst-cond9.c: New file.
8566         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8568         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8569         non-standard initializers with __USE_GNU.
8571         * Makefile (tests): Add tst-cleanup3.
8572         * tst-cleanup3.c: New file.
8574 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8576         * Makefile (tests): Add tst-attr1 and tst-attr2.
8577         * tst-attr1.c: New file.
8578         * tst-attr2.c: New file.
8580         * Makefile: Add rules to build and run tst-atfork2 test.
8581         * tst-atfork2.c: New file.
8582         * tst-atfork2mod.c: New file.
8584         * sysdeps/unix/sysv/linux/unregister-atfork.c
8585         (__unregister_atfork): Free the memory allocated for the handlers
8586         after removing them from the lists.
8588         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8589         cleanup function.
8591         * tst-atfork1.c (do_test): Wait for the child we forked.
8592         Report error in child.
8594         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8596         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8598 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8600         * Makefile (tests): Add tst-cancel8.
8601         * tst-cancel8.c: New file.
8603         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8604         clearing of control variable.
8605         * Makefile (tests): Add tst-once3 and tst-once4.
8606         * tst-once3.c: New file.
8607         * tst-once4.c: New file.
8609 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8611         * sysdeps/sh/Makefile: New file.
8612         * sysdeps/sh/bits/atomic.h: New file.
8613         * sysdeps/sh/pthread_spin_init.c: New file.
8614         * sysdeps/sh/pthread_spin_lock.c: New file.
8615         * sysdeps/sh/pthread_spin_trylock.S: New file.
8616         * sysdeps/sh/pthread_spin_unlock.S: New file.
8617         * sysdeps/sh/pthreaddef.h: New file.
8618         * sysdeps/sh/tcb-offsets.sym: New file.
8619         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8620         * sysdeps/sh/tls.h: New file.
8621         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8622         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8623         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8624         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8625         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8626         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8627         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8628         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8629         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8630         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8631         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8632         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8633         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8634         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8635         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8636         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8637         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8638         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8639         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8640         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8641         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8642         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8643         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8644         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8645         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8646         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8647         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8648         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8649         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8650         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8652 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8654         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8655         according to POSIX.
8657         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8659 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8661         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8662         (TLS_GET_FS): New #define.
8663         (TLS_SET_FS): New #define.
8664         Correct value of __NR_set_thread_area.
8666         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8668 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8670         * Makefile (tests): Add tst-popen1.
8671         * tst-popen1.c: New file.
8673         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8674         but inactive generalization.
8675         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8676         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8677         Minor optimization, remove one instruction.
8678         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8680 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8682         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8684 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8686         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8687         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8688         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8689         * sysdeps/pthread/pthread_cond_signal.c: New file.
8690         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8691         * sysdeps/pthread/pthread_cond_wait.c: New file.
8692         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8693         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8694         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8695         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8696         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8697         * sysdeps/s390/Makefile: New file.
8698         * sysdeps/s390/bits/atomic.h: New file.
8699         * sysdeps/s390/pthread_spin_init.c: New file.
8700         * sysdeps/s390/pthread_spin_lock.c: New file.
8701         * sysdeps/s390/pthread_spin_trylock.c: New file.
8702         * sysdeps/s390/pthread_spin_unlock.c: New file.
8703         * sysdeps/s390/pthreaddef.h: New file.
8704         * sysdeps/s390/tcb-offsets.sym: New file.
8705         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8706         * sysdeps/s390/tls.h: New file.
8707         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8708         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8709         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8710         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8711         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8712         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8713         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8714         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8715         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8716         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8717         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8718         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8719         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8720         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8721         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8722         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8723         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8724         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8725         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8726         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8727         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8728         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8729         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8731 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8733         * atomic.h: Add a couple more default implementations.
8734         (atomic_compare_and_exchange_acq): Use
8735         __arch_compare_and_exchange_32_acq in return value definition.  It
8736         always exists.
8737         (atomic_bit_set): Renamed from atomic_set_bit.
8738         Add missing atomic_ prefixes.
8740         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8741         thread library is available, use correct value to mark initialized
8742         once variable.
8744 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8746         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8747         __sysconf to determine pagesize.
8749         * pthread_create.c: Include <atomic.h>.
8750         * allocatestack.c (allocate_stack): Implement coloring of the
8751         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8752         size minus one.  Adjust users.
8753         * sysdeps/i386/i686/Makefile: New file.
8755 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
8757         * allocatestack.c: Improve comment throughout the file.
8759         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8760         (__lll_lock_wait): Add branch prediction.
8761         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8762         (__lll_lock_wait): Likewise.
8763         (lll_unlock_wake_cb): Removed.
8765 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
8767         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
8768         _POSIX_THREAD_PRIORITY_SCHEDULING.
8770 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
8772         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8773         Fix return type of ptr___pthread_getspecific.
8775 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
8777         * Makefile (tests): Add tst-umask1.
8778         (tst-umask1-ARGS): Define.
8779         * tst-umask1.c: New file.
8781 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
8783         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
8784         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
8785         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
8786         pthread_rwlock_unlock.
8787         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
8788         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
8789         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
8790         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
8791         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8792         New file.
8793         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
8794         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8795         New file.
8796         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
8797         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
8798         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
8799         New file.
8800         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
8801         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
8802         New file.
8803         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
8804         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
8805         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
8806         New file.
8807         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
8808         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
8809         New file.
8810         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
8812         * Makefile (libpthread-routines): Remove lowlevelcond and
8813         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
8814         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
8815         and pthread_cond_broadcast.
8816         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
8817         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
8818         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
8819         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
8820         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
8821         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
8822         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
8823         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
8824         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
8825         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
8826         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
8827         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
8828         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
8829         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
8830         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
8831         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
8832         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
8833         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
8834         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
8835         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
8836         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
8837         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
8838         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
8839         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
8840         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
8841         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
8842         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
8843         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
8844         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
8845         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
8846         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
8848         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
8849         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
8850         of the code is moved to ...
8851         * sysdeps/pthread/createthread.c: ...here.  New file.
8853 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
8855         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
8856         (__new_sem_post): Clear %eax before returning.
8857         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
8859         * Makefile (tests): Add tst-cleanup2.
8860         * tst-cleanup2.c: New file.
8862         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
8863         Interpret first parameter correctly.
8865 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
8867         * Makefile (headers): Add bits/semaphore.h.
8869 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
8871         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
8872         if not SHARED.
8874 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
8876         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
8877         must be used and mapping failed.
8878         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
8880         * Makefile (CFLAGS-pthread_self.os): Define this, not
8881         CFLAGS-pthread_self.c.
8883 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8885         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
8886         lll_unlock_wake_cb.
8888         * Makefile (libpthread-routines): Add version.  Add rules to build
8889         version.os and banner.h.
8890         * version.c: New file.
8892 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
8894         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
8895         the alias unconditional.
8896         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
8898 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8900         * Makefile (CFLAGS-pthread_self.c): New definition.
8902 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8904         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
8905         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
8906         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
8907         * init.c (__pthread_initialize_minimal_internal): Likewise.
8909 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
8911         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
8913         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
8914         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8915         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8916         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
8917         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
8918         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
8920 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
8922         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
8923         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
8924         * tst-cancel-wrappers.sh: Remove all exceptions.
8926 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
8928         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
8929         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
8931         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
8932         Use __libc_pthread_functions array if SHARED.
8934         * pthreadP.h: Move pthread_cond_2_0_t definition to...
8935         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
8937         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
8938         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
8939         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
8940         __libc_ptf_call instead of __libc_maybe_call.
8941         (PTF): New #define.
8942         (__libc_cleanup_region_start): Wrap function name with PTF call.
8943         (__libc_cleanup_region_end): Likewise.
8944         (__libc_cleanup_end): Likewise.
8946         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
8947         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
8948         * pthread_key_create.c: Add __pthread_key_create_internal alias.
8949         * pthreadP.h: Add prototypes.
8951         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
8952         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
8953         __pthread_rwlock_unlock aliases.
8954         * pthreadP.h: Add prototypes for new aliases.
8956         * pthreadP.h (struct pthead_functions): Moved to...
8957         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
8958         * init.c (pthread_functions): Add initializers for new elements.
8960         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
8961         __pthread_cleanup_pop_restore aliases.
8962         * pthreadP.h: Add prototypes.
8964         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
8965         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
8966         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
8967         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
8968         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8969         * pthreadP.h: Adjust prototypes and callers.
8971 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
8973         * Makefile (tests): Add tst-cancel7.
8974         (tst-cancel7-ARGS): New variable.
8975         * tst-cancel7.c: New file.
8977         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
8978         around gcc defficiencies.
8979         * old_pthread_cond_signal.c: Likewise.
8980         * old_pthread_cond_timedwait.c: Likewise.
8981         * old_pthread_cond_wait.c: Likewise.
8983         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
8985 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
8987         * Makefile (tests): Add tst-cond7.
8988         * tst-cond7.c: New file.
8990         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
8991         (condvar_cleanup): Get condvar address from the right place.
8993         * atomic.h: Correct definitions of atomic_full_barrier,
8994         atomic_read_barrier, atomic_write_barrier.
8996         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
8997         race-free.
8998         * old_pthread_cond_signal.c: Likewise.
8999         * old_pthread_cond_timedwait.c: Likewise.
9000         * old_pthread_cond_wait.c: Likewise.
9002 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9004         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9006 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9008         * pthreadP.h (pthread_cond_2_0_t): New type.
9009         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9010         Use new type for the 2.0 condvar function prototypes.
9011         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9012         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9013         parameter.
9014         * old_pthread_cond_destroy.c: Likewise.
9015         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9016         * old_pthread_cond_signal.c: Likewise.
9017         * old_pthread_cond_timedwait.c: Likewise.
9018         * old_pthread_cond_wait.c: Likewise.
9020         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9021         (__pthread_cond_wait): Don't save cancellation mode and seq value
9022         in same location.
9024         * herrno.c (__h_errno_location): Don't define as weak.
9026 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9028         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9029         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9030         and pthread_cond_wait.
9031         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9032         Renamed to...
9033         (__pthread_cond_broadcast_2_0): ... this.
9034         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9035         Renamed to...
9036         (__pthread_cond_destroy_2_0): ... this.
9037         * old_pthread_cond_init.c (__old_pthread_cond_init):
9038         Renamed to...
9039         (__pthread_cond_init_2_0): ... this.
9040         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9041         Renamed to...
9042         (__pthread_cond_signal_2_0): ... this.
9043         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9044         Renamed to...
9045         (__pthread_cond_wait_2_0): ... this.
9046         * pthread_cond_destroy.c: Include shlib-compat.h.
9047         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9048         * pthread_cond_init.c: Include shlib-compat.h.
9049         (pthread_cond_init): Change strong_alias into versioned_symbol.
9050         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9051         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9052         fields.
9053         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9054         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9055         __pthread_cond_wait_2_0): New prototypes.
9056         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9057         __old_pthread_cond_init, __old_pthread_cond_signal,
9058         __old_pthread_cond_wait): Removed.
9059         * init.c: Include shlib-compat.h.
9060         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9061         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9062         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9063         ptr___pthread_cond_*_2_0 fields.
9064         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9065         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9067         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9068         LIBC_SIGACTION was not yet defined.
9069         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9070         [!defined LIBC_SIGACTION] (__sigaction): New function and
9071         libc_hidden_weak.
9072         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9073         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9075 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9077         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9079 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9081         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9082         New, larger type definition.
9083         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9084         implementation.
9085         * Versions [libpthread]: Add definitions for new pthread_cond_*
9086         interfaces for version GLIBC_2.3.2.
9087         * pthread_cond_init.c: Update initialization for new type definition.
9088         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9089         pthread_cond_timedwait, pthread_cond_signal, and
9090         pthread_cond_broadcast.  Add old_pthread_cond_init,
9091         old_pthread_cond_destroy, old_pthread_cond_wait,
9092         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9093         old_pthread_cond_broadcast.
9094         * old_pthread_cond_broadcast.c: New file.
9095         * old_pthread_cond_destroy.c: New file.
9096         * old_pthread_cond_init.c: New file.
9097         * old_pthread_cond_signal.c: New file.
9098         * old_pthread_cond_timedwait.c: New file.
9099         * old_pthread_cond_wait.c: New file.
9100         * pthreadP.h: Add prototypes for the compatibility interfaces.
9102         * pthread_cond_destroy.c: Don't include <errno.h>.
9104 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9106         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9107         unnecessary zero offset when addressing MUTEX.
9109 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9111         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9112         __register_atfork.
9113         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9114         for __register_atfork.
9116 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9118         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9119         instead of ASSEMBLER test macro.
9121         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9122         __libc_current_sigrtmax): Add libc_hidden_def.
9124         * sysdeps/pthread/list.h: Remove assert.h include.
9126 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9128         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9129         __pthread_initialize_minimal_internal not
9130         __pthread_initialize_minimal.
9132 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9134         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9135         __pthread_initialize_minimal as hidden.
9137         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9138         constructor.
9140 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9142         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9143         $(common-objpfx)format.lds, include that into the output script.
9144         Fix comment.
9145         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9147 2002-12-28  Andreas Jaeger  <aj@suse.de>
9149         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9150         nsec resolution changes.
9151         (xstat64_conv): Likewise.
9152         (xstat32_conv): Likewise.
9153         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9154         struct kernel_stat.
9155         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9156         structs stat and stat64.
9157         * time/time.h (__timespec_defined): Define for __USE_MISC.
9158         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9160 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9162         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9163         argument.
9164         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9165         (pthread_exit): Use strong_alias to avoid warnings.
9166         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9167         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9168         ptr___pthread_attr_init_2_*.
9169         * init.c (pthread_functions): Adjust.
9171 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9173         * forward.c: Make all functions available by default again.  It
9174         caused too much trouble.
9176         * pt-siglongjmp.c: Removed.
9178 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9180         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9181         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9182         * sysdeps/i386/Makefile: New file.
9183         * sysdeps/i386/tcb-offsets.sym: New file.
9184         * sysdeps/pthread/tcb-offsets.h: New file.
9185         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9186         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9188         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9189         __register_atfork...
9190         (GLIBC_2.3.2): ...here.
9192 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9194         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9195         pthread_attr_setstackaddr with __attribute_deprecated__.
9197 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9199         * pt-system.c (system): Remove cancellation handling.
9200         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9201         cancellation routines.
9203 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9205         * descr.h: Include <dl-sysdep.h>.
9206         (struct pthread): Move header.data.list to the back of the struct.
9207         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9208         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9209         (SYSINFO_OFFSEET): Likewise.
9211 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9213         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9214         Define.
9215         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9216         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9217         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9218         (USE_DL_SYSINFO): Undef.
9220 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9222         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9223         $(common-objpfx)libc.so.
9224         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9225         it is bigger than pipe buffer size even on arches with bigger
9226         page size.
9227         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9229 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9231         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9232         correct errno access for case that USE___THREAD is not defined.
9234 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9236         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9237         Patch by Marijn Ros <marijn@mad.scientist.com>.
9239 2002-12-22  Roland McGrath  <roland@redhat.com>
9241         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9243 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9245         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9247 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9249         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9250         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9251         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9253         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9254         of int $0x80.
9255         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9256         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9257         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9258         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9259         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9260         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9261         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9262         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9264         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9265         sysenter.
9266         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9268         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9270         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9271         in new TCB.
9272         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9273         that sysinfo is properly initialized.
9274         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9275         to 1 only for ld.so.
9277         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9278         RTLD_CORRECT_DYNAMIC_WEAK.
9280 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9282         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9283         Use return 0 as 6th argument to FORWARD4.
9284         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9286 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9288         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9289         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9290         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9291         (INIT_SYSINFO): New #define.
9292         (TLS_TP_INIT): Use INIT_SYSINFO.
9293         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9294         At test to make sure SYSINFO_OFFSET value is correct.
9295         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9297 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9299         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9300         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9301         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9302         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9303         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9304         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9305         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9307 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9309         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9310         macro instead of using int $0x80 directly.
9312         * sysdeps/pthread/bits/stdio-lock.h: New file.
9313         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9314         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9315         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9316         * Makefile (routines): Add libc-lowlevelmutex.
9318         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9319         __i686.get_pc_thunk.dx.
9321 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9323         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9324         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9325         ($(objpfx)tst-cancel-wrappers.out): New rule.
9326         * tst-cancel-wrappers.sh: New test.
9327         * tst-locale1.c: Include signal.h.
9328         (uselocale): Test static linking of __libc_current_sigrt*.
9330 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9332         * Makefile (tests): Add tst-cancel6.
9333         * tst-cancel6.c: New file
9335 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9337         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9338         Define meaningfully for assembler as well.
9339         * pthreadP.h (struct pthread_functions): Remove
9340         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9341         and ptr_pthread_attr_init_2_1 fields.
9342         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9343         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9344         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9345         (FORWARD3): Define using FORWARD4.
9346         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9347         versions.
9348         * pt-system.c: Remove duplicate stdlib.h include.
9350 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9352         * sem_init.c: Define sem_init@GLIBC_2.0.
9353         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9354         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9356         * flockfile.c: Moved to...
9357         * sysdeps/pthread/flockfile.c: ...here.  New file.
9358         * funlockfile.c: Moved to...
9359         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9360         * ftrylockfile.c: Moved to...
9361         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9363 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9365         * libc-cancellation.c: Guard both function with
9366         #if !defined NOT_IN_libc.
9367         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9368         automatically provided pthread wrappers.
9369         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9370         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9371         nor in libpthread.
9372         * pt-open.c: Removed.
9373         * pt-fcntl.c: Removed.
9374         * pt-fsync.c: Removed.
9375         * pt-lseek.c: Removed.
9376         * pt-msgrcv.c: Removed.
9377         * pt-msgsnd.c: Removed.
9378         * pt-msync.c: Removed.
9379         * pt-nanosleep.c: Removed.
9380         * pt-open64.c: Removed.
9381         * pt-pause.c: Removed.
9382         * pt-pread.c: Removed.
9383         * pt-pread64.c: Removed.
9384         * pt-pwrite.c: Removed.
9385         * pt-pwrite64.c: Removed.
9386         * pt-read.c: Removed.
9387         * pt-recv.c: Removed.
9388         * pt-recvfrom.c: Removed.
9389         * pt-recvmsg.c: Removed.
9390         * pt-send.c: Removed.
9391         * pt-sendto.c: Removed.
9392         * pt-sigtimedwait.c: Removed.
9393         * pt-sigwait.c: Removed.
9394         * pt-wait.c: Removed.
9395         * pt-waitpid.c: Removed.
9396         * pt-write.c: Removed.
9397         * pt-accept.c: Removed.
9398         * pt-close.c: Removed.
9399         * pt-connect.c: Removed.
9400         * pt-lseek64.c: Removed.
9401         * pt-sendmsg.c: Removed.
9402         * pt-tcdrain.c: Removed.
9404 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9406         * init.c (__pthread_initialize_minimal_internal): Renamed from
9407         __pthread_initialize_minimal.  Make old name an alias.  This
9408         converts a normal relocation into a relative relocation.
9410         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9412         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9413         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9414         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9415         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9416         pt-sigwaitinfo, pt-waitid, and pt-writev.
9417         * pt-creat.c: Removed.
9418         * pt-poll.c: Removed.
9419         * pt-pselect.c: Removed.
9420         * pt-readv.c: Removed.
9421         * pt-select.c: Removed.
9422         * pt-sigpause.c: Removed.
9423         * pt-sigsuspend.c: Removed.
9424         * pt-sigwaitinfo.c: Removed.
9425         * pt-waitid.c: Removed.
9426         * pt-writev.c: Removed.
9428         * init.c (pthread_functions): New variable.
9429         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9430         (or NULL) to __libc_pthread_init.
9431         * forward.c: Rewrite to use __libc:pthread_functions array to get
9432         function addresses.
9433         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9434         prototype.
9435         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9436         Take new parameter.  Copy content of variable pointed to by it
9437         to __libc_pthread_init.
9439         * pthreadP.h (struct pthread_functions): New type.
9440         (__libc_pthread_init): Declare.
9442         * pthread_attr_destroy.c: Add namespace protected alias.
9443         * pthread_attr_getdetachstate.c: Likewise.
9444         * pthread_attr_getinheritsched.c: Likewise.
9445         * pthread_attr_getschedparam.c: Likewise.
9446         * pthread_attr_getschedpolicy.c: Likewise.
9447         * pthread_attr_getscope.c: Likewise.
9448         * pthread_attr_setdetachstate.c: Likewise.
9449         * pthread_attr_setinheritsched.c: Likewise.
9450         * pthread_attr_setschedparam.c: Likewise.
9451         * pthread_attr_setschedpolicy.c: Likewise.
9452         * pthread_attr_setscope.c: Likewise.
9453         * pthread_cond_broadcast.c: Likewise.
9454         * pthread_cond_destroy.c: Likewise.
9455         * pthread_cond_init.c: Likewise.
9456         * pthread_cond_signal.c: Likewise.
9457         * pthread_cond_wait.c: Likewise.
9458         * pthread_condattr_destroy.c: Likewise.
9459         * pthread_condattr_init.c: Likewise.
9460         * pthread_equal.c: Likewise.
9461         * pthread_exit.c: Likewise.
9462         * pthread_getschedparam.c: Likewise.
9463         * pthread_self.c: Likewise.
9464         * pthread_setcancelstate.c: Likewise.
9465         * pthread_setschedparam.c: Likewise.
9466         * pthread_mutex_destroy.c: Likewise.
9467         * pthread_mutex_init.c: Likewise.
9468         * pthreadP.h: Add prototypes for the aliases.
9470         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9471         multiple_threads member in correct TCB to 1.
9473         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9474         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9475         member of thread decriptor, otherwise return unconditionally 1.
9477 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9479         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9480         regular Linux version.  Remove file.
9481         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9482         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9483         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9484         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9485         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9486         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9487         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9488         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9489         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9490         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9491         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9492         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9493         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9494         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9495         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9496         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9497         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9498         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9499         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9500         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9501         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9502         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9503         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9504         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9505         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9506         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9507         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9508         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9509         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9510         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9512 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9514         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9515         * sysdeps/unix/sysv/linux/open.c: Removed.
9516         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9517         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9518         * sysdeps/unix/sysv/linux/msync.c: Removed.
9519         * sysdeps/unix/sysv/linux/read.c: Removed.
9520         * sysdeps/unix/sysv/linux/close.c: Removed.
9521         * sysdeps/unix/sysv/linux/creat.c: Removed.
9522         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9523         * sysdeps/unix/sysv/linux/pause.c: Removed.
9524         * sysdeps/unix/sysv/linux/select.c: Removed.
9525         * sysdeps/unix/sysv/linux/write.c: Removed.
9527 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9529         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9530         element in TCB to see whether locking is needed.
9532         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9533         MULTIPLE_THREADS_OFFSET value is correct.
9535         * sysdeps/unix/sysv/linux/close.c: New file.
9536         * sysdeps/unix/sysv/linux/connect.S: New file.
9537         * sysdeps/unix/sysv/linux/creat.c: New file.
9538         * sysdeps/unix/sysv/linux/fsync.c: New file.
9539         * sysdeps/unix/sysv/linux/llseek.c: New file.
9540         * sysdeps/unix/sysv/linux/lseek.c: New file.
9541         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9542         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9543         * sysdeps/unix/sysv/linux/msync.c: New file.
9544         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9545         * sysdeps/unix/sysv/linux/open.c: New file.
9546         * sysdeps/unix/sysv/linux/open64.c: New file.
9547         * sysdeps/unix/sysv/linux/pause.c: New file.
9548         * sysdeps/unix/sysv/linux/poll.c: New file.
9549         * sysdeps/unix/sysv/linux/pread.c: New file.
9550         * sysdeps/unix/sysv/linux/pread64.c: New file.
9551         * sysdeps/unix/sysv/linux/pselect.c: New file.
9552         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9553         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9554         * sysdeps/unix/sysv/linux/readv.c: New file.
9555         * sysdeps/unix/sysv/linux/recv.S: New file.
9556         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9557         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9558         * sysdeps/unix/sysv/linux/select.c: New file.
9559         * sysdeps/unix/sysv/linux/send.S: New file.
9560         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9561         * sysdeps/unix/sysv/linux/sendto.S: New file.
9562         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9563         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9564         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9565         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9566         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9567         * sysdeps/unix/sysv/linux/system.c: New file.
9568         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9569         * sysdeps/unix/sysv/linux/wait.c: New file.
9570         * sysdeps/unix/sysv/linux/waitid.c: New file.
9571         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9572         * sysdeps/unix/sysv/linux/writev.c: New file.
9573         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9575         * pt-readv.c: Fix comment.
9577 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9579         * tst-cleanup1.c: Include stdlib.h.
9581         * tst-cancel5.c: New test.
9582         * Makefile (tests): Add tst-cancel5.
9583         (tst-cancel5): Link against libc.so libpthread.so in that order.
9585 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9587         * forward.c (test_loaded): Prevent recursive calls.
9589         * Makefile (routines): Add libc-cancellation.
9590         * libc-cancellation.c: New file.
9591         * descr.h (struct pthread): Add multiple_threads field.
9592         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9593         new thread descriptor to 1.
9594         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9595         Initialize multiple_thread field after successful thread creation.
9596         * cancellation.c (__do_cancel): Move to pthreadP.h.
9597         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9598         (__pthread_disable_asynccancel): Add internal_function attribute.
9599         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9600         * pthread_setcancelstate.c: Likewise.
9601         * pthread_setcanceltype.c: Likewise.
9602         * pthread_exit.c: Likewise.
9603         * pthreadP.h (CANCELLATION_P): Likewise.
9604         (__do_cancel): Define as static inline.
9605         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9606         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9607         declarations.
9608         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9609         fields.  Define MULTIPLE_THREADS_OFFSET.
9610         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9611         declaration.
9612         * sysdeps/unix/sysv/linux/accept.S: New file.
9613         * sysdeps/unix/sysv/linux/read.c: New file.
9614         * sysdeps/unix/sysv/linux/write.c: New file.
9615         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9616         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9617         initialization of __libc_locking_needed.
9618         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9619         __libc_locking_needed, use multiple_threads field in TCB.
9620         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9622 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9624         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9625         version.
9626         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9628         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9629         access to __libc_locking_needed for PIC.
9631 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9633         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9634         declare for libc.so.
9635         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9636         expression.
9637         (__libc_lock_lock): Put into statement expression.
9638         (__libc_lock_unlock): Remove trailing semicolon.
9639         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9641 2002-12-12  Roland McGrath  <roland@redhat.com>
9643         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9644         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9646 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9648         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9649         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9650         Initialize __libc_locking_needed.
9651         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9652         instead of __register_pthread_fork_handler.
9653         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9654         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9655         fork-gen with libc_pthread_init.
9656         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9657         of __register_pthread_fork_handler.
9658         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9659         of __register_pthread_fork_handler.
9660         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9661         __libc_locking_needed to determine whether lock prefix can be avoided.
9662         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9664 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9666         * Makefile (tests): Add tst-cleanup1.
9667         * tst-cleanup1.c: New file.
9668         * cancellation.c (__cleanup_thread): Removed.
9669         (__do_cancel): Remove call to __cleanup_thread.
9670         * pthreadP.h: Remove __cleanup_thread prorotype.
9672         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9673         Remember function and argument even if cancellation handler
9674         function is not available.
9675         (__libc_cleanup_region_end): Execute registered function directly if
9676         pthread functions are not available.
9677         (__libc_cleanup_end): Likewise.
9679         * init.c (__pthread_initialize_minimal): Fix initialization in
9680         static lib by preventing gcc from being too clever.
9682 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9684         * init.c (__pthread_initialize_minimal): Remove unneccesary
9685         sigaddset call.
9687         * Makefile (tests): We can run tst-locale2 now.
9689 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9691         * Versions: Remove duplicated sigwait entry.
9693 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9695         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9696         inside libpthread.
9698         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9700         * pthreadP.h: Declare __pthread_enable_asynccancel and
9701         __pthread_disable_asynccancel.
9702         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9703         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9704         * cancellation.c (__pthread_enable_asynccancel): New function.
9705         (__pthread_disable_asynccancel): New function.
9706         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9707         * pt-close.c: Likewise.
9708         * pt-connect.c: Likewise.
9709         * pt-creat.c: Likewise.
9710         * pt-fcntl.c: Likewise.
9711         * pt-fsync.c: Likewise.
9712         * pt-lseek.c: Likewise.
9713         * pt-lseek64.c: Likewise.
9714         * pt-msgrcv.c: Likewise.
9715         * pt-msgsnd.c: Likewise.
9716         * pt-msync.c: Likewise.
9717         * pt-nanosleep.c: Likewise.
9718         * pt-open.c: Likewise.
9719         * pt-open64.c: Likewise.
9720         * pt-pause.c: Likewise.
9721         * pt-poll.c: Likewise.
9722         * pt-pread.c: Likewise.
9723         * pt-pread64.c: Likewise.
9724         * pt-pselect.c: Likewise.
9725         * pt-pwrite.c: Likewise.
9726         * pt-pwrite64.c: Likewise.
9727         * pt-read.c: Likewise.
9728         * pt-readv.c: Likewise.
9729         * pt-recv.c: Likewise.
9730         * pt-recvfrom.c: Likewise.
9731         * pt-recvmsg.c: Likewise.
9732         * pt-select.c: Likewise.
9733         * pt-send.c: Likewise.
9734         * pt-sendmsg.c: Likewise.
9735         * pt-sendto.c: Likewise.
9736         * pt-sigpause.c: Likewise.
9737         * pt-sigsuspend.c: Likewise.
9738         * pt-sigtimedwait.c: Likewise.
9739         * pt-sigwait.c: Likewise.
9740         * pt-sigwaitinfo.c: Likewise.
9741         * pt-system.c: Likewise.
9742         * pt-tcdrain.c: Likewise.
9743         * pt-wait.c: Likewise.
9744         * pt-waitid.c: Likewise.
9745         * pt-waitpid.c: Likewise.
9746         * pt-write.c: Likewise.
9747         * pt-writev.c: Likewise.
9748         * pthread_join.c: Likewise.
9749         * pthread_timedjoin.c: Likewise.
9751         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9752         (__xpg_sigpause): New function.
9753         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9755 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
9757         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
9759         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
9760         _GI_pthread_cleanup_pop to pthreadP.h.
9762         * ftrylockfile.c: Use _IO_lock_trylock instead of
9763         pthread_mutex_trylock.
9765         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
9766         (CANCEL_RESET): Likewise.
9767         (__pthread_setcanceltype_): Declare.
9768         (__pthread_mutex_lock_internal): Declare.
9769         (__pthread_mutex_unlock_internal): Declare.
9770         (__pthread_once_internal): Declare.
9771         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
9772         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
9774         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
9775         and pthread_mutex_unlock.
9776         * pthread_cond_wait.c: Likewise.
9777         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
9778         * pthread_mutex_unlock.c: Likewise.
9780         * pthread_setcanceltype.c: Add additional alias
9781         __pthread_setcanceltype.
9783         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
9784         * sem_open.c (sem_open): Likewise.
9785         Use __libc_open, __libc_write, and __libc_close instead of
9786         open, write, and close respectively.
9788         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
9789         Rewrite as statement expression since it must return a value.
9791         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
9792         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
9793         __pthread_kill.
9795         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
9796         alias __pthread_once_internal.
9798         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
9800 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
9802         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
9803         * tst-stdio1.c: New file.
9804         * tst-stdio2.c: New file.
9806         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
9808         * Makefile (tests): Comment out tst-locale2 for now.
9809         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
9811         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
9812         -D_IO_MTSAFE_IO.
9813         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
9814         Use _IO_lock_init instead of explicit assignment.
9816         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
9817         Define __libc_lock_* and __libc_lock_recursive macros with
9818         lowlevellock macros, not pthread mutexes.
9820         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
9821         of pthread_mutex_lock.
9822         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
9823         instead of pthread_mutex_unlock.
9825 2002-12-06  Roland McGrath  <roland@redhat.com>
9827         * allocatestack.c (__stack_user): Use uninitialized defn.
9828         * init.c (__pthread_initialize_minimal): Initialize it here.
9830 2002-12-05  Roland McGrath  <roland@redhat.com>
9832         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
9833         string.
9834         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
9836         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
9837         missing & here too.
9839 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
9841         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9842         lowlevellock.
9843         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
9844         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
9845         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
9846         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
9847         for __libc_lock_* macros.
9848         * Makefile (routines): Add libc-lowlevellock.
9850 2002-10-09  Roland McGrath  <roland@redhat.com>
9852         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
9853         Under [__PIC__], call the function via the pointer fetched for
9854         comparison rather than a call by name that uses the PLT.
9855         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
9856         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
9857         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
9858         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
9859         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
9861 2002-12-04  Roland McGrath  <roland@redhat.com>
9863         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
9865         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
9866         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
9868         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
9870 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9872         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
9873         a completely opaque, non-integer type.
9874         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9876 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
9878         * sysdeps/i386/tls.h: Include stdlib.h.
9879         * sysdeps/x86_64/tls.h: Likewise.
9881 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9883         * Makefile (tests): Add tst-locale2.
9884         (tests-static): Likewise.
9885         * tst-locale2.c: New file.
9887         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
9888         volatile and add memory clobbers to lock operations.
9890 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
9892         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
9893         * sysdeps/i386/i486/bits/atomic.h: New file.
9894         * sysdeps/i386/i586/bits/atomic.h: New file.
9895         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
9896         include i486 version.
9897         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
9898         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
9899         Patch by Marijn Ros <marijn@mad.scientist.com>.
9901         * allocatestack.c (get_cached_stack): Don't crash if we first
9902         found a stack with a larger size then needed.
9903         Reported by Hui Huang <hui.huang@sun.com>.
9905         * Makefile (tests): Add tst-sysconf.
9906         * tst-sysconf.c: New file.
9908         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
9909         PTHREAD_THREADS_MAX.
9911 2002-12-02  Roland McGrath  <roland@redhat.com>
9913         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
9914         Declare using hidden_proto instead of attribute_hidden, so there are
9915         non-.hidden static symbols for gdb to find.
9916         (__pthread_keys): Likewise.
9917         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
9918         * allocatestack.c (__stack_user): Likewise.
9919         * pthread_create.c (__pthread_keys): Likewise.
9920         (__nptl_threads_events, __nptl_last_event): Make these static instead
9921         of hidden.
9922         * pthread_key_create.c (__pthread_pthread_keys_max,
9923         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
9925 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
9927         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
9928         statically.
9929         * tst-locale1.c: New file.
9931         * pthread_cond_timedwait.c: Include <stdlib.h>.
9933         * Makefile (tests): Add tst-fork2 and tst-fork3.
9934         * tst-fork2.c: New file.
9935         * tst-fork3.c: New file.
9937 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
9939         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
9941         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
9942         require it to 200112L.
9944         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
9945         instruction only if HAVE_CMOV is defined.
9946         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
9948         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
9950         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
9952         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
9954         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
9956 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
9958         * sysdeps/x86_64/bits/atomic.h: New file.
9960         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
9961         16-bit operations.
9963         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
9964         possible since gettid cannot fail.
9966         * sysdeps/x86_64/pthreaddef.h: New file.
9968         * sysdeps/i386/pthreaddef.h (gettid): Removed.
9970         * sysdeps/x86_64/pthread_spin_init.c: New file.
9971         * sysdeps/x86_64/pthread_spin_lock.c: New file.
9972         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
9973         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
9975         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
9976         Add missing lock prefix.  Minute optimization.
9978         * tst-spin2.c (main): Also check successful trylock call.
9980         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
9981         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
9983         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
9984         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
9986         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
9987         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
9988         value in case of an error.  Add support for INTERNAL_SYSCALL.
9990         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
9991         value in case of an error.
9993         * sysdeps/x86_64/tls.h: New file.
9995 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
9997         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
9998         takes the array member name and the index as parameters.
9999         (THREAD_SETMEM_NC): Likewise.
10000         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10001         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10002         interfaces.
10004         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10005         to decide which code to use.
10006         (THREAD_SETMEM_NC): Likewise.
10008         * allocatestack.c (queue_stack): Don't remove stack from list here.
10009         Do it in the caller.  Correct condition to prematurely terminate
10010         loop to free stacks.
10011         (__deallocate_stack): Remove stack from list here.
10013 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10015         * Makefile (tests): Add tst-stack1.
10016         * tst-stack1.c: New file.
10018         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10019         provided stack.
10021         * pthread_attr_getstack.c: Return bottom of the thread area.
10023 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10025         * Makefile (libpthread-routines): Add pt-allocrtsig and
10026         pthread_kill_other_threads.
10027         * pt-allocrtsig.c: New file.
10028         * pthread_kill_other_threads.c: New file.
10029         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10030         all three functions.
10031         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10032         allocrtsig.
10033         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10034         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10035         and __libc_allocate_rtsig_private.
10036         * Versions (libpthread): Export pthread_kill_other_threads_np,
10037         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10039 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10041         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10042         the end of the stack.  Adjust computations.
10043         When mprotect call fails dequeue stack and free it.
10044         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10045         attribute.
10046         * pthread_getattr_np.c: Likewise.
10048         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10049         surprises.
10051 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10053         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10054         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10056 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10058         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10059         * pthread_setspecific.c: Likewise.
10061 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10063         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10064         definitions.  Get them from the official place.
10065         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10067         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10068         Use new CLONE_ flags in clone() calls.
10070         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10071         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10073         * Versions: Add pthread_* functions for libc.
10074         * forward.c: New file.
10076         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10077         errno-loc.
10078         * herrno.c: New file.
10079         * res.c: New file.
10081         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10082         sem_trywait, and sem_timedwait.  Add herrno and res.
10083         * sem_init.c: Don't initialize lock and waiters members.
10084         * sem_open.c: Likewise.
10085         * sem_post.c: Removed.
10086         * sem_wait.c: Removed.
10087         * sem_trywait.c: Removed.
10088         * sem_timedwait.c: Removed.
10089         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10090         Includes full implementations of sem_post, sem_wait, sem_trywait,
10091         and sem_timedwait.
10092         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10093         for new implementation.
10094         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10095         and waiters fields.
10097         * tst-sem3.c: Improve error message.
10098         * tst-signal3.c: Likewise.
10100         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10101         to tell the kernel about the termination futex and to initialize tid
10102         member.  Don't initialize main_thread.
10103         * descr.h (struct pthread): Remove main_thread member.
10104         * cancelllation.c (__do_cancel): Remove code handling main thread.
10105         The main thread is not special anymore.
10107         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10108         size of the stacks to stack_cache_actsize.
10110         * pt-readv.c: Add missing "defined".
10111         * pt-sigwait.c: Likewise.
10112         * pt-writev.c: Likewise.
10114 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10116         * Versions: Export __connect from libpthread.
10117         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10119         * Makefile (libpthread-routines): Add pt-raise.
10120         * sysdeps/unix/sysv/linux/raise.c: New file.
10121         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10122         * sysdeps/generic/pt-raise.c: New file.
10124         * pthread_cond_init.c: Initialize all data elements of the condvar
10125         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10127         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10128         * pthread_create.c: Likewise.
10130         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10131         * tst-key1.c: New file.
10132         * tst-key2.c: New file.
10133         * tst-key3.c: New file.
10135         * Versions: Export pthread_detach for version GLIBC_2.0.
10136         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10138 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10140         * pthread_key_create.c: Terminate search after an unused key was found.
10141         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10143         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10144         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10146 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10148         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10149         dynamic lookup for errno in PIC.
10151         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10152         release the stack lock as soon as possible.
10153         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10154         the static TLS block.
10155         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10157         * cancellation.c: Renamed from cancelation.c.
10158         * Makefile: Adjust accordingly.
10159         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10160         * cleanup_defer.c: Use CANCELLATION_P.
10161         * pthread_testcancel.c: Likewise.
10162         * descr.h: Fix spelling in comments.
10163         * init.c: Likewise.
10164         * pthread_getattr_np.c: Likewise.
10165         * pthread_getschedparam.c: Likewise.
10166         * pthread_setschedparam.c: Likewise.
10167         * Versions: Likewise.
10169         * pt-pselect.c: New file.
10170         * Makefile (libpthread-routines): Add pt-pselect.
10171         * Versions: Add pselect.
10173         * tst-cancel4.c: New file.
10174         * Makefile (tests): Add tst-cancel4.
10176 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10178         * pthread_mutex_lock.c: Always record lock ownership.
10179         * pthread_mutex_timedlock.c: Likewise.
10180         * pthread_mutex_trylock.c: Likewise.
10182         * pt-readv.c: New file.
10183         * pt-writev.c: New file.
10184         * pt-creat.c: New file.
10185         * pt-msgrcv.c: New file.
10186         * pt-msgsnd.c: New file.
10187         * pt-poll.c: New file.
10188         * pt-select.c: New file.
10189         * pt-sigpause.c: New file.
10190         * pt-sigsuspend.c: New file.
10191         * pt-sigwait.c: New file.
10192         * pt-sigwaitinfo.c: New file.
10193         * pt-waitid.c: New file.
10194         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10195         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10196         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10197         * Versions: Add all the new functions.
10199         * tst-exit1.c: New file.
10200         * Makefile (tests): Add tst-exit1.
10202         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10204 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10206         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10208         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10209         call.  pthread_join is an official cancellation point.
10210         * pthread_timedjoin.c: Likewise.
10212         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10213         and the condvar's mutex are retrieved.
10214         * pthread_cond_timedwait.c: Likewise.
10215         Reported by dice@saros.East.Sun.COM.
10217 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10219         * pthreadP.h: Cut out all type definitions and move them...
10220         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10221         * pthreadP.h: Include <internaltypes.h>.
10223         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10224         performance tweaks.
10226         * sem_trywait.c: Shuffle #includes around to get right order.
10227         * sem_timedwait.c: Likewise.
10228         * sem_post.c: Likewise.
10229         * sem_wait.c: Likewise.
10231         * nptl 0.3 released.
10233         * Makefile (tests): Add tst-signal3.
10234         * tst-signal3.c: New file.
10236 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10238         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10239         the asms modify the sem object.
10240         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10242         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10243         the actual members.
10244         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10245         * semaphoreP.h: Include pthreadP.h.
10246         * sem_getvalue.c: Adjust to sem_t change.
10247         * sem_init.c: Likewise.
10248         * sem_open.c: Likewise.
10249         * sem_post.c: Likewise.
10250         * sem_timedwait.c: Likewise.
10251         * sem_trywait.c: Likewise.
10252         * sem_wait.c: Likewise.
10254 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10256         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10257         * tst-basic2.c: New file.
10258         * tst-exec1.c: New file.
10259         * tst-exec2.c: New file.
10260         * tst-exec3.c: New file.
10262         * tst-fork1.c: Remove extra */.
10264         * nptl 0.2 released.  The API for IA-32 is complete.