e22f3870a9d85a1219489ef08a412d828a442288
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2008-01-31  Roland McGrath  <roland@redhat.com>
2
3         * Makefile (omit-deps): Variable removed.
4
5 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
6
7         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
8         unnecessary addr32 prefix.
9
10 2008-01-29  Roland McGrath  <roland@redhat.com>
11
12         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
13
14 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
15
16         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
17
18 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
19
20         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
21         a scratch register.
22         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
23         (__lll_lock_wait_private): Fix typo.
24         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
25         (pthread_barrier_wait): Likewise.  Adjust XADD use.
26         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
27         Adjust XADD use.
28         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
29         (pthread_rwlock_timedrdlock): Return correct return value.
30         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
31         (pthread_rwlock_timedwrlock): Likewise.
32
33 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
34
35         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
36         thread returns the program exits with an error code.
37
38 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
39
40         * pthread-errnos.sym: Add EOVERFLOW.
41         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
42         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
43         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
44         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
45
46 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
47
48         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
49         parameter.  Passed it as permission to mmap.
50         * allocatestack.c (allocate_stack): Pass prot as second parameter
51         to ARCH_RETRY_MMAP.
52
53 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
54
55         * tst-basic7.c: Allocate memory for the stack.
56
57         [BZ #5465]
58         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
59         (__pthread_cond_timedwait): Don't use VDSO.
60         Patch by Michal Januszewski.
61
62 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
63
64         [BZ #5455]
65         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
66         Allow label before pthread_cleanup_pop.
67         (pthread_cleanup_pop_restore_np): Likewise.
68
69 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
70
71         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
72         Store 2 before returning ETIMEDOUT.
73
74 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
75
76         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
77         Store 2 before returning ETIMEDOUT.
78         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
79         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
80         (__lll_lock_wait_private): Optimize.
81         (__lll_lock_wait): Likewise.
82
83 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
84
85         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
86         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
87         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
88
89 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
90
91         [BZ #5240]
92         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
93         If we time out, try one last time to lock the futex to avoid
94         losing a wakeup signal.
95         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
96         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
97
98         [BZ #5245]
99         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
100         if necessary.
101
102 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
103
104         [BZ #5245]
105         * allocatestack.c (allocate_stack): Change ENOMEM error in case
106         mmap failed to EAGAIN.
107         * Makefile (tests): Add tst-basic7.
108         * tst-basic7.c: New file.
109
110 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
111
112         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
113         Use __linkin_atfork.
114
115 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
116
117         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
118         missing line continuations.
119         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
120         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
121
122 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
123
124         [BZ #5220]
125         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
126         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
127         (struct timer): Add next element.
128         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
129         enqueue timer structure into __active_timer_sigev_thread list.
130         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
131         remove timer struct from __active_timer_sigev_thread.
132         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
133         Before using timer structure make sure it is still on the
134         __active_timer_sigev_thread list.  Keep lock until done.
135         Define __active_timer_sigev_thread and
136         __active_timer_sigev_thread_lock.
137
138 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
139
140         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
141         Redefine thread_atfork for use of ATFORK_MEM.
142         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
143         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
144         function.
145         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
146         Use atomic operation when removing first element of list.
147
148 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
149
150         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
151         routine instead of an alias to __new_sem_post.
152
153 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
154
155         * init.c (__pthread_initialize_minimal): Initialize word to appease
156         valgrind.
157
158 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
159
160         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
161         libc.so just clear NAME.
162         (__libc_rwlock_fini): Nop inside of libc.so.
163         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
164         all zeros.
165
166 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
167
168         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
169         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
170         unlocking failed.
171         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
172
173 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
174
175         [BZ #4938]
176         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
177         reclaimed stack if necessary.
178         * Makefile (tests): Add tst-tsd6.
179         * tst-tsd6.c: New file.
180
181 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
182
183         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
184         Add private argument.
185
186 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
187
188         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
189         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
190
191 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
192
193         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
194         (__lll_robust_timedlock): Pass private as last argument to
195         __lll_robust_timedlock_wait.
196         (__lll_unlock): Fix a pasto.
197
198 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
199
200         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
201         sparc_old_sem): New structs.
202         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
203         (__sem_wait_cleanup): New function.
204         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
205         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
206         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
207         lll_futex_wait.
208         (__old_sem_wait): New function.
209         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
210         nptl/sysdeps/unix/sysv/linux/sparc version.
211         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
212         Likewise.
213         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
214         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
215         (__new_sem_trywait): Use sparc_old_sem structure.
216         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
217         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
218         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
219         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
220         lll_futex_timed_wait.
221         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
222         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
223         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
224         lll_futex_wake.
225         (__old_sem_post): New function.
226         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
227         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
228         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
229         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
230         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
231         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
232
233 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
234
235         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
236         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
237         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
238         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
239         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
240         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
241         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
242         Use FUTEX_WAKE_OP.
243         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
244         kernel-features.h and tcb-offsets.h.
245         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
246         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
247         process private.
248         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
249         tcb-offsets.h.
250         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
251         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
252         process private.
253         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
254         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
256         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
257         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
258         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
259         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
260
261 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
262
263         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
264         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
265         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
266         lll_futex_timed_wait.
267
268         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
269         __lll_robust_unlock): Rewrite as macros instead of inline functions.
270         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
271         __lll_robust_unlock, __lll_wait_tid): Likewise.
272
273 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
274
275         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
276         Fix a pasto.
277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
278         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
279         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
280         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
281         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
282         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
283         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
284         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
285         kernel-features.h.
286         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
287         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
288         process private.  Switch DW_CFA_advance_loc1 and some
289         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
290         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
291         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
292         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
293         process private.  Switch DW_CFA_advance_loc{1,2} and some
294         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
295         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
296         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
297         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
298         Likewise.
299         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
300         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
301         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
302         Likewise.
303         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
304         (__pthread_cond_broadcast): Compare %r8 instead of
305         dep_mutex-cond_*(%rdi) with $-1.
306         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
307         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
308         of oring.
309
310 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
311
312         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
313
314 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
315
316         * allocatestack.c: Include kernel-features.h.
317         * pthread_create.c: Likewise.
318         * pthread_mutex_init.c: Likewise.
319         * init.c: Likewise.
320         * pthread_cond_timedwait.c: Likewise.
321         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
322         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
323         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
324         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
325         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
326         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
327         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
328         Likewise.
329         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
330         Likewise.
331         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
332         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
333         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
334         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
335
336 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
337
338         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
339         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
340         byte elements.  One of them is the new __shared element.
341         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
342         adjust names of other padding elements.
343         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
344         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
345         byte elements.  One of them is the new __shared element.
346         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
347         adjust names of other padding elements.
348         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
349         Renamed __pad1 element to __shared, adjust names of other padding
350         elements.
351         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
352         (pthread_rwlock_t): Likewise.
353         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
354         typo.
355
356 2007-08-09  Anton Blanchard  <anton@samba.org>
357
358         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
359
360 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
361
362         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
363         <kernel-features.h>.
364         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
365
366 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
367
368         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
369         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
370         dealing with robust mutexes.
371         * pthread_mutex_timedlock.c: Likewise.
372         * pthread_mutex_trylock.c: Likewise.
373         * pthread_mutex_unlock.c: Likewise.
374         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
375
376 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
377
378         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
379         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
380         (PTHREAD_MUTEX_PSHARED): Define.
381         * pthread_mutex_init.c (__pthread_mutex_init): Set
382         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
383         mutexes.
384         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
385         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
386         as second argument to lll_lock.
387         (LLL_MUTEX_TRYLOCK): Take mutex as argument
388         instead of its __data.__lock field.
389         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
390         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
391         to lll_robust_lock.
392         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
393         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
394         instead of mutex->__data.__kind directly, pass
395         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
396         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
397         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
398         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
399         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
400         to lll_timedlock, lll_robust_timedlock, lll_unlock and
401         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
402         of mutex->__data.__kind directly.
403         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
404         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
405         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
406         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
407         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
408         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
409         and lll_futex_wake.
410         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
411         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
412         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
413         directly.
414         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
415         Take mutex as argument instead of its __data.__lock field, pass
416         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
417         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
418         __data.__lock field.
419         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
420         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
421         to lll_robust_cond_lock.
422         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
423         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
424         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
425         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
426         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
427         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
428         lll_futex_wait.
429         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
430         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
431         lll_futex_wake.
432         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
433         pshared variable, pass it to lll_lock, lll_unlock,
434         lll_futex_timedwait and lll_futex_wake.
435         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
436         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
437         and lll_futex_wake.
438         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
439         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
440         macro.
441         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
442         lll_futex_wake_unlock): Likewise.
443         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
444         Likewise.
445         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
446         lll_futex_wake_unlock): Likewise.
447         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
448         Likewise.
449         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
450         lll_futex_wake_unlock): Likewise.
451         (lll_futex_wake): Fix a typo.
452         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
453         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
454         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
455         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
456         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
457         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
458         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
459         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
460         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
461         (__pthread_cond_timedwait): Likewise.
462         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
463         (__condvar_cleanup, __pthread_cond_wait): Likewise.
464
465 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
466
467         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
468         Don't use CGOTSETUP and CGOTRESTORE macros.
469         (CGOTSETUP, CGOTRESTORE): Remove.
470         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
471         @local symbol.
472
473 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
474
475         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
476         definitions for private futexes.
477         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
478         kernel-features.h and lowlevellock.h.  Use private futexes if
479         they are available.
480         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
481         (__lll_mutex_lock_wait): Rename to
482         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
483         (__lll_mutex_timedlock_wait): Rename to ...
484         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
485         Don't compile in for libc.so.
486         (__lll_mutex_unlock_wake): Rename to ...
487         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
488         (__lll_timedwait_tid): Use __NR_gettimeofday.
489         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
490         the header from assembler.  Renamed all lll_mutex_* resp.
491         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
492         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
493         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
494         Define.
495         (__lll_lock_wait_private): Add prototype.
496         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
497         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
498         __lll_unlock_wake): Likewise.
499         (lll_lock): Add private argument.  Call __lll_lock_wait_private
500         if private is constant LLL_PRIVATE.
501         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
502         lll_timedlock, lll_robust_timedlock): Add private argument.
503         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
504         if private is constant LLL_PRIVATE.
505         (lll_robust_unlock, lll_robust_dead): Add private argument.
506         (lll_lock_t): Remove.
507         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
508         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
509         lll_cond_wake, lll_cond_broadcast): Remove.
510         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
511         kernel-features.h and lowlevellock.h.
512         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
513         (LOAD_FUTEX_WAIT): Define.
514         (__lll_robust_mutex_lock_wait): Rename to ...
515         (__lll_robust_lock_wait): ... this.  Add private argument.
516         Use LOAD_FUTEX_WAIT macro.
517         (__lll_robust_mutex_timedlock_wait): Rename to ...
518         (__lll_robust_timedlock_wait): ... this.    Add private argument.
519         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
520         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
521         lowlevellock.h.
522         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
523         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
524         __lll_mutex_{lock,unlock}_*.
525         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
526         lowlevellock.h and pthread-errnos.h.
527         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
528         FUTEX_CMP_REQUEUE, EINVAL): Remove.
529         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
530         __lll_mutex_{lock,unlock}_*.
531         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
532         lowlevellock.h and pthread-errnos.h.
533         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
534         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
535         __lll_mutex_{lock,unlock}_*.
536         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
537         lowlevellock.h.
538         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
539         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
540         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
541         (__condvar_tw_cleanup): Likewise.
542         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
543         lowlevellock.h.
544         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
545         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
546         __lll_mutex_{lock,unlock}_*.
547         ( __condvar_w_cleanup): Likewise.
548         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
549         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
550         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
551         lowlevellock.h.
552         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
553         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
554         __lll_mutex_{lock,unlock}_*.
555         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
556         lowlevellock.h.
557         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
558         FUTEX_PRIVATE_FLAG): Remove.
559         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
560         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
561         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
562         lowlevellock.h.
563         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
564         FUTEX_PRIVATE_FLAG): Remove.
565         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
566         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
567         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
568         lowlevellock.h.
569         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
570         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
571         __lll_mutex_{lock,unlock}_*.
572         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
573         lowlevellock.h.
574         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
575         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
576         __lll_mutex_{lock,unlock}_*.
577         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
578         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
579         (__new_sem_post): Use standard initial exec code sequences.
580         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
581         lowlevellock.h.
582         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
583         FUTEX_PRIVATE_FLAG): Remove.
584         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
585         exec code sequences.
586         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
587         (__new_sem_trywait): Use standard initial exec code sequences.
588         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
589         (__new_sem_wait): Use standard initial exec code sequences.
590
591 2007-07-31  Anton Blanchard  <anton@samba.org>
592
593         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
594         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
595         atomic_full_barrier.
596
597 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
598
599         * allocatestack.c (stack_cache_lock): Change type to int.
600         (get_cached_stack, allocate_stack, __deallocate_stack,
601         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
602         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
603         as second argument to lll_lock and lll_unlock macros on
604         stack_cache_lock.
605         * pthread_create.c (__find_in_stack_list): Likewise.
606         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
607         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
608         as second argument.
609         * descr.h (struct pthread): Change lock and setxid_futex field
610         type to int.
611         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
612         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
613         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
614         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
615         Likewise.
616         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
617         * pthread_cond_init.c (__pthread_cond_init): Likewise.
618         * pthreadP.h (__attr_list_lock): Change type to int.
619         * pthread_attr_init.c (__attr_list_lock): Likewise.
620         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
621         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
622         lll_{,un}lock.
623         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
624         also for lll_futex_{wake,wait}.
625         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
626         a pointer to const.
627         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
628         LLL_SHARED as second argument to lll_{,un}lock.
629         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
630         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
631         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
632         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
633         Likewise.
634         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
635         as second argument to lll_{,un}lock macros on pd->lock.
636         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
637         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
638         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
639         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
640         Likewise.
641         * sysdeps/pthread/createthread.c (do_clone, create_thread):
642         Likewise.
643         * pthread_once.c (once_lock): Change type to int.
644         (__pthread_once): Pass LLL_PRIVATE as second argument to
645         lll_{,un}lock macros on once_lock.
646         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
647         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
648         rwlock->__data.__shared as second argument to them and similarly
649         for lll_futex_w*.
650         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
651         Likewise.
652         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
653         Likewise.
654         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
655         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
656         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
657         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
658         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
659         to lll_{,un}lock macros on __sem_mappings_lock.
660         * sem_open.c (check_add_mapping): Likewise.
661         (__sem_mappings_lock): Change type to int.
662         * semaphoreP.h (__sem_mappings_lock): Likewise.
663         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
664         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
665         instead of lll_*mutex_*, pass LLL_SHARED as last
666         argument.
667         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
668         pass LLL_SHARED as last argument.
669         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
670         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
671         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
672         pass LLL_SHARED as last argument.
673         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
674         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
675         LLL_SHARED as last argument.
676         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
677         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
678         Similarly.
679         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
680         __libc_lock_lock_recursive, __libc_lock_unlock,
681         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
682         argument to lll_{,un}lock.
683         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
684         _IO_lock_unlock): Likewise.
685         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
686         compound literal.
687         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
688         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
689         __fork_lock.
690         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
691         free_mem): Likewise.
692         (__fork_lock): Change type to int.
693         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
694         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
695         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
696         lll_futex_wake.
697         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
698         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
699         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
700         New function.
701         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
702         pass it through to lll_futex_*wait, only compile in when
703         IS_IN_libpthread.
704         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
705         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
706         argument and pass it through to lll_futex_*wait.
707         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
708         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
709         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
710         inline functions to __lll_* resp. __lll_robust_*.
711         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
712         (lll_mutex_dead): Add private argument.
713         (__lll_lock_wait_private): New prototype.
714         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
715         __lll_robust_lock_timedwait): Add private argument to prototypes.
716         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
717         call __lll_lock_wait_private, otherwise pass private to
718         __lll_lock_wait.
719         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
720         __lll_robust_timedlock): Add private argument, pass it to
721         __lll_*wait functions.
722         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
723         call __lll_unlock_wake_private, otherwise pass private to
724         __lll_unlock_wake.
725         (__lll_robust_unlock): Add private argument, pass it to
726         __lll_robust_unlock_wake.
727         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
728         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
729         argument, pass it through to __lll_* inline function.
730         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
731         (lll_lock_t): Remove.
732         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
733         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
734         lll_cond_wake, lll_cond_broadcast): Remove.
735         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
736         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
737         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
738         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
739         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
740         the header from assembler.  Renamed all lll_mutex_* resp.
741         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
742         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
743         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
744         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
745         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
746         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
747         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
748         Remove prototype.
749         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
750         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
751         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
752         (lll_trylock): Likewise, use __lll_trylock_asm, pass
753         MULTIPLE_THREADS_OFFSET as another asm operand.
754         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
755         MULTIPLE_THREADS_OFFSET as last asm operand, call
756         __lll_lock_wait_private if private is constant LLL_PRIVATE,
757         otherwise pass private as another argument to __lll_lock_wait.
758         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
759         lll_timedlock, lll_robust_timedlock): Add private argument, pass
760         private as another argument to __lll_*lock_wait call.
761         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
762         MULTIPLE_THREADS_OFFSET as another asm operand, call
763         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
764         otherwise pass private as another argument to __lll_unlock_wake.
765         (lll_robust_unlock): Add private argument, pass private as another
766         argument to __lll_unlock_wake.
767         (lll_robust_dead): Add private argument, use __lll_private_flag
768         macro.
769         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
770         LLL_MUTEX_LOCK_INITIALIZER.
771         (lll_lock_t): Remove.
772         (LLL_LOCK_INITIALIZER_WAITERS): Define.
773         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
774         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
775         lll_cond_wake, lll_cond_broadcast): Remove.
776         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
777         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
778         2007-05-2{3,9} changes.
779         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
780         kernel-features.h and lowlevellock.h.
781         (LOAD_PRIVATE_FUTEX_WAIT): Define.
782         (LOAD_FUTEX_WAIT): Rewritten.
783         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
784         define.
785         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
786         (__lll_mutex_lock_wait): Rename to ...
787         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
788         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
789         (__lll_mutex_timedlock_wait): Rename to ...
790         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
791         contains private argument.  Don't compile in for libc.so.
792         (__lll_mutex_unlock_wake): Rename to ...
793         (__lll_unlock_wake): ... this.  %ecx contains private argument.
794         Don't compile in for libc.so.
795         (__lll_timedwait_tid): Use __NR_gettimeofday.
796         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
797         kernel-features.h and lowlevellock.h.
798         (LOAD_FUTEX_WAIT): Define.
799         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
800         define.
801         (__lll_robust_mutex_lock_wait): Rename to ...
802         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
803         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
804         macro.
805         (__lll_robust_mutex_timedlock_wait): Rename to ...
806         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
807         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
808         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
809         lowlevellock.h.
810         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
811         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
812         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
813         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
814         to __lll_lock_wait in %edx.
815         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
816         Include lowlevellock.h and pthread-errnos.h.
817         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
818         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
819         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
820         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
821         pass LLL_SHARED in %ecx to both __lll_lock_wait and
822         __lll_unlock_wake.
823         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
824         Include lowlevellock.h and pthread-errnos.h.
825         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
826         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
827         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
828         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
829         pass LLL_SHARED in %ecx to both __lll_lock_wait and
830         __lll_unlock_wake.
831         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
832         Include lowlevellock.h.
833         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
834         Don't define.
835         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
836         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
837         pass LLL_SHARED in %ecx to both __lll_lock_wait and
838         __lll_unlock_wake.  Use __NR_gettimeofday.
839         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
840         Include lowlevellock.h.
841         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
842         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
843         to __lll_*, pass cond_lock address in %edx rather than %ecx to
844         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
845         and __lll_unlock_wake.
846         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
847         Include lowlevellock.h.
848         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
849         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
850         MUTEX(%ebx) address in %edx rather than %ecx to
851         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
852         and __lll_unlock_wake.  Move return value from %ecx to %edx
853         register.
854         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
855         Include lowlevellock.h.
856         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
857         Don't define.
858         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
859         MUTEX(%ebp) address in %edx rather than %ecx to
860         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
861         and __lll_unlock_wake.  Move return value from %ecx to %edx
862         register.  Use __NR_gettimeofday.
863         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
864         Include lowlevellock.h.
865         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
866         Don't define.
867         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
868         MUTEX(%ebp) address in %edx rather than %ecx to
869         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
870         and __lll_unlock_wake.  Move return value from %ecx to %edx
871         register.  Use __NR_gettimeofday.
872         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
873         Include lowlevellock.h.
874         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
875         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
876         MUTEX(%edi) address in %edx rather than %ecx to
877         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
878         and __lll_unlock_wake.
879         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
880         Include lowlevellock.h.
881         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
882         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
883         MUTEX(%ebx) address in %edx rather than %ecx to
884         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
885         and __lll_unlock_wake.  Move return value from %ecx to %edx
886         register.
887         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
888         lowlevellock.h.
889         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
890         define.
891         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
892         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
893         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
894         lowlevellock.h.
895         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
896         (sem_timedwait): Use __NR_gettimeofday.
897         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
898         lowlevellock.h.
899         (LOCK): Don't define.
900         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
901         lowlevellock.h.
902         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
903         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
904         are waiters.
905         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
906         2007-05-2{3,9} changes.
907         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
908         kernel-features.h and lowlevellock.h.
909         (LOAD_PRIVATE_FUTEX_WAIT): Define.
910         (LOAD_FUTEX_WAIT): Rewritten.
911         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
912         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
913         (__lll_mutex_lock_wait): Rename to ...
914         (__lll_lock_wait): ... this.  %esi is now private argument.
915         Don't compile in for libc.so.
916         (__lll_mutex_timedlock_wait): Rename to ...
917         (__lll_timedlock_wait): ... this.  %esi contains private argument.
918         Don't compile in for libc.so.
919         (__lll_mutex_unlock_wake): Rename to ...
920         (__lll_unlock_wake): ... this.  %esi contains private argument.
921         Don't compile in for libc.so.
922         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
923         kernel-features.h and lowlevellock.h.
924         (LOAD_FUTEX_WAIT): Define.
925         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
926         (__lll_robust_mutex_lock_wait): Rename to ...
927         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
928         Use LOAD_FUTEX_WAIT macro.
929         (__lll_robust_mutex_timedlock_wait): Rename to ...
930         (__lll_robust_timedlock_wait): ... this. %esi argument contains
931         private, use LOAD_FUTEX_WAIT macro.
932         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
933         lowlevellock.h.
934         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
935         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
936         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
937         __lll_lock_wait and __lll_unlock_wake.
938         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
939         Include lowlevellock.h and pthread-errnos.h.
940         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
941         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
942         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
943         pass LLL_SHARED in %esi to both __lll_lock_wait and
944         __lll_unlock_wake.
945         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
946         Include lowlevellock.h and pthread-errnos.h.
947         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
948         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
949         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
950         pass LLL_SHARED in %esi to both __lll_lock_wait and
951         __lll_unlock_wake.
952         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
953         Include lowlevellock.h.
954         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
955         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
956         pass LLL_SHARED in %esi to both __lll_lock_wait and
957         __lll_unlock_wake.
958         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
959         Include lowlevellock.h.
960         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
961         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
962         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
963         and __lll_unlock_wake.
964         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
965         Include lowlevellock.h.
966         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
967         Don't define.
968         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
969         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
970         and __lll_unlock_wake.
971         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
972         Include lowlevellock.h.
973         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
974         Don't define.
975         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
976         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
977         and __lll_unlock_wake.
978         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
979         Include lowlevellock.h.
980         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
981         Don't define.
982         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
983         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
984         and __lll_unlock_wake.
985         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
986         Include lowlevellock.h.
987         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
988         Don't define.
989         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
990         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
991         and __lll_unlock_wake.
992         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
993         Include lowlevellock.h.
994         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
995         Don't define.
996         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
997         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
998         and __lll_unlock_wake.
999         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1000         lowlevellock.h.
1001         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1002         define.
1003         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1004         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1005         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1006         lowlevellock.h.
1007         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1008         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1009         lowlevellock.h.
1010         (LOCK): Don't define.
1011         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1012         lowlevellock.h.
1013         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1014         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1015         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1016         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1017         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1018         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1019         (__lll_lock_wait_private): New function.
1020         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1021         it to lll_futex_*wait.  Don't compile in for libc.so.
1022         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1023         Remove.
1024         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1025         (struct sparc_pthread_barrier): Remove.
1026         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1027         struct sparc_pthread_barrier.  Pass
1028         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1029         and lll_futex_wait macros.
1030         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1031         Remove.
1032         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1033         Include sparc pthread_barrier_wait.c instead of generic one.
1034
1035 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1036
1037         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1038
1039         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1040         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1041         %ecx.
1042         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1043         (pthread_rwlock_timedwrlock): Likewise.
1044         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1045         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1046
1047 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1048
1049         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1050
1051 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1052
1053         * tst-locale2.c (useless): Add return statement.
1054
1055 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1056
1057         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1058         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1059         * pthread_create.c (start_thread): Likewise.
1060         * init.c (sighandler_setxid): Likewise.
1061         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1062         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1063         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1064         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1065         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1066         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1067         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1068         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1069         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1070         Likewise.
1071         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1072         Likewise.
1073         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1074         Likewise.
1075         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1076         __rtld_notify): Likewise.
1077         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1078         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1079         __pthread_once): Likewise.
1080         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1081         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1082         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1083         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1084         (lll_futex_wait): Add private argument, define as wrapper around
1085         lll_futex_timed_wait.
1086         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1087         use __lll_private_flag macro.
1088         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1089         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1090         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1091         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1092         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1093         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1094         (lll_futex_wait): Add private argument, define as wrapper around
1095         lll_futex_timed_wait.
1096         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1097         use __lll_private_flag macro.
1098         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1099         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1100         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1101         Define.
1102         (lll_futex_timed_wait, lll_futex_wake): Use it.
1103         (lll_private_futex_wait, lll_private_futex_timed_wait,
1104         lll_private_futex_wake): Removed.
1105         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1106         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1107         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1108         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1109         (lll_futex_wait): Add private argument, define as wrapper around
1110         lll_futex_timed_wait.
1111         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1112         use __lll_private_flag macro.
1113         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1114         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1115         to lll_futex_*.
1116         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1117         (lll_private_futex_wait, lll_private_futex_timed_wait,
1118         lll_private_futex_wake): Removed.
1119         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1120         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1121         (lll_private_futex_wait, lll_private_futex_timed_wait,
1122         lll_private_futex_wake): Removed.
1123         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1124         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1125         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1126         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1127         (lll_futex_wait): Add private argument, define as wrapper around
1128         lll_futex_timed_wait.
1129         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1130         use __lll_private_flag macro.
1131         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1132         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1133         to lll_futex_*.
1134         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1135         Define.
1136         (lll_futex_timed_wait, lll_futex_wake): Use it.
1137         (lll_private_futex_wait, lll_private_futex_timed_wait,
1138         lll_private_futex_wake): Removed.
1139
1140 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1141
1142         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1143         of the structure for sparc32.
1144
1145 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1146
1147         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1148
1149 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1150
1151         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1152         code used when private futexes are assumed.
1153         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1154         Likewise.
1155
1156 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1157
1158         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1159         (__lll_private_flag): Define.
1160         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1161         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1162         __lll_private_flag.
1163         (lll_private_futex_wait, lll_private_futex_timedwait,
1164         lll_private_futex_wake): Define as wrapper around non-_private
1165         macros.
1166         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1167         (__lll_private_flag): Define.
1168         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1169         (lll_private_futex_wait, lll_private_futex_timedwait,
1170         lll_private_futex_wake): Define as wrapper around non-_private
1171         macros.
1172
1173 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1174
1175         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1176         parameter to lll_futex_wait call.
1177         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1178
1179         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1180         Replace lll_futex_wait with lll_private_futex_wait.
1181         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1182         Add LLL_SHARED parameter to lll_futex_wake().
1183
1184         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1185         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1186         lll_private_futex_wake.
1187         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1188         bit from private parm before syscall.
1189         (lll_futex_timed_wait): Likewise.
1190         (lll_futex_wake): Likewise.
1191         (lll_futex_wake_unlock): Likewise.
1192         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1193         (lll_robust_mutex_unlock): Likewise.
1194         (lll_mutex_unlock_force): Likewise.
1195         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1196
1197 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1198
1199         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1200         compilation when unconditionally using private futexes.
1201         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1202         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1203         Likewise.
1204         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1205         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1206
1207 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1208
1209         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1210         Define.
1211
1212 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1213
1214         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1215         kernel-features.h.
1216
1217 2007-05-16  Roland McGrath  <roland@redhat.com>
1218
1219         * init.c (__nptl_initial_report_events): New variable.
1220         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1221         to that.
1222
1223 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1224
1225         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1226         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1227
1228 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1229
1230         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1231         implementation.
1232
1233 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1234
1235         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1236         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1237         * pthread_mutex_timedlock.c: Likewise.
1238         * pthread_mutex_trylock.c: Likewise.
1239         * pthread_mutex_unlock.c: Likewise.
1240
1241 2007-06-17  Andreas Schwab  <schwab@suse.de>
1242
1243         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1244         sections.
1245
1246 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1247
1248         * allocatestack.c (allocate_stack): Make code compile if
1249         __ASSUME_PRIVATE_FUTEX is set.
1250
1251 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1252
1253         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1254         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1256         (__pthread_rwlock_wrlock): Likewise.
1257         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1258         (pthread_rwlock_timedrdlock): Likewise.
1259         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1260         (pthread_rwlock_timedwrlock): Likewise.
1261         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1262         (__pthread_rwlock_unlock): Likewise.
1263
1264 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1265
1266         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1267         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1268         Split __flags into __flags, __shared, __pad1 and __pad2.
1269         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1270         futexes if they are available.
1271         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1272         in libc-lowlevellock.S allow using private futexes.
1273         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1274         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1275         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1276         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1277         lll_private_futex_timed_wait and lll_private_futex_wake.
1278         (lll_robust_mutex_unlock): Fix typo.
1279         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1280         field in futex command setup.
1281         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1282         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1283         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1284         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1285         if they are available.  Remove clear_once_control.
1286         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1287         futexes if they are available.
1288         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1289         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1290         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1291         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1292         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1293         Wake only when there are waiters.
1294         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1295         support.  Indicate that there are waiters.  Remove unnecessary
1296         extra cancellation test.
1297         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1298         left-over duplication of __sem_wait_cleanup.
1299
1300 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1301
1302         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1303         parameter to lll_futex_wait, lll_futex_timed_wait, and
1304         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1305         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1306         lll_private_futex_wake.
1307         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1308         * allocatestack.c: Adjust use of lll_futex_* macros.
1309         * init.c: Likewise.
1310         * lowlevellock.h: Likewise.
1311         * pthread_barrier_wait.c: Likewise.
1312         * pthread_cond_broadcast.c: Likewise.
1313         * pthread_cond_destroy.c: Likewise.
1314         * pthread_cond_signal.c: Likewise.
1315         * pthread_cond_timedwait.c: Likewise.
1316         * pthread_cond_wait.c: Likewise.
1317         * pthread_create.c: Likewise.
1318         * pthread_mutex_lock.c: Likewise.
1319         * pthread_mutex_setprioceiling.c: Likewise.
1320         * pthread_mutex_timedlock.c: Likewise.
1321         * pthread_mutex_unlock.c: Likewise.
1322         * pthread_rwlock_timedrdlock.c: Likewise.
1323         * pthread_rwlock_timedwrlock.c: Likewise.
1324         * pthread_rwlock_unlock.c: Likewise.
1325         * sysdeps/alpha/tls.h: Likewise.
1326         * sysdeps/i386/tls.h: Likewise.
1327         * sysdeps/ia64/tls.h: Likewise.
1328         * sysdeps/powerpc/tls.h: Likewise.
1329         * sysdeps/pthread/aio_misc.h: Likewise.
1330         * sysdeps/pthread/gai_misc.h: Likewise.
1331         * sysdeps/s390/tls.h: Likewise.
1332         * sysdeps/sh/tls.h: Likewise.
1333         * sysdeps/sparc/tls.h: Likewise.
1334         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1335         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1336         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1337         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1338         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1339         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1340         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1341         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1342         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1343         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1344         Likewise.
1345         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1346         * sysdeps/x86_64/tls.h: Likewise.
1347
1348 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1349
1350         * pthread_getattr_np.c: No need to install a cancellation handler,
1351         this is no cancellation point.
1352         * pthread_getschedparam.c: Likewise.
1353         * pthread_setschedparam.c: Likewise.
1354         * pthread_setschedprio.c: Likewise.
1355         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1356         lll_unlock_wake_cb.
1357         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1358         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1359         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1360         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1361         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1362         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1363         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1364         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1365         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1366         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1367         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1368         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1369
1370         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1371         whether there are more than one thread makes no sense here since
1372         we only call the slow path if the locks are taken.
1373         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1374
1375         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1376         COND_NWAITERS_SHIFT.
1377         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1378         COND_CLOCK_BITS.
1379         * pthread_cond_init.c: Likewise.
1380         * pthread_cond_timedwait.c: Likewise.
1381         * pthread_cond_wait.c: Likewise.
1382         * pthread_condattr_getclock.c: Likewise.
1383         * pthread_condattr_setclock.c: Likewise.
1384         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1385         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1386         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1387         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1388         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1389
1390 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1391
1392         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1393         unistd.h.
1394
1395         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1396         insn suffix.
1397         (THREAD_GSCOPE_GET_FLAG): Remove.
1398         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1399         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1400         changes.
1401         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1402         (THREAD_GSCOPE_GET_FLAG): Remove.
1403         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1404         instead of THREAD_GSCOPE_GET_FLAG.
1405         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1406         it.
1407         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1408         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1409         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1410         THREAD_GSCOPE_WAIT): Define.
1411         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1412         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1413         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1414         THREAD_GSCOPE_WAIT): Define.
1415         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1416         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1417         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1418         THREAD_GSCOPE_WAIT): Define.
1419         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1420         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1421         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1422         THREAD_GSCOPE_WAIT): Define.
1423
1424 2007-05-24  Richard Henderson  <rth@redhat.com>
1425
1426         * descr.h (struct pthread): Add header.gscope_flag.
1427         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1428         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1429         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1430         THREAD_GSCOPE_WAIT): Define.
1431
1432 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1433
1434         * init.c: Make it compile with older kernel headers.
1435
1436         * tst-initializers1.c: Show through exit code which test failed.
1437
1438         * pthread_rwlock_init.c: Also initialize __shared field.
1439         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1440         element in rwlock structure into four byte elements.  One of them is
1441         the new __shared element.
1442         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1443         Likewise.
1444         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1445         __shared, adjust names of other padding elements.
1446         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1447         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1448         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1449         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1450         FUTEX_PRIVATE_FLAG.
1451         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1452         futex to use private operations if possible.
1453         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1454         Likewise.
1455         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1456         Likewise.
1457         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1458         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1459         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1460         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1461         Likewise.
1462         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1463         Likewise.
1464         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1465         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1466
1467 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1468
1469         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1470         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1471         * pthread_rwlock_timedrdlock.c: Likewise.
1472         * pthread_rwlock_tryrdlock.c: Likewise.
1473
1474         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1475         optimization.
1476
1477         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1478         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1479         duplication of __sem_wait_cleanup.
1480
1481         * allocatestack.c: Revert last change.
1482         * init.c: Likewise.
1483         * sysdeps/i386/tls.h: Likewise.
1484         * sysdeps/x86_64/tls.h: Likewise.
1485         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1486         header structure.
1487         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1488
1489         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1490         Add private field.
1491         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1492         * pthread_barrier_init.c: Set private flag if pshared and private
1493         futexes are supported.
1494         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1495         private field in futex command setup.
1496         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1497
1498 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1499
1500         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1501         support.
1502         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1503         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1504         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1505         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1506         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1507
1508         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1509         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1510         fields in the structure.
1511         (__old_sem_init): New function.
1512         * sem_open.c: Initialize all fields of the structure.
1513         * sem_getvalue.c: Adjust for renamed element.
1514         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1515         (gen-as-const-headers): Add structsem.sym.
1516         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1517         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1518         struct new_sem.  Add struct old_sem.
1519         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1520         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1521         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1522         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1523         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1524         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1525         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1526         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1527         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1528         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1529         * tst-sem10.c: New file.
1530         * tst-sem11.c: New file.
1531         * tst-sem12.c: New file.
1532         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1533         of struct sem.
1534
1535 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1536             Jakub Jelinek  <jakub@redhat.com>
1537
1538         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1539         Move __pthread_enable_asynccancel right before futex syscall.
1540         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1541         Likewise.
1542
1543 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1544
1545         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1546         THREAD_COPY_PRIVATE_FUTEX): Define.
1547         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1548         THREAD_COPY_PRIVATE_FUTEX): Define.
1549         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1550         * init.c (__pthread_initialize_minimal_internal): Use
1551         THREAD_SET_PRIVATE_FUTEX.
1552
1553         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1554         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1555         THREAD_GSCOPE_FLAG_WAIT): Define.
1556         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1557         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1558         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1559         PTR_DEMANGLE.
1560         (THREAD_GSCOPE_GET_FLAG): Define.
1561         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1562         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1563         instead of ->header.gscope_flag directly.
1564
1565 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1566
1567         * init.c (__pthread_initialize_minimal_internal): Check whether
1568         private futexes are available.
1569         * allocatestack.c (allocate_stack): Copy private_futex field from
1570         current thread into the new stack.
1571         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1572         futexes if they are available.
1573         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1574         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1575         in libc-lowlevellock.S allow using private futexes.
1576         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1577         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1578         FUTEX_PRIVATE_FLAG.
1579         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1580         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1581         if they are available.
1582         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1583         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1584         * sysdeps/i386/tcb-offsets.sym: Likewise.
1585         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1586         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1587
1588 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1589
1590         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1591         Remove ptr_wait_lookup_done again.
1592         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1593         (__pthread_initialize_minimal_internal): Initialize
1594         _dl_wait_lookup_done pointer in _rtld_global directly.
1595         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1596         Remove code to code _dl_wait_lookup_done.
1597         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1598         encrypted for now.
1599
1600 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1601
1602         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1603         pthread_mutex_init failed with ENOTSUP.
1604
1605 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1606
1607         * allocatestack.c (__wait_lookup_done): New function.
1608         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1609         Add ptr_wait_lookup_done.
1610         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1611         * pthreadP.h: Declare __wait_lookup_done.
1612         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1613         Define macros to implement reference handling of global scope.
1614         * sysdeps/x86_64/tls.h: Likewise.
1615         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1616         Initialize GL(dl_wait_lookup_done).
1617
1618 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1619
1620         [BZ #4512]
1621         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1622         is detected.
1623         * pthread_mutex_timedlock.c: Likewise.
1624         * pthread_mutex_trylock.c: Likewise.
1625         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1626
1627         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1628         * tst-robust9.c: New file.
1629         * tst-robustpi9.c: New file.
1630
1631         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1632         unnecessary extra cancellation test.
1633
1634 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1635
1636         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1637         extra cancellation test.
1638         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1639
1640 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1641
1642         * descr.h (struct pthread): Rearrange members to fill hole in
1643         64-bit layout.
1644
1645         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1646         (__pthread_setaffinity_new): If syscall was successful and
1647         RESET_VGETCPU_CACHE is defined, use it before returning.
1648         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1649
1650 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1651
1652         [BZ #4455]
1653         * tst-align2.c: Include stackinfo.h.
1654         * tst-getpid1.c: Likewise.
1655
1656 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1657
1658         [BZ #4455]
1659         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1660         * tst-getpid1.c (do_test): Likewise.
1661
1662         [BZ #4456]
1663         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1664         (allocate_stack): Likewise.
1665
1666 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1667
1668         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1669         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1670         (__lll_robust_timedlock_wait): Likewise.
1671         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1672
1673 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1674
1675         [BZ #4465]
1676         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1677         * tst-cancel4.c (tf_fdatasync): New test.
1678
1679 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1680
1681         [BZ #4392]
1682         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1683         check mutexes like normal mutexes.
1684
1685         [BZ #4306]
1686         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1687         Initialize the whole sigevent structure to appease valgrind.
1688
1689 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1690
1691         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1692         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1693
1694 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1695
1696         * tst-locale1.c: Avoid warnings.
1697         * tst-locale2.c: Likewise.
1698
1699 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1700
1701         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1702         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1703
1704 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1705
1706         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1707         __extern_always_inline where appropriate.
1708         * sysdeps/pthread/pthread.h: Likewise.
1709
1710 2007-03-13  Richard Henderson  <rth@redhat.com>
1711
1712         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1713         separate cfi regions for the two subsections.
1714
1715 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1716
1717         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1718         new thread, don't just decrement it.
1719         Patch by Suzuki K P <suzuki@in.ibm.com>.
1720
1721 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1722
1723         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1724         PTHFCT_CALL definition.
1725
1726 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1727
1728         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1729         available, don't use it.
1730
1731 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1732
1733         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1734         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1735         call into the kernel to delay.
1736
1737 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1738
1739         * tst-initializers1.c: We want to test the initializers as seen
1740         outside of libc, so undefined _LIBC.
1741
1742         * pthread_join.c (cleanup): Avoid warning.
1743
1744 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1745
1746         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1747         (__lll_timedwait_tid): Add unwind info.
1748
1749         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1750         function table, mangle the pointers.
1751         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1752         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1753         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1754         demangle pointers before use.
1755         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1756         demangle pointer.
1757         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1758         * sysdeps/pthread/setxid.h: Likewise.
1759
1760 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1761
1762         * tst-rwlock7.c: Show some more information in case of correct
1763         behavior.
1764
1765 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1766
1767         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1768         (lll_futex_timed_wait): Undo part of last change, don't negate
1769         return value.
1770
1771 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1772
1773         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1774         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1775
1776 2006-12-28  David S. Miller  <davem@davemloft.net>
1777
1778         * shlib-versions: Fix sparc64 linux target specification.
1779
1780 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1781
1782         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1783         Adjust include path for pthread_barrier_wait.c move.
1784
1785 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1786
1787         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1788         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1789
1790 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1791
1792         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1793         6 argument cancellable syscalls.
1794         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1795         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1796         6 argument cancellable syscalls.
1797         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1798
1799 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1800
1801         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1802         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1803
1804 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1805
1806         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1807         __sync_lock_release instead of __sync_lock_release_si.
1808
1809 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1810
1811         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1812         Define.
1813         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1814         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1815         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1816         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1817         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1818         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1819         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1820         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1821         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1822         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1823         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1824
1825 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1826
1827         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1828         * pthread_barrier_wait.c: ...here.
1829         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1830         * pthread_cond_broadcast.c: ...here.
1831         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1832         * pthread_cond_signal.c: ...here.
1833         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1834         * pthread_cond_timedwait.c: ...here.
1835         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1836         * pthread_cond_wait.c: ...here.
1837         * sysdeps/pthread/pthread_once.c: Move to...
1838         * pthread_once.c: ...here.
1839         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1840         * pthread_rwlock_rdlock.c: ...here.
1841         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1842         * pthread_rwlock_timedrdlock.c: ...here.
1843         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1844         * pthread_rwlock_timedwrlock.c: ...here.
1845         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1846         * pthread_rwlock_unlock.c: ...here.
1847         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1848         * pthread_rwlock_wrlock.c: ...here.
1849         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1850         * pthread_spin_destroy.c: ...here.
1851         * sysdeps/pthread/pthread_spin_init.c: Move to...
1852         * pthread_spin_init.c: ...here.
1853         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1854         * pthread_spin_unlock.c: ...here.
1855         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1856         * pthread_getcpuclockid.c: ...here.
1857
1858         * init.c: USE_TLS support is now always enabled.
1859         * tst-tls5.h: Likewise.
1860         * sysdeps/alpha/tls.h: Likewise.
1861         * sysdeps/i386/tls.h: Likewise.
1862         * sysdeps/ia64/tls.h: Likewise.
1863         * sysdeps/powerpc/tls.h: Likewise.
1864         * sysdeps/s390/tls.h: Likewise.
1865         * sysdeps/sh/tls.h: Likewise.
1866         * sysdeps/sparc/tls.h: Likewise.
1867         * sysdeps/x86_64/tls.h: Likewise.
1868
1869 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1870
1871         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1872         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1873         failed.
1874
1875         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1876         Define to THREAD_SELF->header.multiple_threads.
1877         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1878         Likewise.
1879         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1880         Likewise.
1881         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1882         (SINGLE_THREAD_P): Likewise.
1883         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1884         (SINGLE_THREAD_P): Likewise.
1885         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1886         (SINGLE_THREAD_P): Likewise.
1887         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1888         (SINGLE_THREAD_P): Likewise.
1889         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
1890         Likewise.
1891         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1892         (SINGLE_THREAD_P): Likewise.
1893         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1894         (SINGLE_THREAD_P): Likewise.
1895         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
1896         Likewise.
1897
1898 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
1899
1900         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
1901         by default rather than 2_3_3.
1902
1903 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
1904
1905         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1906         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
1907         atomic_* instead of catomic_* macros.
1908
1909 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
1910
1911         [BZ #3285]
1912         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
1913         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1914         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1915         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1916         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1917         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
1918         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1919         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1920         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1921         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
1922         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1923         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1924         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1925
1926 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
1927
1928         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
1929         cancelable syscalls with six parameters.
1930
1931         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
1932         operations instead of atomic_*.
1933
1934 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
1935
1936         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
1937
1938 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
1939
1940         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
1941         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
1942         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
1943         New file.
1944         * pthread_attr_setstack.c: Allow overwriting the version number of the
1945         new symbol.
1946         * pthread_attr_setstacksize.c: Likewise.
1947         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
1948         it.
1949         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
1950         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
1951
1952 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
1953
1954         [BZ #3251]
1955         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
1956         Patch by Petr Baudis.
1957
1958 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
1959
1960         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
1961
1962         * tst-cancel2.c (tf): Loop as long as something was written.
1963
1964 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1965
1966         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
1967         mutexes wake all mutexes.
1968         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
1969         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1970         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1971
1972 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
1973
1974         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
1975         to guarantee the thread is always canceled.
1976
1977 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
1978
1979         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
1980         Include stdlib.h.
1981         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
1982         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
1983         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1984         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1985         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1986
1987 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
1988
1989         [BZ #3123]
1990         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
1991         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
1992         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1993         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1994         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1995         * Makefile (tests): Add tst-cond22.
1996         * tst-cond22.c: New file.
1997
1998 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
1999
2000         [BZ #3124]
2001         * descr.h (struct pthread): Add parent_cancelhandling.
2002         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2003         cancelhandling value to child.
2004         * pthread_create.c (start_thread): If parent thread was canceled
2005         reset the SIGCANCEL mask.
2006         * Makefile (tests): Add tst-cancel25.
2007         * tst-cancel25.c: New file.
2008
2009 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2010             Ulrich Drepper  <drepper@redhat.com>
2011
2012         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2013         counterp if it is already zero.
2014         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2015
2016 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2017             Roland McGrath  <roland@redhat.com>
2018
2019         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2020         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2021         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2022         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2023         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2024         lll_robust_mutex_timedlock, lll_mutex_unlock,
2025         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2026         Add _L_*_ symbols around the subsection.
2027         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2028         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2029
2030 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2031             Roland McGrath  <roland@redhat.com>
2032
2033         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2034         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2035         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2036         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2037         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2038         lll_robust_mutex_timedlock, lll_mutex_unlock,
2039         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2040         Add _L_*_ symbols around the subsection.
2041         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2042         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2043
2044 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2045
2046         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2047         change because it can disturb too much existing code.  If real hard
2048         reader preference is needed we'll introduce another type.
2049         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2050         (pthread_rwlock_timedwrlock): Likewise.
2051         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2052         Likewise.
2053
2054 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2055
2056         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2057         reader preference.
2058         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2059         (pthread_rwlock_timedwrlock): Likewise.
2060         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2061         Likewise.
2062
2063 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2064
2065         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2066         Only define ifdef SHARED.
2067
2068 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2069
2070         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2071         (free_stacks): ...here.
2072         (__free_stack_cache): New function.
2073         * pthreadP.h: Declare __free_stack_cache.
2074         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2075         ptr_freeres.
2076         * init.c (pthread_functions): Initialize ptr_freeres.
2077         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2078         New freeres function.
2079
2080 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2081
2082         [BZ #3018]
2083         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2084
2085 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2086
2087         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2088         _XOPEN_REALTIME_THREADS.
2089
2090 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2091
2092         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2093         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2094         HAVE_CLOCK_GETTIME_VSYSCALL.
2095         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2096
2097 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2098
2099         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2100         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2101         * descr.h (struct priority_protection_data): New type.
2102         (struct pthread): Add tpp field.
2103         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2104         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2105         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2106         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2107         TPP mutexes.
2108         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2109         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2110         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2111         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2112         * tpp.c: New file.
2113         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2114         boosted by TPP.
2115         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2116         * pthread_mutexattr_getprioceiling.c
2117         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2118         in the SCHED_FIFO priority range.
2119         * pthread_mutexattr_setprioceiling.c
2120         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2121         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2122         if mutex is not TPP.  Ceiling is now in __data.__lock.
2123         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2124         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2125         is now in __data.__lock.  Add locking.
2126         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2127         * Makefile (libpthread-routines): Add tpp.
2128         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2129         * tst-tpp.h: New file.
2130         * tst-mutexpp1.c: New file.
2131         * tst-mutexpp6.c: New file.
2132         * tst-mutexpp10.c: New file.
2133         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2134         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2135
2136 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2137
2138         [BZ #2843]
2139         * pthread_join.c (pthread_join): Account for self being canceled
2140         when checking for deadlocks.
2141         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2142         (tf1): Don't print anything after pthread_join returns, this would be
2143         another cancellation point.
2144         (tf2): Likewise.
2145         * tst-join6.c: New file.
2146         * Makefile (tests): Add tst-join6.
2147
2148 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2149
2150         [BZ #2892]
2151         * pthread_setspecific.c (__pthread_setspecific): Check
2152         out-of-range index before checking for unused key.
2153
2154         * sysdeps/pthread/gai_misc.h: New file.
2155
2156 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2157
2158         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2159         file.  Don't use sysctl.
2160         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2161         overwrite the file if this is likely not true.
2162
2163 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2164
2165         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2166         * Makefile (tests): Add tst-getpid3.
2167         * tst-getpid3.c: New file.
2168
2169 2006-07-30  Roland McGrath  <roland@redhat.com>
2170
2171         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2172
2173         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2174         (pause_not_cancel): New macro.
2175         (nanosleep_not_cancel): New macro.
2176         (sigsuspend_not_cancel): New macro.
2177         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2178         nanosleep_not_cancel macro from <not-cancel.h>.
2179         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2180         macro from <not-cancel.h>.
2181
2182 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2183             Jakub Jelinek  <jakub@redhat.com>
2184
2185         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2186         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2187         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2188         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2189         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2190         * pthread_mutex_lock.c: Likewise.
2191         * pthread_mutex_timedlock.c: Likewise.
2192         * pthread_mutex_trylock.c: Likewise.
2193         * pthread_mutex_unlock.c: Likewise.
2194         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2195         all mutexes.
2196         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2197         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2198         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2199         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2200         pthread-pi-defines.sym.
2201         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2202         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2203         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2204         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2205         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2206         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2207         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2208         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2209         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2210         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2211         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2212         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2213         * tst-mutex2.c: Likewise.
2214         * tst-mutex3.c: Likewise.
2215         * tst-mutex4.c: Likewise.
2216         * tst-mutex5.c: Likewise.
2217         * tst-mutex6.c: Likewise.
2218         * tst-mutex7.c: Likewise.
2219         * tst-mutex7a.c: Likewise.
2220         * tst-mutex8.c: Likewise.
2221         * tst-mutex9.c: Likewise.
2222         * tst-robust1.c: Likewise.
2223         * tst-robust7.c: Likewise.
2224         * tst-robust8.c: Likewise.
2225         * tst-mutexpi1.c: New file.
2226         * tst-mutexpi2.c: New file.
2227         * tst-mutexpi3.c: New file.
2228         * tst-mutexpi4.c: New file.
2229         * tst-mutexpi5.c: New file.
2230         * tst-mutexpi6.c: New file.
2231         * tst-mutexpi7.c: New file.
2232         * tst-mutexpi7a.c: New file.
2233         * tst-mutexpi8.c: New file.
2234         * tst-mutexpi9.c: New file.
2235         * tst-robust1.c: New file.
2236         * tst-robust2.c: New file.
2237         * tst-robust3.c: New file.
2238         * tst-robust4.c: New file.
2239         * tst-robust5.c: New file.
2240         * tst-robust6.c: New file.
2241         * tst-robust7.c: New file.
2242         * tst-robust8.c: New file.
2243         * Makefile (tests): Add the new tests.
2244
2245         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2246         * pthread_mutex_destroy.c: Remove unneeded label.
2247
2248 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2249
2250         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2251         computations to compile time.
2252
2253 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2254
2255         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2256
2257 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2258
2259         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2260
2261 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2262
2263         * pthread_key_create.c (__pthread_key_create): Do away with
2264         __pthread_keys_lock.
2265
2266         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2267         (__kernel_cpumask_size): Mark as hidden.
2268         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2269
2270         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2271         * semaphoreP.h (__sem_mappings_lock): Likewise.
2272
2273 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2274
2275         * pthread_atfork.c: Mark __dso_handle as hidden.
2276
2277 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2278
2279         [BZ #2644]
2280         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2281         the reload problem.  Change the one path in pthread_cancel_init
2282         which causes the problem.  Force gcc to reload.  Simplify callers.
2283         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2284         (_Unwind_GetBSP): Undo last patch.
2285
2286 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2287
2288         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2289         function pointer is reloaded after pthread_cancel_init calls.
2290
2291         [BZ #2644]
2292         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2293         pointers are reloaded after pthread_cancel_init calls.
2294
2295 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2296
2297         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2298         __always_inline.
2299
2300 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2301
2302         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2303         Allocate new object which is passed to timer_sigev_thread so that
2304         the timer can be deleted before the new thread is scheduled.
2305
2306 2006-04-26  Roland McGrath  <roland@redhat.com>
2307
2308         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2309
2310 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2311
2312         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2313         suffix for conditional jumps.
2314         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2315         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2316         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2317         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2318         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2319         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2320
2321         * init.c (sigcancel_handler): Compare with correct PID even if the
2322         thread is in the middle of a fork call.
2323         (sighandler_setxid): Likewise.
2324         Reported by Suzuki K P <suzuki@in.ibm.com> .
2325
2326 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2327
2328         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2329
2330 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2331
2332         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2333         fails [Coverity CID 105].
2334
2335 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2336
2337         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2338
2339 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2340
2341         [BZ #2505]
2342         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2343         Define __lll_rel_instr using lwsync.
2344
2345 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2346
2347         * allocatestack.c (allocate_stack): Always initialize robust_head.
2348         * descr.h: Define struct robust_list_head.
2349         (struct pthread): Use robust_list_head in robust mutex list definition.
2350         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2351         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2352         (__pthread_initialize_minimal_internal): Register robust_list with
2353         the kernel.
2354         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2355         Declare __set_robust_list_avail.
2356         * pthread_create.c (start_thread): Register robust_list of new thread.
2357         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2358         waiters.
2359         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2360         number of users, it's unreliable.
2361         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2362         set_robust_list syscall is available.
2363         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2364         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2365         Set robust_head.list_op_pending before trying to lock a robust mutex.
2366         * pthread_mutex_timedlock.c: Likewise.
2367         * pthread_mutex_trylock.c: Likewise.
2368         * pthread_mutex_unlock.c: Likewise for unlocking.
2369         * Makefile (tests): Add tst-robust8.
2370         * tst-robust8.c: New file.
2371
2372 2006-03-08  Andreas Schwab  <schwab@suse.de>
2373
2374         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2375         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2376
2377 2006-03-05  Roland McGrath  <roland@redhat.com>
2378
2379         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2380         and $config_os doesn't match *linux*.
2381
2382 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2383
2384         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2385         Use __syscall_error.
2386         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2387         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2388         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2389         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2390         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2391         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2392
2393 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2394
2395         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2396
2397 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2398
2399         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2400         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2401         mutex.
2402         (__lll_robust_timedlock_wait): Likewise.
2403         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2404         (__lll_robust_lock_wait): Likewise.
2405         (__lll_robust_timedlock_wait): Likewise.
2406         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2407         (__lll_robust_lock_wait): Likewise.
2408         (__lll_robust_timedlock_wait): Likewise.
2409
2410 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2411
2412         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2413         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2414         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2415         lll_robust_mutex_unlock): Define.
2416         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2417
2418 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2419
2420         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2421         instead of <clone.S>.
2422
2423 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2424
2425         * Makefile (libpthread-routines): Add
2426         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2427         and pthread_mutex_[sg]etprioceiling.
2428         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2429         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2430         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2431         pthread_mutex_setprioceiling.
2432         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2433         PTHREAD_PRIO_PROTECT): New enum values.
2434         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2435         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2436         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2437         prototypes.
2438         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2439         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2440         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2441         Define.
2442         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2443         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2444         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2445         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2446         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2447         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2448         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2449         protocol mutexes.
2450         * pthread_mutex_getprioceiling.c: New file.
2451         * pthread_mutex_setprioceiling.c: New file.
2452         * pthread_mutexattr_getprioceiling.c: New file.
2453         * pthread_mutexattr_setprioceiling.c: New file.
2454         * pthread_mutexattr_getprotocol.c: New file.
2455         * pthread_mutexattr_setprotocol.c: New file.
2456
2457 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2458
2459         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2460
2461 2006-02-27  Roland McGrath  <roland@redhat.com>
2462
2463         * sysdeps/pthread/Subdirs: List nptl here too.
2464         * configure (libc_add_on_canonical): New variable.
2465
2466         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2467
2468         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2469         self to get main source tree's file.
2470         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2471         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2472         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2473         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2474         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2475         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2476         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2477         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2478         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2479         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2480         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2481         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2482         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2483
2484         * Makefile: Use $(sysdirs) in vpath directive.
2485
2486         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2487         (CPPFLAGS-timer_routines.c): Likewise.
2488
2489         * Makeconfig (includes): Variable removed.
2490
2491 2006-02-26  Roland McGrath  <roland@redhat.com>
2492
2493         * sysdeps/generic/pt-raise.c: Moved to ...
2494         * pt-raise.c: ... here.
2495         * sysdeps/generic/lowlevellock.h: Moved to ...
2496         * lowlevellock.h: ... here.
2497
2498 2006-02-23  Roland McGrath  <roland@redhat.com>
2499
2500         * descr.h (struct pthread): Add final member `end_padding'.
2501         (PTHREAD_STRUCT_END_PADDING): Use it.
2502
2503 2006-02-20  Roland McGrath  <roland@redhat.com>
2504
2505         * sysdeps/mips: Directory removed, saved in ports repository.
2506         * sysdeps/unix/sysv/linux/mips: Likewise.
2507
2508 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2509
2510         * tst-robust1.c: Add second mutex to check that the mutex list is
2511         handled correctly.
2512
2513 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2514
2515         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2516         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2517         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2518         lll_robust_mutex_unlock): New macros.
2519         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2520         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2521         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2522         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2523         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2524
2525 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2526
2527         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2528         definitions.
2529         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2530
2531 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2532
2533         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2534         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2535         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2536         (lll_robust_mutex_unlock): Likewise.
2537
2538 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2539
2540         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2541         Set robust_list.__next rather than robust_list.
2542         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2543         (__pthread_list_t): New typedef.
2544         (pthread_mutex_t): Replace __next and __prev fields with __list.
2545         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2546         (__pthread_list_t): New typedef.
2547         (pthread_mutex_t): Replace __next and __prev fields with __list.
2548         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2549         (__pthread_list_t, __pthread_slist_t): New typedefs.
2550         (pthread_mutex_t): Replace __next and __prev fields with __list.
2551         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2552         (__pthread_list_t, __pthread_slist_t): New typedefs.
2553         (pthread_mutex_t): Replace __next and __prev fields with __list.
2554         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2555         (__pthread_list_t, __pthread_slist_t): New typedefs.
2556         (pthread_mutex_t): Replace __next and __prev fields with __list.
2557         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2558         (__pthread_slist_t): New typedef.
2559         (pthread_mutex_t): Replace __next field with __list.
2560
2561 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2562
2563         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2564         PTHREAD_MUTEX_OWNERDEAD.
2565         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2566         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2567         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2568         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2569         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2570         to PTHREAD_MUTEX_INCONSISTENT.
2571         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2572         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2573         * pthread_mutex_trylock.c: Likewise.
2574         * pthread_mutex_timedlock.c: Likewise.
2575         * pthread_mutex_unlock.c: Likewise.
2576         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2577         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2578         lowlevelrobustlock.sym.
2579         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2580         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2581         definitions.
2582         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2583         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2584         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2585         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2586         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2587
2588 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2589
2590         * allocatestack.c (allocate_stack): Initialize robust_list.
2591         * init.c (__pthread_initialize_minimal_internal): Likewise.
2592         * descr.h (struct xid_command): Pretty printing.
2593         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2594         robust_list.  Adjust macros.
2595         * pthread_create.c (start_thread): Adjust robust_list handling.
2596         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2597         but the owner for all robust mutex types.
2598         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2599         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2600         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2601         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2602
2603         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2604         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2605
2606 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2607
2608         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2609         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2610
2611 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2612
2613         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2614         Return status.
2615         (lll_futex_timed_wait): Define.
2616
2617 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2618
2619         * tst-cancel4.c: Test ppoll.
2620
2621 2006-01-18  Andreas Jaeger  <aj@suse.de>
2622
2623         [BZ #2167]
2624         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2625         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2626         by Jim Gifford <patches@jg555.com>.
2627
2628 2006-01-13  Richard Henderson  <rth@redhat.com>
2629
2630         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2631
2632 2006-01-10  Roland McGrath  <roland@redhat.com>
2633
2634         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2635         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2636         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2637         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2638         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2639         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2640         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2641         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2642         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2643         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2644
2645 2006-01-09  Roland McGrath  <roland@redhat.com>
2646
2647         * tst-initializers1-c89.c: New file.
2648         * tst-initializers1-c99.c: New file.
2649         * tst-initializers1-gnu89.c: New file.
2650         * tst-initializers1-gnu99.c: New file.
2651         * Makefile (tests): Add them.
2652         (CFLAGS-tst-initializers1-c89.c): New variable.
2653         (CFLAGS-tst-initializers1-c99.c): New variable.
2654         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2655         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2656
2657         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2658         Use __extension__ on anonymous union definition.
2659         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2660         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2661         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2662         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2663         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2664
2665 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2666
2667         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2668         Don't give the union a name because it changes the mangled name.
2669         Instead name the struct for __data.
2670         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2671         Likewise.
2672         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2673         Likewise.
2674
2675 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2676
2677         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2678         stack bias to mc_ftp field.
2679
2680 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2681
2682         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2683         being too clever and reloading the futex value where it shouldn't.
2684
2685 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2686
2687         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2688         correct type.
2689
2690 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2691
2692         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2693         Add cfi directives.
2694
2695 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2696
2697         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2698         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2699         rename in tcbhead_t.
2700
2701         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2702         Don't give the union a name because it changes the mangled name.
2703         Instead name the struct for __data.
2704         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2705         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2706         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2707         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2708         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2709         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2710
2711 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2712
2713         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2714         Return status.
2715         (lll_futex_timed_wait): Define.
2716         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2717         * sysdeps/pthread/aio_misc.h: New file.
2718
2719 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2720
2721         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2722
2723 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2724
2725         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2726         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2727         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2728
2729 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2730
2731         * tst-cancel24.cc: Use C headers instead of C++ headers.
2732
2733 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2734
2735         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2736         sparc-linux configured glibc.
2737         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2738         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2739         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2740         atomic_compare_and_exchange_val_24_acq instead of
2741         atomic_compare_and_exchange_val_acq.
2742         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2743         instead of atomic_exchange_rel.
2744         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2745         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2746         file.
2747         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2748         file.
2749         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2750         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2751         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2752         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2753         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2754         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2755         New file.
2756         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2757         New file.
2758         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2759         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2760         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2761         file.
2762         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2763         file.
2764         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2765
2766 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2767
2768         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2769         mutex initializers.
2770
2771 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2772
2773         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2774         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2775         THREAD_COPY_POINTER_GUARD): Define.
2776         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2777         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2778
2779 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2780
2781         * version.c: Update copyright year.
2782
2783 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2784
2785         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2786         .eh_frame section, use cfi_* directives.
2787         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2788
2789 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2790
2791         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2792         now.
2793
2794 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2795
2796         * sysdeps/pthread/sigaction.c: Removed.
2797         * sigaction.c: New file.
2798         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2799
2800 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2801
2802         * Makefile (tests): Add tst-signal7.
2803         * tst-signal7.c: New file.
2804
2805 2005-12-27  Roland McGrath  <roland@redhat.com>
2806
2807         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2808         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2809         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2810         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2811         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2812         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2813         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2814         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2815         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2816         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2817         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2818
2819 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2820
2821         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2822         and __prev field to pthread_mutex_t.
2823         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2824         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2825         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2826         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2827         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2828         to pthread_mutex_t.
2829
2830 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2831
2832         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2833         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2834         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2835         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2836         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2837         and PTHREAD_MUTEXATTR_FLAG_BITS.
2838         * descr.h (struct pthread): Add robust_list field and define
2839         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2840         * pthread_mutexattr_getrobust.c: New file.
2841         * pthread_mutexattr_setrobust.c: New file.
2842         * pthread_mutex_consistent.c: New file.
2843         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2844         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2845         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2846         Adjust pthread_mutex_t initializers.
2847         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2848         field to pthread_mutex_t.
2849         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2850         and __prev field to pthread_mutex_t.
2851         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2852         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2853         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2854         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2855         * pthread_mutexattr_gettype.c: Likewise.
2856         * pthread_mutexattr_setpshared.c: Likewise.
2857         * pthread_mutexattr_settype.c: Likewise.
2858         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2859         Initialize mutex kind according to robust flag.
2860         * pthread_mutex_lock.c: Implement local robust mutex.
2861         * pthread_mutex_timedlock.c: Likewise.
2862         * pthread_mutex_trylock.c: Likewise.
2863         * pthread_mutex_unlock.c: Likewise.
2864         * pthread_create.c (start_thread): Mark robust mutexes which remained
2865         locked as dead.
2866         * tst-robust1.c: New file.
2867         * tst-robust2.c: New file.
2868         * tst-robust3.c: New file.
2869         * tst-robust4.c: New file.
2870         * tst-robust5.c: New file.
2871         * tst-robust6.c: New file.
2872         * tst-robust7.c: New file.
2873         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
2874         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2875         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
2876         tst-robust5, tst-robust6, and tst-robust7.
2877
2878         * tst-typesizes.c: New file.
2879         * Makefile (tests): Add tst-typesizes.
2880
2881         * tst-once3.c: More debug output.
2882
2883 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
2884
2885         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
2886         missing after last change.
2887
2888         * version.c: Update copyright year.
2889
2890 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
2891
2892         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
2893         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
2894         * pthread_mutex_trylock.c: Likewise.
2895         * pthread_mutex_timedlock.c: Likewise.
2896         * pthread_mutex_unlock.c: Likewise.
2897
2898 2005-12-22  Roland McGrath  <roland@redhat.com>
2899
2900         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
2901         so that #include_next's search location is not reset to the -I..
2902         directory where <nptl/...> can be found.
2903
2904 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
2905
2906         [BZ #1913]
2907         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2908         Fix unwind info.  Remove useless branch prediction prefix.
2909         * tst-cancel24.cc: New file.
2910         * Makefile: Add rules to build and run tst-cancel24.
2911
2912 2005-12-21  Roland McGrath  <roland@redhat.com>
2913
2914         * libc-cancellation.c: Use <> rather than "" #includes.
2915         * pt-cleanup.c: Likewise.
2916         * pthread_create.c: Likewise.
2917         * pthread_join.c: Likewise.
2918         * pthread_timedjoin.c: Likewise.
2919         * pthread_tryjoin.c: Likewise.
2920         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
2921         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2922         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2923         * unwind.c: Likewise.
2924
2925 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2926
2927         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
2928         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
2929         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2930         THREAD_COPY_POINTER_GUARD): Define.
2931
2932 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
2933
2934         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
2935         rather than one.
2936         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2937         THREAD_COPY_POINTER_GUARD): Define.
2938         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
2939         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
2940         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2941         THREAD_COPY_POINTER_GUARD): Define.
2942         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
2943         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
2944         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
2945         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
2946         Use PTR_DEMANGLE for B0 if defined.
2947
2948 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
2949
2950         * pthread_create.c (__pthread_create_2_1): Use
2951         THREAD_COPY_POINTER_GUARD if available.
2952         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
2953         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2954         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
2955         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
2956         * sysdeps/x86_64/tls.h: Likewise.
2957
2958 2005-12-15  Roland McGrath  <roland@redhat.com>
2959
2960         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
2961
2962 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
2963
2964         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
2965         sysdeps/generic.
2966         * errno-loc.c: New file.
2967
2968 2005-12-12  Roland McGrath  <roland@redhat.com>
2969
2970         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
2971         adjustments before choosing stack size.  Update minimum stack size
2972         calculation to match allocate_stack change.
2973
2974 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
2975
2976         * allocatestack.c (allocate_stack): Don't demand that there is an
2977         additional full page available on the stack beside guard, TLS, the
2978         minimum stack.
2979
2980 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
2981
2982         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2983         (__cleanup_fct_attribute): Use __regparm__ not regparm.
2984
2985         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
2986         compiling 32-bit code we must define __cleanup_fct_attribute.
2987
2988 005-11-24  Jakub Jelinek  <jakub@redhat.com>
2989
2990         [BZ #1920]
2991         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
2992         __attribute__ instead of __attribute.
2993         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
2994         (__cleanup_fct_attribute): Likewise.
2995
2996 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
2997
2998         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
2999         a write barrier before writing libgcc_s_getcfa.
3000
3001 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3002
3003         * sysdeps/unix/sysv/linux/configure: Removed.
3004
3005 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3006
3007         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3008         optional init_array/fini_array support.
3009
3010 2005-10-24  Roland McGrath  <roland@redhat.com>
3011
3012         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3013         versioned_symbol use.
3014
3015 2005-10-16  Roland McGrath  <roland@redhat.com>
3016
3017         * init.c (__pthread_initialize_minimal_internal): Even when using a
3018         compile-time default stack size, apply the minimum that allocate_stack
3019         will require, and round up to page size.
3020
3021 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3022
3023         * Makefile ($(test-modules)): Remove static pattern rule.
3024
3025 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3026             Ulrich Drepper  <drepper@redhat.com>
3027
3028         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3029         alignment in callback function.
3030         * Makefile: Add rules to build and run tst-align3.
3031         * tst-align3.c: New file.
3032
3033 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3034
3035         * allocatestack.c (setxid_signal_thread): Add
3036         INTERNAL_SYSCALL_DECL (err).
3037
3038 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3039
3040         * allocatestack.c (setxid_signal_thread): Need to use
3041         atomic_compare_and_exchange_bool_acq.
3042
3043 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3044             Jakub Jelinek  <jakub@redhat.com>
3045
3046         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3047         CANCEL_RESTMASK.
3048         (struct pthread): Move specific_used field to avoid padding.
3049         Add setxid_futex field.
3050         * init.c (sighandler_setxid): Reset setxid flag and release the
3051         setxid futex.
3052         * allocatestack.c (setxid_signal_thread): New function.  Broken
3053         out of the bodies of the two loops in __nptl_setxid.  For undetached
3054         threads check whether they are exiting and if yes, don't send a signal.
3055         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3056         * pthread_create.c (start_thread): For undetached threads, check
3057         whether setxid bit is set.  If yes, wait until signal has been
3058         processed.
3059
3060         * allocatestack.c (STACK_VARIABLES): Initialize them.
3061         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3062
3063 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3064
3065         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3066         waiters, awake all waiters on the associated mutex.
3067
3068 2005-09-22  Roland McGrath  <roland@redhat.com>
3069
3070         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3071         ../sysdeps/x86_64/hp-timing.h).
3072
3073 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3074
3075         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3076         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3077         (lll_futex_wake_unlock): Define.
3078         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3079         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3080         (lll_futex_wake_unlock): Define.
3081         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3082         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3083         (lll_futex_wake_unlock): Define.
3084         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3085         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3086         (lll_futex_wake_unlock): Define.
3087         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3088         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3089         (lll_futex_wake_unlock): Define.
3090         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3091         lll_futex_wake_unlock.
3092         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3093         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3094         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3095         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3096         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3097         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3098
3099 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3100
3101         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3102         Fix typo in register name.
3103
3104 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3105
3106         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3107         Use __sigfillset.  Document that sigfillset does the right thing wrt
3108         to SIGSETXID.
3109
3110 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3111
3112         [BZ #1102]
3113         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3114         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3115         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3116         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3117         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3118         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3119         in the structure.
3120         * Makefile (tests): Add tst-initializers1.
3121         (CFLAGS-tst-initializers1.c): Set.
3122         * tst-initializers1.c: New test.
3123
3124 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3125
3126         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3127         Make sure __flags are located at offset 48 from the start of the
3128         structure.
3129
3130 2005-07-02  Roland McGrath  <roland@redhat.com>
3131
3132         * Makeconfig: Comment fix.
3133
3134 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3135
3136         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3137         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3138         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3139         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3140         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3141         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3142         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3143         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3144         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3145         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3146
3147 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3148
3149         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3150         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3151         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3152         fields.
3153         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3154         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3155         field.  Put in sysinfo field unconditionally.
3156         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3157         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3158         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3159         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3160         fields.
3161         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3162         * pthread_create.c (__pthread_create_2_1): Use
3163         THREAD_COPY_STACK_GUARD macro.
3164         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3165         tests.
3166         * tst-stackguard1.c: New file.
3167         * tst-stackguard1-static.c: New file.
3168
3169 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3170
3171         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3172         Invoke CGOTSETUP and CGOTRESTORE.
3173         (CGOTSETUP, CGOTRESTORE): Define.
3174
3175 2005-05-29  Richard Henderson  <rth@redhat.com>
3176
3177         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3178         (tf_write, tf_writev): Use it.
3179         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3180         the system minimum.
3181
3182 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3183
3184         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3185         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3186         __librt_*_asynccancel@local.
3187
3188 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3189
3190         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3191         all occurrences of JUMPTARGET.  Instead append @local to labels.
3192
3193 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3194
3195         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3196         size/alignment of struct pthread rather than tcbhead_t.
3197         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3198         Likewise.
3199         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3200         Likewise.
3201         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3202         Likewise.
3203
3204 2005-05-19  Richard Henderson  <rth@redhat.com>
3205
3206         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3207         __sync_val_compare_and_swap, not explicit _si variant.
3208         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3209
3210 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3211
3212         [BZ #915]
3213         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3214
3215 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3216
3217         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3218         .eh_frame section, use cfi_* directives.
3219
3220 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3221
3222         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3223         of "" includes.
3224
3225 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3226
3227         [BZ #1075]
3228         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3229         aio_write blocks.
3230
3231 2005-04-27  Roland McGrath  <roland@redhat.com>
3232
3233         * Makefile (tests): Remove tst-clock2.
3234
3235         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3236         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3237         translating to the kernel clockid_t for our own process/thread clock.
3238
3239         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3240
3241 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3242
3243         * old_pthread_cond_init.c: Include <errno.h>.
3244         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3245         process shared or uses clock other than CLOCK_REALTIME.
3246         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3247
3248 2005-04-13  David S. Miller  <davem@davemloft.net>
3249
3250         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3251         * sysdeps/sparc/sparc64/clone.S: New file.
3252
3253 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3254
3255         [BZ #1102]
3256         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3257         __inline instead of inline.
3258         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3259
3260 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3261
3262         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3263         functionally equivalent, but shorter instructions.
3264         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3265         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3266         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3267         Likewise.
3268         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3269         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3270         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3271         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3272         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3273         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3274         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3275         Likewise.
3276         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3277         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3278         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3279         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3280         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3281
3282 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3283
3284         * sysdeps/mips/Makefile: New file.
3285         * sysdeps/mips/nptl-sysdep.S: New file.
3286         * sysdeps/mips/tcb-offsets.sym: New file.
3287         * sysdeps/mips/pthread_spin_lock.S: New file.
3288         * sysdeps/mips/pthread_spin_trylock.S: New file.
3289         * sysdeps/mips/pthreaddef.h: New file.
3290         * sysdeps/mips/tls.h: New file.
3291         * sysdeps/mips/jmpbuf-unwind.h: New file.
3292         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3293         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3294         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3295         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3296         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3297         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3298         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3299         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3300         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3301         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3302
3303 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3304
3305         [BZ #1112]
3306         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3307         variable to scerr.
3308
3309 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3310
3311         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3312
3313 2005-02-25  Roland McGrath  <roland@redhat.com>
3314
3315         * alloca_cutoff.c: Correct license text.
3316         * tst-unload.c: Likewise.
3317         * sysdeps/pthread/allocalim.h: Likewise.
3318         * sysdeps/pthread/pt-initfini.c: Likewise.
3319         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3320         * sysdeps/pthread/bits/sigthread.h: Likewise.
3321         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3322         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3323
3324 2005-02-16  Roland McGrath  <roland@redhat.com>
3325
3326         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3327         Use unsigned int * for ptr_nthreads.
3328
3329 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3330
3331         [BZ #721]
3332         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3333         gcc4.
3334
3335 2005-02-07  Richard Henderson  <rth@redhat.com>
3336
3337         [BZ #787]
3338         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3339         argument.
3340
3341 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3342
3343         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3344         order of arguments in invocation of atomic_add_zero.
3345
3346 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3347
3348         [BZ #737]
3349         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3350         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3351         at least gotntpoff relocation and addition.
3352         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3353         Likewise.
3354         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3355         Likewise.
3356         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3357         Likewise.
3358
3359 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3360
3361         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3362         entry for static tls deallocation fix.
3363         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3364         also contains information whether the memory pointed to is static
3365         TLS or not.
3366         * sysdeps/i386/tls.h: Likewise.
3367         * sysdeps/ia64/tls.h: Likewise.
3368         * sysdeps/powerpc/tls.h: Likewise.
3369         * sysdeps/s390/tls.h: Likewise.
3370         * sysdeps/sh/tls.h: Likewise.
3371         * sysdeps/sparc/tls.h: Likewise.
3372         * sysdeps/x86_64/tls.h: Likewise.
3373
3374 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3375
3376         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3377
3378 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3379
3380         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3381         %esp.
3382         * Makefile (tests): Add tst-align2.
3383         * tst-align2.c: New test.
3384         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3385         -mpreferred-stack-boundary=4.
3386
3387 2004-12-18  Roland McGrath  <roland@redhat.com>
3388
3389         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3390         New file removed withdrawn for the moment.
3391
3392 2004-12-17  Richard Henderson  <rth@redhat.com>
3393
3394         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3395         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3396
3397 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3398
3399         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3400         Increased PTHREAD_STACK_MIN.
3401
3402         * tst-context1.c (stacks): Use bigger stack size.
3403
3404 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3405
3406         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3407         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3408
3409 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3410
3411         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3412         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3413         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3414
3415 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3416
3417         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3418
3419 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3420
3421         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3422         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3423
3424         * tst-getpid1.c: If child crashes, report this first.  Print which
3425         signal.
3426
3427 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3428
3429         * init.c (__pthread_initialize_minimal_internal): Also unblock
3430         SIGSETXID.
3431
3432 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3433
3434         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3435         _POSIX_THREAD_CPUTIME): Define to 0.
3436         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3437         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3438         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3439         __timer_signal_thread_tclk): Remove.
3440         (init_module): Remove their initialization.
3441         (thread_cleanup): Remove their cleanup assertions.
3442         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3443         __timer_signal_thread_tclk): Remove.
3444         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3445         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3446         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3447
3448 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3449
3450         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3451         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3452
3453         * Makefile (tests): Add tst-getpid2.
3454         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3455         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3456         * tst-getpid2.c: New test.
3457
3458 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3459
3460         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3461
3462 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3463
3464         * Makefile (tests): Add tst-getpid1.
3465         * tst-getpid1.c: New file.
3466         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3467         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3468
3469 2004-12-02  Roland McGrath  <roland@redhat.com>
3470
3471         * Makefile (libpthread-nonshared): Variable removed.
3472         ($(objpfx)libpthread_nonshared.a): Target removed.
3473         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3474         These are now handled by generic magic from
3475         libpthread-static-only-routines being set.
3476
3477 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3478
3479         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3480         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3481         _POSIX_THREAD_PRIO_PROTECT): Define.
3482         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3483         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3484         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3485
3486 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3487
3488         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3489         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3490         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3491         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3492         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3493         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3494         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3495
3496 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3497
3498         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3499
3500         * Makefile (libpthread-routines): Add pthread_setschedprio.
3501         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3502         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3503         * pthread_setschedprio.c: New file.
3504
3505 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3506
3507         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3508         * pthread_cancel.c (pthread_create): Likewise.
3509
3510         * Makefile (libpthread-routines): Add vars.
3511         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3512         * init.c (__default_stacksize, __is_smp): Remove.
3513         * vars.c: New file.
3514         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3515         and define a wrapper macro.
3516         (PTHREAD_STATIC_FN_REQUIRE): Define.
3517         * allocatestack.c (__find_thread_by_id): Undefine.
3518         * pthread_create (__pthread_keys): Remove.
3519         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3520         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3521         PTHREAD_STATIC_FN_REQUIRE.
3522
3523 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3524
3525         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3526         parameter to REGISTER macro.
3527
3528 2004-11-17  Roland McGrath  <roland@redhat.com>
3529
3530         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3531         Make sure SIGCANCEL is blocked as well.
3532
3533 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3534
3535         * sysdeps/pthread/setxid.h: New file.
3536         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3537         (struct xid_command): Add forward decl.
3538         (struct pthread_functions): Change return type of __nptl_setxid hook
3539         to int.
3540         * pthreadP.h (__nptl_setxid): Change return type to int.
3541         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3542         calling thread, return its return value and set errno on failure.
3543         * descr.h (struct xid_command): Change id type to long array.
3544
3545         * Makefile: Add rules to build and test tst-setuid1 and
3546         tst-setuid1-static.
3547         * tst-setuid1.c: New test.
3548         * tst-setuid1-static.c: New test.
3549
3550 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3551
3552         * Makefile (tests): Add tst-exit3.
3553         * tst-exit3.c: New test.
3554
3555 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3556
3557         * Makefile (tests): Add tst-exit2.
3558         * tst-exit2.c: New file.
3559
3560 2004-11-09  Roland McGrath  <roland@redhat.com>
3561
3562         [BZ #530]
3563         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3564         here, before calling clone.
3565         * pthread_create.c (start_thread): Don't do it here.
3566
3567 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3568
3569         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3570
3571 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3572
3573         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3574         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3575         assembler warning.
3576
3577 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3578
3579         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3580         if sched_priority is not between minprio and maxprio.
3581
3582 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3583
3584         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3585         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3586
3587         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3588         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3589
3590 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3591
3592         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3593         not-cancelable I/O functions.
3594
3595 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3596
3597         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3598         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3599         make sure 2 is stored in the futex and we looked at the old value.
3600         Fix a few other problems to return the correct value.
3601
3602 2004-10-14  Richard Henderson  <rth@redhat.com>
3603
3604         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3605         make gcc4 happy.
3606
3607 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3608
3609         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3610         of pthread-functions.h and pthreaddef.h.
3611         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3612
3613         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3614         Change __data.__nwaiters from int to unsigned int.
3615
3616         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3617         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3618
3619         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3620         before return type.
3621
3622         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3623         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3624
3625 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3626
3627         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3628         test fails, remove message queue.
3629         (tf_msgsnd): Likewise.
3630
3631 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3632
3633         * tst-clock1.c: Change #ifdef to #if defined.
3634         * tst-clock2.c: Likewise.
3635         * tst-cond11.c: Likewise.
3636
3637         * sysdeps/pthread/timer_create.c (timer_create): Use
3638         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3639         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3640         THREAD_CPUTIME.
3641
3642 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3643
3644         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3645         _POSIX_THREAD_CPUTIME): Define to 0.
3646
3647 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3648
3649         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3650         and _POSIX_THREAD_CPUTIME to zero.
3651         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3652         * tst-barrier2.c: Fix testing for POSIX feature.
3653         * tst-clock1.c: Likewise.
3654         * tst-clock2.c: Likewise.
3655         * tst-cond11.c: Likewise.
3656         * tst-cond4.c: Likewise.
3657         * tst-cond6.c: Likewise.
3658         * tst-flock2.c: Likewise.
3659         * tst-mutex4.c: Likewise.
3660         * tst-mutex9.c: Likewise.
3661         * tst-rwlock12.c: Likewise.
3662         * tst-rwlock4.c: Likewise.
3663         * tst-signal1.c: Likewise.
3664         * tst-spin2.c: Likewise.
3665         * sysdeps/pthread/posix-timer.h: Likewise.
3666         * sysdeps/pthread/timer_create.c: Likewise.
3667         * sysdeps/pthread/timer_routines.c: Likewise.
3668
3669 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3670
3671         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3672         (__lll_mutex_timedlock_wait): Address futex correctly.
3673
3674         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3675         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3676         make sure 2 is stored in the futex and we looked at the old value.
3677         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3678         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3679         which might very well made the code not working at all before.
3680         [BZ #417]
3681
3682 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3683
3684         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3685         allow SIGSETXID to be sent.
3686         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3687         for SIGSETXID to be defined.
3688         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3689         SIGSETXID cannot be blocked.
3690
3691         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3692         Add __extension__ to long long types.
3693         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3694         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3695         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3696         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3697         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3698         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3699         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3700
3701 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3702
3703         * descr.h (struct pthread): Add stopped_start field.
3704         * sysdeps/pthread/createthread.c (create_thread): Set
3705         start_stopped flag in descriptor for new thread appropriately.
3706         * pthread_create.c (start_thread): Only take lock to be stopped on
3707         startup if stopped_start flag says so.
3708
3709 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3710
3711         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3712         is created detached and if yes, do not try to free the stack in case
3713         the thread creation failed.
3714         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3715         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3716         case there has been no error.  [BZ #405]
3717
3718         * pthread_create.c (start_thread): Don't wait for scheduler data
3719         etc to be set at the beginning of the function.  The cancellation
3720         infrastructure must have been set up.  And enable async
3721         cancellation before potentially going to sleep.  [BZ #401]
3722
3723 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3724
3725         * Versions: Remove exports for pthread_set*id_np functions.
3726         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3727         for now.
3728         * Makefile: Don't build pthread_set*id code for now.
3729
3730 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3731
3732         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3733         internal use.
3734         * allocatestack.c (__nptl_setxid): New function.
3735         * descr.h (struct xid_command): Define type.
3736         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3737         (sighandler_setxid): New function.
3738         (__pthread_initialize_minimal): Register sighandler_setxid for
3739         SIGCANCEL.
3740         * pt-allocrtsig.c: Update comment.
3741         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3742         Declare __nptl_setxid.
3743         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3744         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3745         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3746         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3747         and pthread_setresuid_np.
3748         * pthread_setgid_np.c: New file.
3749         * pthread_setuid_np.c: New file.
3750         * pthread_setegid_np.c: New file.
3751         * pthread_seteuid_np.c: New file.
3752         * pthread_setregid_np.c: New file.
3753         * pthread_setreuid_np.c: New file.
3754         * pthread_setresgid_np.c: New file.
3755         * pthread_setresuid_np.c: New file.
3756         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3757         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3758         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3759         and pthread_setresuid_np.
3760         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3761         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3762         pthread_setregid, and pthread_setresgid.
3763
3764 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3765
3766         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3767         ENOMEM when out of memory.
3768
3769 2004-09-10  Roland McGrath  <roland@redhat.com>
3770
3771         [BZ #379]
3772         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3773         code, since we don't try to use the broken CLONE_STOPPED any more.
3774         * pthread_create.c (start_thread): Likewise.
3775
3776 2004-09-15  Richard Henderson  <rth@redhat.com>
3777
3778         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3779
3780 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3781
3782         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3783         (__libc_unwind_longjmp): Delete macro and declare as function.
3784         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3785         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3786         nptl directory.
3787         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3788         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3789         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3790
3791 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3792
3793         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3794         for __USE_XOPEN2K.
3795         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3796         types also for __USE_XOPEN2K.
3797         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3798         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3799         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3800         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3801         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3802         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3803         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3804         [BZ #320]
3805
3806 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3807
3808         * sysdeps/pthread/pthread.h
3809         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3810         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3811         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3812         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3813         [BZ #375]
3814
3815 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3816
3817         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3818         PSEUDO to be used with . prefix.
3819
3820         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3821         Use atomic_increment instead of atomic_exchange_and_add.
3822         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3823         Likewise.
3824         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3825         Likewise.
3826         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3827         Likewise.
3828
3829         * allocatestack.c (allocate_stack): Use atomic_increment_val
3830         instead of atomic_exchange_and_add.
3831         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3832         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3833         Likewise.
3834         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3835         Likewise.
3836
3837         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3838         the initialization function might throw.
3839
3840 2005-09-05  Richard Henderson  <rth@redhat.com>
3841
3842         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3843         Move definition inside libpthread, libc, librt check.  Provide
3844         definition for rtld.
3845
3846 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3847
3848         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3849         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3850         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3851         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3852         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3853         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3854         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3855         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3856         * unwind.c: Use it.
3857
3858         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3859         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3860         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3861         Likewise.
3862         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3863         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3864         this is the last waiter, signal pthread_cond_destroy caller and
3865         avoid using the pthread_cond_t structure after unlock.
3866         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3867         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3868         Read clock type from the least significant bits of __nwaiters instead
3869         of __clock.
3870         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3871         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
3872
3873 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
3874
3875         [BZ #342]
3876         * Makefile (tests): Add tst-cond20 and tst-cond21.
3877         * tst-cond20.c: New test.
3878         * tst-cond21.c: New test.
3879         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3880         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
3881         it unsigned int.
3882         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3883         Likewise.
3884         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3885         (pthread_cond_t): Likewise.
3886         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3887         Likewise.
3888         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3889         Likewise.
3890         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3891         Likewise.
3892         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
3893         (cond_nwaiters): New.
3894         (clock_bits): New.
3895         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
3896         if there are waiters not signalled yet.
3897         Wait until all already signalled waiters wake up.
3898         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
3899         __nwaiters.  If pthread_cond_destroy has been called and this is the
3900         last waiter, signal pthread_cond_destroy caller and avoid using
3901         the pthread_cond_t structure after unlock.
3902         (__pthread_cond_wait): Increment __nwaiters in the beginning,
3903         decrement it when leaving.  If pthread_cond_destroy has been called
3904         and this is the last waiter, signal pthread_cond_destroy caller.
3905         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3906         Likewise.  Read clock type from the least significant bits of
3907         __nwaiters instead of __clock.
3908         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
3909         whether clock ID can be encoded in COND_CLOCK_BITS bits.
3910         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
3911         clock type just from the last COND_CLOCK_BITS bits of value.
3912         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
3913         instead of __clock, just from second bit of condattr's value.
3914
3915 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
3916
3917         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
3918         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
3919         != 64.
3920         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3921
3922 2004-08-15  Roland McGrath  <roland@frob.com>
3923
3924         * pthread_atfork.c: Update copyright terms including special exception
3925         for these trivial files, which are statically linked into executables
3926         that use dynamic linking for the significant library code.
3927
3928 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3929
3930         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
3931         pthread_rwlock_rdlock.
3932         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
3933         Decrease __nr_readers_queued after reacquiring lock.
3934         * sysdeps/pthread/pthread_rwlock_timedrdlock
3935         (pthread_rwlock_timedrdlock): Likewise.
3936         Reported by Bob Cook <bobcook47@hotmail.com>.
3937
3938 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
3939
3940         * tst-rwlock14.c (tf): Read main thread handle from *ARG
3941         before pthread_barrier_wait.
3942
3943 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
3944
3945         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3946         Remove unnecessary exception handling data.
3947
3948 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
3949
3950         [BZ #284]
3951         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
3952         instead of clockid_t.
3953
3954 2004-07-21  Roland McGrath  <roland@redhat.com>
3955
3956         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
3957
3958 2004-07-19  Roland McGrath  <roland@redhat.com>
3959
3960         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
3961
3962 2004-07-02  Roland McGrath  <roland@redhat.com>
3963
3964         * configure: Don't exit.
3965
3966 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3967
3968         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3969         (__pthread_cond_timedwait): Check for invalid nanosecond in
3970         timeout value.
3971
3972 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
3973
3974         * Makefile: Add rules to build and run tst-fini1.
3975         * tst-fini1.c: New file.
3976         * tst-fini1mod.c: New file.
3977
3978 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
3979
3980         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
3981         if no cancellation support is needed.
3982         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3983         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3984         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3985         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3986         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3987         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3988         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3989         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3990         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3991
3992         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
3993         only if not already defined.
3994
3995 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
3996
3997         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
3998         constraint "m" instead of "0" for futex.
3999
4000         * shlib-versions: Add powerpc64-.*-linux.*.
4001
4002 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4003
4004         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4005         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4006         for valid tv_nsec.
4007         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4008         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4009         bits.
4010
4011 2004-06-29  Roland McGrath  <roland@redhat.com>
4012
4013         * Banner: NPTL no longer has its own version number.
4014         * Makefile (nptl-version): Variable removed.
4015         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4016         using $(version), the glibc version number.
4017
4018 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4019
4020         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4021         Fix branch offset for a PLT entry.
4022         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4023         Likewise.
4024         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4025         Likewise.
4026         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4027         Likewise.
4028         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4029         Likewise.
4030
4031 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4032
4033         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4034         unconditionally.
4035
4036 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4037
4038         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4039         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4040         instead of tv_sec.
4041         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4042         (pthread_rwlock_timedrdlock): Likewise.
4043
4044 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4045
4046         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4047         Set __r7 to val, not mutex.
4048
4049 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4050
4051         * Makefile: Add rules to build tst-rwlock14.
4052         * tst-rwlock14.c: New file.
4053
4054 2004-06-24  Boris Hu  <boris.hu@intel.com>
4055
4056         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4057         check.
4058         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4059
4060 2004-06-19  Andreas Jaeger  <aj@suse.de>
4061
4062         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4063         assembler in last patch.
4064
4065 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4066
4067         * sysdeps/pthread/pthread_cond_timedwait.c
4068         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4069         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4070         (__pthread_cond_timedwait): Check for invalid nanosecond in
4071         timeout value.
4072         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4073         * tst-cond19.c: New file.
4074         * Makefile: Add rules to build and run tst-cond19.
4075
4076 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4077
4078         * tst-context1.c (GUARD_PATTERN): Defined.
4079         (tst_context_t): Define struct containing ucontext_t & guard words.
4080         (ctx): Declare as an array of tst_context_t.
4081         (fct): Verify uc_link & guard words are still valid.
4082         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4083
4084 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4085
4086         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4087         Add __data.__futex field, reshuffle __data.__clock.
4088         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4089         (__pthread_cond_signal): Increment __futex at the same time as
4090         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4091         address of low 32-bits of __wakeup_seq to futex syscall.
4092         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4093         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4094         releasing internal lock to FUTEX_WAIT.
4095         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4096         (__pthread_cond_timedwait): Likewise.
4097         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4098         (FUTEX_CMP_REQUEUE): Define.
4099         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4100         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4101         Pass __futex value from before the unlock and __futex address instead
4102         of address of low 32-bits of __wakeup_seq to futex syscall.
4103         Fallback to FUTEX_WAKE all on any errors.
4104
4105 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4106
4107         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4108         comment typo.
4109         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4110         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4111         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4112         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4113         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4114
4115 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4116
4117         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4118         Add memory clobber to inline assembly.
4119         (__lll_mutex_trylock): Likewise.
4120         (__lll_mutex_cond_trylock): Likewise.
4121
4122 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4123
4124         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4125         Pass val argument as 6th system call argument in %r7.
4126
4127 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4128
4129         * Makefile (tests): Add tst-cond16.
4130         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4131         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4132         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4133         Add __data.__futex field, reshuffle __data.__clock.
4134         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4135         (__pthread_cond_signal): Increment __futex at the same time as
4136         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4137         address of low 32-bits of __wakeup_seq to futex syscall.
4138         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4139         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4140         releasing internal lock to FUTEX_WAIT.
4141         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4142         (__pthread_cond_timedwait): Likewise.
4143         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4144         (FUTEX_CMP_REQUEUE): Define.
4145         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4146         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4147         Pass __futex value from before the unlock and __futex address instead
4148         of address of low 32-bits of __wakeup_seq to futex syscall.
4149         Fallback to FUTEX_WAKE all on any errors.
4150         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4151         Define.
4152         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4153         internally.  Return non-zero if error, zero if success.
4154         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4155         Add __data.__futex field, reshuffle __data.__clock.
4156         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4157         Define.
4158         (lll_futex_requeue): Add val argument, return 1 unconditionally
4159         for the time being.
4160         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4161         Add __data.__futex field, reshuffle __data.__clock.
4162         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4163         Define.
4164         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4165         internally.  Return non-zero if error, zero if success.
4166         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4167         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4168         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4169         Define.
4170         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4171         internally.  Return non-zero if error, zero if success.
4172         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4173         Add __data.__futex field, reshuffle __data.__clock.
4174         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4175         Define.
4176         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4177         internally.  Return non-zero if error, zero if success.
4178         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4179         Add __data.__futex field, reshuffle __data.__clock.
4180         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4181         Add __data.__futex field, reshuffle __data.__clock.
4182         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4183         Increment __futex at the same time as __wakeup_seq or __total_seq.
4184         Pass address of __futex instead of address of low 32-bits of
4185         __wakeup_seq to futex syscall.
4186         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4187         Pass __futex value from before releasing internal lock
4188         to FUTEX_WAIT.
4189         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4190         Likewise.  Avoid unnecessary shadowing of variables.
4191         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4192         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4193         unlock and __futex address instead of address of low 32-bits of
4194         __wakeup_seq to futex_requeue macro, adjust for new return value
4195         meaning.
4196         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4197         (__pthread_cond_signal): Increment __futex at the same time as
4198         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4199         address of low 32-bits of __wakeup_seq to futex syscall.
4200         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4201         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4202         releasing internal lock to FUTEX_WAIT.
4203         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4204         (__pthread_cond_timedwait): Likewise.
4205         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4206         (FUTEX_CMP_REQUEUE): Define.
4207         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4208         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4209         Pass __futex value from before the unlock and __futex address instead
4210         of address of low 32-bits of __wakeup_seq to futex syscall.
4211         Fallback to FUTEX_WAKE all on any errors.
4212
4213 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4214
4215         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4216         Add nop to align the end of critical section.
4217         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4218
4219 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4220
4221         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4222         Add __broadcast_seq field.
4223         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4224         all waiters as woken with woken_seq and bump broadcast counter.
4225         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4226         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4227         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4228         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4229
4230 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4231
4232         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4233         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4234         Reported by Kaz Kojima.
4235
4236 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4237
4238         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4239
4240 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4241
4242         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4243         __broadcast_seq with bc_seq after acquiring internal lock instead of
4244         before it.
4245
4246 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4247
4248         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4249         compilation.
4250         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4251         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4252         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4253         (pthread_cond_t): Add __data.__broadcast_seq field.
4254         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4255         (FRAME_SIZE): Define.
4256         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4257         Comment typo fixes.
4258         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4259         Define.
4260         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4261         typo fixes.
4262         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4263         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4264         fixes.
4265
4266 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4267
4268         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4269         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4270         Add __broadcast_seq field.
4271         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4272         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4273         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4274         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4275         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4276         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4277         all waiters as woken with woken_seq and bump broadcast counter.
4278         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4279         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4280         __broadcast_seq field.
4281         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4282         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4283         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4284         * pthread_cond_init.c: Initialize __broadcast_seq field.
4285         * Makefile (tests): Add tst-cond17 and tst-cond18.
4286         Add .NOTPARALLEL goal.
4287         * tst-cond16.c: New file.  From Jakub.
4288         * tst-cond17.c: New file.  From Jakub.
4289         * tst-cond18.c: New file.  From Jakub.
4290
4291 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4292
4293         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4294         unwind info.
4295
4296         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4297         Parametrize frame size.  Correct some unwind info.
4298         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4299
4300 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4301
4302         * tst-stack3.c: Note testing functionality beyond POSIX.
4303
4304 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4305
4306         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4307         Change conditional from ifdef to if.
4308
4309 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4310
4311         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4312         SYSDEP_CANCEL_ERROR): Define.
4313         (PSEUDO): Use it.
4314
4315 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4316
4317         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4318
4319 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4320
4321         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4322
4323 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4324
4325         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4326         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4327         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4328         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4329
4330 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4331
4332         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4333         thread has all signals blocked.
4334
4335 2004-04-18  Andreas Jaeger  <aj@suse.de>
4336
4337         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4338         (SEM_VALUE_MAX): Add missing brace.
4339
4340 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4341
4342         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4343         in rt subdir.
4344         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4345         * sysdeps/pthread/tst-mqueue8x.c: New test.
4346         * tst-cancel4.c: Update comment about message queues.
4347
4348         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4349         return it_value { 0, 0 }.
4350         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4351         like SIGEV_SIGNAL.
4352         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4353         assertion for SIGEV_NONE.
4354         (thread_attr_compare): Compare all attributes, not just a partial
4355         subset.
4356
4357 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4358
4359         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4360
4361 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4362
4363         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4364         Just use a plain number.
4365         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4366         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4367         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4368         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4369         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4370         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4371         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4372
4373 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4374
4375         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4376         frame info.
4377         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4378
4379 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4380
4381         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4382         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4383         of calling sigwaitinfo.
4384
4385 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4386
4387         * allocatestack.c (allocate_stack): Set reported_guardsize
4388         unconditionally.
4389         * pthread_getattr_np.c (pthread_getattr_np): Use
4390         reported_guardsize instead of guardsize.
4391         * descr.h (struct pthread): Add reported_guardsize field.
4392
4393 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4394
4395         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4396
4397 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4398
4399         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4400
4401 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4402
4403         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4404         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4405         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4406         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4407         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4408         Define.
4409         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4410         (_POSIX_MESSAGE_PASSING): Define.
4411         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4412         (_POSIX_MESSAGE_PASSING): Define.
4413         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4414         (_POSIX_MESSAGE_PASSING): Define.
4415
4416 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4417
4418         * tst-context1.c (fct): Check whether correct stack is used.
4419
4420 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4421
4422         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4423         matching constraints for asm mem parameters.
4424
4425         * tst-clock2.c (tf): Don't define unless needed.
4426
4427 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4428
4429         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4430         $(gnulib).
4431
4432 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4433
4434         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4435         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4436         * pthreadP.h: Declare __nptl_deallocate_tsd.
4437         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4438         Adjust caller.
4439
4440         * Makefile (tests): Add tst-tsd5.
4441         * tst-tsd5.c: New file.
4442
4443 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4444
4445         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4446         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4447         is SHLIB_COMPAT check.
4448         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4449         (__pthread_attr_getaffinity_old): Likewise.
4450         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4451         (__pthread_getaffinity_old): Likewise.
4452         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4453         (__pthread_setaffinity_old): Likewise.
4454
4455 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4456
4457         * allocatestack.c (_make_stacks_executable): Call
4458         _dl_make_stack_executable first.
4459
4460 2004-03-24  Roland McGrath  <roland@redhat.com>
4461
4462         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4463         constraint instead of "0".
4464
4465 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4466
4467         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4468         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4469
4470         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4471         code to avoid warning.
4472
4473 2004-03-24  Andreas Jaeger  <aj@suse.de>
4474
4475         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4476         (__pthread_attr_setaffinity_old): Remove const.
4477
4478 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4479
4480         * sysdeps/unix/sysv/linux/smp.h: New file.
4481         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4482         * init.c: Define __is_smp.
4483         (__pthread_initialize_minimal_internal): Call is_smp_system to
4484         initialize __is_smp.
4485         * pthreadP.h: Declare __is_smp.
4486         Define MAX_ADAPTIVE_COUNT is necessary.
4487         * pthread_mutex_init.c: Add comment regarding __spins field.
4488         * pthread_mutex_lock.c: Implement adaptive mutex type.
4489         * pthread_mutex_timedlock.c: Likewise.
4490         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4491         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4492         Add __spins field.
4493         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4494         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4495         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4496         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4497         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4498         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4499         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4500         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4501         lll_mutex_cond_trylock.
4502         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4503         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4504         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4505         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4506         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4507         Define BUSY_WAIT_NOP.
4508         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4509         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4510
4511         * tst-mutex5.c: Add support for testing adaptive mutexes.
4512         * tst-mutex7.c: Likewise.
4513         * tst-mutex5a.c: New file.
4514         * tst-mutex7a.c: New file.
4515         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4516
4517         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4518         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4519         vgettimeofday call might destroy the content.
4520
4521         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4522         @pause in the loop.
4523
4524         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4525         No need to restrict type of ret.  Make it int.  Add comment.
4526
4527         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4528         Remove unnecessary setne instruction.
4529
4530 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4531
4532         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4533         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4534         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4535         If realloc fails, break out of the loop.
4536
4537 2004-03-20  Andreas Jaeger  <aj@suse.de>
4538
4539         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4540         (__pthread_setaffinity_old): Fix interface.
4541         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4542         (__pthread_getaffinity_old): Likewise.
4543
4544         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4545         (__pthread_setaffinity_new): Remove duplicate declaration.
4546
4547 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4548
4549         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4550         the return value to a safe register.
4551         (CDISABLE): Set the function argument correctly.
4552
4553 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4554
4555         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4556         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4557         Rewrite so that only one locked memory operation per round is needed.
4558         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4559         (pthread_barrier_wait): After wakeup, release lock only when the
4560         last thread stopped using the barrier object.
4561         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4562         (__pthread_cond_wait): Don't store mutex address if the current
4563         value is ~0l.  Add correct cleanup support and unwind info.
4564         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4565         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4566         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4567         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4568         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4569         Add correct cleanup support and unwind info.
4570         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4571         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4572         information for syscall wrappers.
4573
4574 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4575
4576         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4577         cpusetsize field, remove next.
4578         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4579         parameter for size of the CPU set.
4580         (pthread_setaffinity_np): Likewise.
4581         (pthread_attr_getaffinity_np): Likewise.
4582         (pthread_attr_setaffinity_np): Likewise.
4583         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4584         interface change, keep compatibility code.
4585         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4586         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4587         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4588         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4589         __pthread_getaffinity_np.
4590         * Versions: Add version for changed interfaces.
4591         * tst-attr3.c: Adjust test for interface change.
4592         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4593         increasing buffer sizes.
4594         * pthread_attr_destroy.c: Remove unused list handling.
4595         * pthread_attr_init.c: Likewise.
4596
4597 2004-03-17  Roland McGrath  <roland@redhat.com>
4598
4599         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4600         first argument to clock_getres so we ever enable kernel timers.
4601
4602 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4603
4604         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4605
4606 2004-03-12  Richard Henderson  <rth@redhat.com>
4607
4608         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4609         oldvalue from CENABLE to CDISABLE.
4610
4611 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4612
4613         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4614         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4615         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4616         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4617
4618 2004-03-11  Richard Henderson  <rth@redhat.com>
4619
4620         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4621         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4622         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4623
4624 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4625
4626         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4627         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4628         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4629
4630 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4631
4632         * forward.c (__pthread_cond_broadcast_2_0,
4633         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4634         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4635         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4636
4637 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4638
4639         * sysdeps/sh/tcb-offsets.sym: Add PID.
4640         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4641         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4642
4643 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4644
4645         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4646         include <sysdep-cancel.h>, vfork is no cancellation point.
4647         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4648         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4649         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4650
4651 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4652
4653         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4654         libc_hidden_def.
4655         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4656         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4657         Likewise.
4658         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4659         Likewise.
4660         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4661         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4662         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4663         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4664         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4665
4666         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4667         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4668         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4669         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4670         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4671         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4672
4673         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4674         a local register for saving old PID.  Negate PID in parent upon exit.
4675
4676         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4677         tcb-offsets.h.
4678         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4679         before syscall, set to the old value in the parent afterwards.
4680         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4681         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4682         tcb-offsets.h.
4683         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4684         before syscall, set to the old value in the parent afterwards.
4685         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4686         * sysdeps/s390/tcb-offsets.sym: Add PID.
4687
4688         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4689         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4690         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4691         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4692         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4693         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4694
4695 2004-03-10  Andreas Schwab  <schwab@suse.de>
4696
4697         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4698         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4699         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4700
4701 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4702
4703         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4704         * tst-cancel21.c (do_one_test): Likewise.
4705         Reported by Gordon Jin <gordon.jin@intel.com>.
4706
4707 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4708
4709         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4710         if non-zero and set to INT_MIN if zero.
4711         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4712         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4713         (SAVE_PID, RESTORE_PID): Define.
4714         (__vfork): Use it.
4715         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4716         Use relative path to avoid including NPTL i386/vfork.S.
4717         (SAVE_PID, RESTORE_PID): Define.
4718         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4719         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4720         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4721         tst-vfork2x.
4722         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4723         * tst-vfork1.c: New test.
4724         * tst-vfork2.c: New test.
4725         * tst-vfork1x.c: New test.
4726         * tst-vfork2x.c: New test.
4727
4728 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4729
4730         * sysdeps/i386/tcb-offsets.sym: Add PID.
4731         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4732         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4733         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4734
4735 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4736
4737         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4738
4739 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4740
4741         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4742         _rtld_global_ro.
4743
4744 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4745
4746         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4747         _rtld_global_ro.
4748
4749         * tst-once4.c: Remove unnecessary macro definition.
4750
4751         * tst-mutex7.c (do_test): Limit thread stack size.
4752         * tst-once2.c (do_test): Likewise.
4753         * tst-tls3.c (do_test): Likewise.
4754         * tst-tls1.c (do_test): Likewise.
4755         * tst-signal3.c (do_test): Likewise.
4756         * tst-kill6.c (do_test): Likewise.
4757         * tst-key4.c (do_test): Likewise.
4758         * tst-join4.c (do_test): Likewise.
4759         * tst-fork1.c (do_test): Likewise.
4760         * tst-context1.c (do_test): Likewise.
4761         * tst-cond2.c (do_test): Likewise.
4762         * tst-cond10.c (do_test): Likewise.
4763         * tst-clock2.c (do_test): Likewise.
4764         * tst-cancel10.c (do_test): Likewise.
4765         * tst-basic2.c (do_test): Likewise.
4766         * tst-barrier4.c (do_test): Likewise.
4767
4768 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4769
4770         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4771
4772 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4773
4774         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4775         (__pthread_cond_timedwait): Optimize wakeup test.
4776         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4777         (__pthread_cond_wait): Likewise.
4778         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4779         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4780         Likewise.
4781
4782 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4783
4784         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4785         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4786         the atomic instruction needed.
4787         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4788         (__lll_mutex_lock_wait): Likewise.
4789
4790 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4791
4792         * Makefile (tests): Add tst-cond14 and tst-cond15.
4793         * tst-cond14.c: New file.
4794         * tst-cond15.c: New file.
4795
4796 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4797
4798         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4799         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4800         needs to be implemented differently to be useful.
4801
4802 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4803
4804         * pthread_attr_setschedparam.c: Don't test priority against limits
4805         here.  Set ATTR_FLAG_SCHED_SET flag.
4806         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4807         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4808         from parent thread to child.  If attribute is used and scheduling
4809         parameters are not inherited, copy parameters from attribute or
4810         compute them.  Check priority value.
4811         * pthread_getschedparam.c: If the parameters aren't known yet get
4812         them from the kernel.
4813         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4814         ATTR_FLAG_POLICY_SET flag for thread.
4815         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4816         and ATTR_FLAG_POLICY_SET.
4817
4818         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4819
4820         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4821         fail if stack address hasn't been set.  Just return 0.
4822
4823 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4824
4825         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4826         libpthread for the files in this list.
4827         (CFLAGS-tst-unload): Removed.
4828         * tst-unload.c (do_test): Don't use complete path for
4829         LIBPHREAD_SO.
4830
4831         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4832         tst-_res1mod2.
4833
4834 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4835
4836         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4837         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4838         operation per round is needed.
4839         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4840         (__lll_mutex_lock_wait): Likewise.
4841
4842 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4843
4844         * tst-cancel9.c (cleanup): Don't print to stderr.
4845
4846 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4847
4848         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4849
4850 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4851
4852         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4853         (__syscall_error_handler2): Call CDISABLE.
4854         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4855         (__syscall_error_handler2): Call CDISABLE.
4856
4857         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4858         Release lock before the loop, don't reacquire it.
4859
4860         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4861
4862 2004-02-19  Andreas Schwab  <schwab@suse.de>
4863
4864         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4865         Fix last change.
4866
4867 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
4868
4869         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4870         (pthread_barrier_wait): After wakeup, release lock only when the
4871         last thread stopped using the barrier object.
4872         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
4873         (pthread_barrier_wait): Likewise.
4874         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4875         Likewise.
4876         * Makefile (tests): Add tst-barrier4.
4877         * tst-barrier4.c: New file.
4878
4879         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4880         (__pthread_cond_timedwait): Perform timeout test while holding
4881         internal lock to prevent wakeup race.
4882         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4883         * sysdeps/pthread/pthread_cond_timedwait.c
4884         (__pthread_cond_timedwait): Likewise.
4885         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4886         (__pthread_cond_timedwait): Likewise.
4887
4888 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
4889
4890         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
4891         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
4892         * Makefile (tests): Add tst-rwlock13.
4893         * tst-rwlock13.c: New test.
4894
4895 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
4896
4897         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4898         (__condvar_tw_cleanup): Little optimization.
4899         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4900
4901 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
4902
4903         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
4904         libpthread as "lib" parameter to SHLIB_COMPAT.
4905         (__novmx_siglongjmp): Fix typo in function name.
4906         (__novmx_longjmp): Fix typo in function name.
4907
4908 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4909
4910         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
4911         __builtin_expect.
4912
4913         * sysdeps/generic/pt-longjmp.c: Moved to...
4914         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
4915
4916 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
4917
4918         * Makefile (libpthread-routines): Add pt-cleanup.
4919         * pt-longjmp.c: Removed.
4920         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
4921         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
4922         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
4923         Version longjmp, siglongjmp for GLIBC_2.3.4.
4924         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
4925
4926 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4927
4928         * sysdeps/pthread/pthread_cond_timedwait.c
4929         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
4930         Reuse code.  Add __builtin_expects.
4931
4932         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4933         (__pthread_cond_timedwait): Get internal lock in case timeout has
4934         passed before the futex syscall.
4935         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4936
4937 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
4938
4939         * allocatestack.c: Pretty printing.
4940
4941         * sysdeps/pthread/createthread.c (create_thread): Don't add
4942         CLONE_DETACHED bit if it is not necessary.
4943
4944 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
4945
4946         * pthread_getattr_np.c: Include ldsodefs.h.
4947
4948 2004-01-16  Richard Henderson  <rth@redhat.com>
4949
4950         * allocatestack.c: Don't declare __libc_stack_end.
4951         * init.c (__pthread_initialize_minimal_internal): Likewise.
4952         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
4953
4954 2004-01-15  Richard Henderson  <rth@redhat.com>
4955
4956         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
4957         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
4958         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
4959         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
4960         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
4961         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
4962         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
4963         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
4964
4965 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
4966
4967         * init.c (pthread_functions): Make array const.
4968
4969 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
4970
4971         * allocatestack.c (__make_stacks_executable): Change interface.
4972         Check parameters.  Pass parameter on to libc counterpart.
4973         * pthreadP.h: Change declaration.
4974
4975 2004-01-13  Richard Henderson  <rth@redhat.com>
4976
4977         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
4978         prototype form.
4979         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
4980         Likewise.
4981
4982         * sysdeps/alpha/Makefile: New file.
4983         * sysdeps/alpha/tcb-offsets.sym: New file.
4984         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4985         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
4986
4987         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
4988         on powerpc version.
4989
4990 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
4991
4992         * Makefile (tests): Add tst-backtrace1.
4993         * tst-backtrace1.c: New test.
4994
4995 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
4996
4997         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
4998         register as second parameter to the REGISTER macro.
4999         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5000         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5001         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5002         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5003         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5004         of thread register as second parameter to REGISTER macro in 64 case.
5005
5006 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5007
5008         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5009         (CFLAGS-getpid.o): Defined.
5010         (CFLAGS-getpid.os): Defined.
5011
5012 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5013
5014         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5015         returned for main thread does not overlap with any other VMA.
5016         Patch by Jakub Jelinek.
5017
5018 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5019
5020         * tst-raise1.c: Include stdio.h.
5021
5022 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5023
5024         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5025         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5026         If pid is 0, set it to selftid.
5027         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5028         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5029         != 0, return self->tid without doing a syscall.
5030         * descr.h (struct pthread): Move pid field after tid.
5031
5032         * Makefile (tests): Add tst-raise1.
5033         * tst-raise1.c: New file.
5034
5035 2003-12-23  Roland McGrath  <roland@redhat.com>
5036
5037         * tst-oddstacklimit.c: New file.
5038         * Makefile (tests): Add it.
5039         (tst-oddstacklimit-ENV): New variable.
5040
5041         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5042         value up to page size for __default_stacksize.
5043
5044 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5045
5046         * Makefile (tests): Add tst-eintr5.
5047         * tst-eintr5.c: New file.
5048
5049         * eintr.c (eintr_source): Prevent sending signal to self.
5050
5051         * tst-eintr2.c (tf1): Improve error message.
5052
5053 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5054
5055         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5056         * sysdeps/unix/sysv/linux/getpid.c: New file.
5057         * pthread_cancel.c: Add comment explaining use of PID field.
5058         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5059         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5060         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5061         temporarily to signal the field must not be relied on and updated
5062         by getpid().
5063         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5064         temporarily negative.
5065         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5066
5067 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5068
5069         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5070         (eintr_source): If ARG != NULL, use pthread_kill.
5071         * tst-eintr1.c: Adjust for this change.
5072         * tst-eintr2.c: Likewise.
5073         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5074         * tst-eintr3.c: New file.
5075         * tst-eintr4.c: New file.
5076
5077 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5078
5079         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5080         if CANCELSTATE_BITMASK is set.
5081         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5082         Likewise.
5083
5084         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5085         (tests-reverse): Add tst-cancel23.
5086         * tst-cancel22.c: New test.
5087         * tst-cancel23.c: New test.
5088
5089 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5090
5091         * tst-eintr1.c: Better error messages.
5092
5093         * Makefile (tests): Add tst-eintr2.
5094         * tst-eintr2.c: New file.
5095
5096 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5097
5098         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5099         (CFLAGS-tst-cancelx21.c): Set.
5100         * tst-cancel21.c: New test.
5101         * tst-cancelx21.c: New test.
5102
5103         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5104         comparison operand.
5105         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5106         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5107         * pt-longjmp.c: Include jmpbuf-unwind.h.
5108         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5109         _JMPBUF_UNWINDS.  Adjust compared pointers.
5110         * init.c (__pthread_initialize_minimal_internal): Initialize
5111         pd->stackblock_size.
5112         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5113         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5114         * sysdeps/i386/jmpbuf-unwind.h: New file.
5115         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5116         * sysdeps/s390/jmpbuf-unwind.h: New file.
5117         * sysdeps/sh/jmpbuf-unwind.h: New file.
5118         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5119         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5120         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5121         (_JMPBUF_CFA_UNWINDS): Remove.
5122         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5123
5124 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5125
5126         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5127         (CFLAGS-tst-cancelx20.c): Set.
5128         * tst-cancel20.c: New test.
5129         * tst-cancelx20.c: New test.
5130
5131 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5132
5133         * init.c (__pthread_initialize_minimal_internal): Don't treat
5134         architectures with separate register stack special here when
5135         computing default stack size.
5136
5137 2003-12-17  Roland McGrath  <roland@redhat.com>
5138
5139         * Makefile (tst-cancelx7-ARGS): New variable.
5140         Reportd by Greg Schafer <gschafer@zip.com.au>.
5141
5142 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5143
5144         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5145         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5146         (tst-stack3-ENV): Set.
5147         ($(objpfx)tst-stack3-mem): New.
5148         * tst-stack3.c: New test.
5149
5150 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5151
5152         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5153         Add unwind directives.  Drop unused .regstk directive.
5154         (_fini_EPILOG_BEGINS): Add unwind directives.
5155
5156 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5157
5158         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5159         Assume parameter is a pointer.
5160         (lll_futex_wake): Likewise.
5161         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5162         Likewise.
5163         (lll_futex_wake): Likewise.
5164         Reported by Boris Hu.
5165         * sysdeps/unix/sysv/linux/unregister-atfork.c
5166         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5167
5168         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5169
5170 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5171
5172         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5173         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5174         __rtld_lock_initialize for ld.so lock.
5175         Patch in part by Adam Li <adam.li@intel.com>.
5176
5177 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5178
5179         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5180         in $(gnulib).  Also, remove stale comment.
5181
5182 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5183
5184         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5185         advantage of new syscall stub and optimize accordingly.
5186
5187         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5188         from SYS_futex, to match expectations of
5189         sysdep.h:DO_INLINE_SYSCALL.
5190         (lll_futex_clobbers): Remove.
5191         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5192         (lll_futex_wake): Likewise.
5193         (lll_futex_requeue): Likewise.
5194         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5195         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5196         Jelinek).
5197         (__lll_mutex_lock): Likewise.
5198         (__lll_mutex_cond_lock): Likewise.
5199         (__lll_mutex_timed_lock): Likewise.
5200         (__lll_mutex_unlock): Likewise.
5201         (__lll_mutex_unlock_force): Likewise.
5202
5203         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5204         comes before the include of <sysdep.h>.
5205         (THREAD_SELF_SYSINFO): New macro.
5206         (THREAD_SYSINFO): Likewise.
5207         (INIT_SYSINFO): New macro.
5208         (TLS_INIT_TP): Call INIT_SYSINFO.
5209
5210         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5211
5212         * sysdeps/pthread/createthread.c (create_thread): Use
5213         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5214         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5215         THREAD_SELF_SYSINFO instead of open code.
5216         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5217         (THREAD_SYSINFO): Likewise.
5218
5219         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5220
5221         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5222
5223 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5224
5225         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5226         instead of .init.  Patch by David Mosberger.
5227
5228 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5229
5230         * sysdeps/pthread/configure.in: Remove broken declaration in C
5231         cleanup handling check.
5232
5233 2003-11-30  Andreas Jaeger  <aj@suse.de>
5234
5235         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5236         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5237         Likewise.
5238
5239 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5240
5241         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5242         * pthread_attr_destroy.c: Include shlib-compat.h.
5243         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5244         is set in iattr->flags.
5245         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5246
5247 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5248
5249         * Makefile (distribute): Add tst-cleanup4aux.c.
5250
5251         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5252         include.
5253
5254 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5255
5256         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5257         pthread_cond_signal.
5258
5259         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5260         store mutex address if the current value is ~0l.
5261         * sysdeps/pthread/pthread_cond_timedwait.c
5262         (__pthread_cond_timedwait): Likewise.
5263         * sysdeps/pthread/pthread_cond_broadcast.c
5264         (__pthread_cond_broadcast): Don't use requeue for pshared
5265         condvars.
5266
5267         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5268         (__pthread_cond_wait): Don't store mutex address if the current
5269         value is ~0l.
5270         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5271         (__pthread_cond_timedwait): Likewise.
5272         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5273         (__pthread_cond_broadcast): Don't use requeue for pshared
5274         condvars.
5275
5276         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5277         element with ~0l for pshared condvars, with NULL otherwise.
5278
5279         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5280         (__pthread_cond_wait): Don't store mutex address if the current
5281         value is ~0l.
5282         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5283         (__pthread_cond_timedwait): Likewise.
5284         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5285         (__pthread_cond_broadcast): Don't use requeue for pshared
5286         condvars.
5287
5288         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5289         * tst-cond12.c: New file.
5290         * tst-cond13.c: New file.
5291
5292 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5293
5294         * sysdeps/pthread/configure.in: Make missing forced unwind support
5295         fatal.
5296
5297 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5298
5299         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5300
5301 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5302
5303         * Makefile: Add magic to clean up correctly.
5304
5305 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5306
5307         * unwind.c (FRAME_LEFT): Define.
5308         (unwind_stop): Handle old style cleanups here.
5309         (__pthread_unwind): Handle old style cleanups only if
5310         !HAVE_FORCED_UNWIND.
5311         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5312         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5313         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5314         ($(objpfx)tst-cleanupx4): Likewise.
5315         * tst-cleanup4.c: New test.
5316         * tst-cleanup4aux.c: New.
5317         * tst-cleanupx4.c: New test.
5318
5319 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5320
5321         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5322         lll_mutex_*lock macros to skip atomic operations on some archs.
5323
5324 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5325
5326         * sysdeps/pthread/tst-timer.c (main): Initialize
5327         sigev2.sigev_value as well.
5328
5329 2003-10-15  Roland McGrath  <roland@redhat.com>
5330
5331         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5332         is missing.
5333         * sysdeps/pthread/configure: Regenerated.
5334
5335 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5336
5337         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5338         locking macros.  No distinction between normal and mutex locking
5339         anymore.
5340         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5341         Merge bits from lowlevelmutex.S we still need.
5342         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5343         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5344         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5345         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5346         new mutex implementation.
5347         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5348         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5349         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5350         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5351         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5352         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5353         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5354         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5355         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5356         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5357         symbol for entry point to avoid cancellation.
5358
5359 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5360
5361         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5362         changes.
5363         (SAVE_OLDTYPE_0): Fix a typo.
5364
5365 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5366
5367         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5368         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5369
5370 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5371
5372         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5373         correct offset.
5374
5375 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5376
5377         * Makefile (tests): Add tst-cancel19.
5378         * tst-cancel19.c: New test.
5379
5380 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5381
5382         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5383         restoring of the old cancellation type.
5384
5385 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5386
5387         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5388
5389 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5390
5391         * sysdeps/pthread/malloc-machine.h: New file
5392
5393 2003-09-24  Roland McGrath  <roland@redhat.com>
5394
5395         * allocatestack.c (__make_stacks_executable): Don't ignore return
5396         value from _dl_make_stack_executable.
5397
5398 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5399
5400         * allocatestack.c (__make_stacks_executable): Also change
5401         permission of the currently unused stacks.
5402
5403         * allocatestack.c (change_stack_perm): Split out from
5404         __make_stacks_executable.
5405         (allocate_stack): If the required permission changed between the time
5406         we started preparing the stack and queueing it, change the permission.
5407         (__make_stacks_executable): Call change_stack_perm.
5408
5409         * Makefile: Build tst-execstack-mod locally.
5410         * tst-execstack-mod.c: New file.
5411
5412 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5413
5414         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5415
5416 2003-09-23  Roland McGrath  <roland@redhat.com>
5417
5418         * tst-execstack.c: New file.
5419         * Makefile (tests): Add it.
5420         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5421         (LDFLAGS-tst-execstack): New variable.
5422
5423         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5424         whether to use PROT_EXEC for stack mmap.
5425         (__make_stacks_executable): New function.
5426         * pthreadP.h: Declare it.
5427         * init.c (__pthread_initialize_minimal_internal): Set
5428         GL(dl_make_stack_executable_hook) to that.
5429
5430 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5431
5432         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5433         recommendation from AMD re avoidance of lock prefix.
5434
5435 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5436
5437         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5438         lll_futex_timed_wait instead of lll_futex_wait.
5439         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5440         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5441         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5442         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5443         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5444         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5445         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5446         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5447         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5448         Completely revamp the locking macros.  No distinction between
5449         normal and mutex locking anymore.
5450         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5451         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5452         __lll_lock_timedwait): Fix prototypes.
5453         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5454         __lll_lock_timedwait): Likewise.
5455         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5456         macros, add __builtin_expect.
5457         (lll_mutex_timedlock): Likewise.  Fix return value.
5458         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5459         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5460         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5461         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5462         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5463         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5464         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5465         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5466
5467 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5468
5469         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5470         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5471         operation if possible.
5472
5473         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5474         like jumping over the lock prefix.
5475
5476 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5477
5478         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5479         locking macros.  No distinction between normal and mutex locking
5480         anymore.
5481         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5482         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5483         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5484         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5485         locking.  Merge bits from lowlevelmutex.S we still need.
5486         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5487         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5488         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5489         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5490         * Makefile (routines): Remove libc-lowlevelmutex.
5491         (libpthread-rountines): Remove lowlevelmutex.
5492         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5493         for new mutex implementation.
5494         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5495         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5496         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5497         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5498         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5499         Likewise.
5500         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5501         Likewise.
5502         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5503         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5504         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5505         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5506         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5507         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5508         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5509         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5510         Likewise.
5511         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5512         Likewise.
5513         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5514         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5516         Don't use requeue.
5517         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5518         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5519
5520 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5521
5522         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5523         in parameters of asm with output parameters.
5524
5525         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5526         type of DECR parameter to int.
5527         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5528
5529 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5530
5531         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5532         guardsize for each thread.
5533
5534 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5535
5536         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5537         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5538         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5539
5540         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5541         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5542         NULL.
5543         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5544         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5545         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5546         (pthread_getaffinity_np): Add hidden_def.
5547
5548         * Makefile (tests): Add tst-attr3.
5549         * tst-attr3.c: New test.
5550
5551         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5552
5553 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5554
5555         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5556         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5557
5558 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5559
5560         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5561         * tst-align.c: Include tst-stack-align.h.
5562         (tf, do_test): Use TEST_STACK_ALIGN macro.
5563
5564 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5565
5566         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5567         variable.
5568
5569 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5570
5571         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5572         stack-related values for the initial thread.
5573
5574 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5575
5576         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5577
5578 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5579
5580         * pthread_mutex_lock.c: Minor code rearrangements.
5581
5582 2003-09-05  Roland McGrath  <roland@redhat.com>
5583
5584         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5585         Instead, include ../nptl_db/db_info.c to do its magic.
5586         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5587         (__pthread_pthread_key_2ndlevel_size): Likewise.
5588         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5589         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5590         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5591         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5592         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5593         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5594         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5595         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5596         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5597         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5598         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5599         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5600         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5601         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5602         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5603         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5604         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5605
5606 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5607
5608         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5609         of pthread_t to be compatible with LT.
5610         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5611         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5612         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5613         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5614         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5615         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5616         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5617
5618 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5619
5620         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5621
5622 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5623
5624         * unwind-forcedunwind.c: Move to...
5625         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5626         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5627         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5628         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5629         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5630         * unwind.c: Include jmpbuf-unwind.h.
5631         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5632
5633 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5634
5635         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5636         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5637         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5638         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5639         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5640         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5641         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5642         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5643         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5644         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5645         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5646         function.
5647         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5648         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5649         * Makefile (tests): Add tst-stack2.
5650         * tst-stack2.c: New test.
5651         * tst-stack1.c: Include limits.h and sys/param.h.
5652         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5653
5654         * pthread_condattr_setpshared.c: Include errno.h.
5655         (pthread_condattr_setpshared): Return EINVAL if pshared
5656         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5657
5658         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5659         defined symbol for entry point to avoid cancellation.
5660         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5661         Likewise.
5662         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5663         Likewise.
5664         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5665         Likewise.
5666         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5667         Likewise.
5668         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5669         Likewise.
5670         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5671         __close_nocancel, __read_nocancel, __write_nocancel,
5672         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5673         libpthread.so or librt.so, define to corresponding function
5674         without _nocancel suffix.
5675         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5676         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5677         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5678
5679         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5680
5681 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5682
5683         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5684         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5685
5686         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5687         in subsections has a symbol associated with it.
5688
5689         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5690         defined symbol for entry point to avoid cancellation.
5691         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5692
5693 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5694
5695         * Makefile (tests): Add tst-tls5.
5696         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5697         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5698         ($(objpfx)tst-tls5): New.
5699         ($(objpfx)tst-tls6.out): Likewise.
5700         (tests): Depend on $(objpfx)tst-tls6.out.
5701         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5702         (do_test): Check pthread_self () return value alignment.
5703         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5704         (tf): Check pthread_self () return value alignment.
5705         * tst-tls5.c: New test.
5706         * tst-tls5.h: New.
5707         * tst-tls5mod.c: New.
5708         * tst-tls5moda.c: New.
5709         * tst-tls5modb.c: New.
5710         * tst-tls5modc.c: New.
5711         * tst-tls5modd.c: New.
5712         * tst-tls5mode.c: New.
5713         * tst-tls5modf.c: New.
5714         * tst-tls6.sh: New test.
5715
5716         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5717         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5718         * init.c (pthread_functions): Initialize them.
5719         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5720         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5721         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5722         pthread_cond_timedwait@@GLIBC_2.3.2.
5723
5724 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5725
5726         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5727         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5728         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5729         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5730         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5731         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5732
5733         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5734
5735         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5736         _POSIX_THREAD_PRIORITY_SCHEDULING.
5737         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5738
5739 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5740
5741         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5742         nested function, use static inline function from libio.h.
5743         Code by Richard Henderson.
5744
5745         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5746         weak.
5747
5748 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5749
5750         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5751         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5752         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5753         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5754         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5755         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5756         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5757         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5758         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5759         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5760         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5761         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5762         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5763         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5764         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5765         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5766         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5767         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5768         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5769         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5770         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5771         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5772         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5773         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5774         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5775         * sysdeps/sparc/tls.h: New file.
5776         * sysdeps/sparc/tcb-offsets.sym: New file.
5777         * sysdeps/sparc/Makefile: New file.
5778         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5779         * init.c [__sparc__] (__NR_set_tid_address): Define.
5780
5781 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5782
5783         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5784         _IO_release_lock): Define.
5785
5786 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5787
5788         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5789         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5790
5791 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5792
5793         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5794         (__pthread_cleanup_class): Add missing return types of member
5795         functions.
5796
5797 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5798
5799         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5800         (lll_mutex_unlock_force): Add memory barrier between store and futex
5801         syscall.
5802
5803 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5804
5805         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5806         tempmsg in first loop.
5807
5808 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5809
5810         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5811         _POSIX_THREAD_PRIORITY_SCHEDULING.
5812         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5813
5814 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5815
5816         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5817         (__rtld_lock_default_lock_recursive,
5818         __rtld_lock_default_unlock_recursive): Define.
5819         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5820         __rtld_lock_unlock_recursive): Define using
5821         GL(_dl_rtld_*lock_recursive).
5822         * init.c (__pthread_initialize_minimal_internal): Initialize
5823         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5824         Lock GL(_dl_load_lock) the same number of times as
5825         GL(_dl_load_lock) using non-mt implementation was nested.
5826
5827         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5828         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5829
5830 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5831
5832         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5833         PIPE_BUF.
5834
5835 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5836
5837         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5838
5839 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5840
5841         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5842         to first syscall error check.  Move syscall error check for tkill
5843         into __ASSUME_CLONE_STOPPED #ifdef.
5844
5845 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5846
5847         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5848         is not defined, do explicit synchronization.
5849         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5850         is not defined also unlock pd->lock for non-debugging case in case
5851         it is necessary.
5852         * pthread_create.c (start_thread): Always get and release pd->lock
5853         if __ASSUME_CLONE_STOPPED is not defined.
5854         (start_thread_debug): Removed.  Adjust users.
5855         * allocatestack.c (allocate_stack): Always initialize lock if
5856         __ASSUME_CLONE_STOPPED is not defined.
5857         * Makefile (tests): Add tst-sched1.
5858         * tst-sched1.c: New file.
5859
5860         * sysdeps/pthread/createthread.c (do_clone): Only use
5861         sched_setschduler and pass correct parameters.
5862
5863 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5864
5865         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
5866         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
5867         PTHREAD_STACK_MIN in comments.
5868
5869 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5870
5871         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5872         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
5873         argument.
5874         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
5875         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
5876         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
5877         (__pthread_cleanup_upto): Fix prototype.
5878         (_longjmp_unwind): Adjust caller.
5879         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
5880         Change second argument to const struct pointer.
5881         * tst-sem8.c (main): Remove unused s2 and s3 variables.
5882         * tst-sem9.c (main): Likewise.
5883         * unwind.c: Include string.h for strlen prototype.
5884
5885 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
5886
5887         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5888         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
5889         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
5890         Define HAVE_CMOV.
5891         Patch by Nicholas Miell <nmiell@attbi.com>.
5892
5893 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
5894
5895         * init.c (__pthread_initialize_minimal_internal): Initialize
5896         GL(dl_init_static_tls).
5897         * pthreadP.h (__pthread_init_static_tls): New prototype.
5898         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
5899         New functions.
5900         * Makefile (tests): Add tst-tls4.
5901         (modules-names): Add tst-tls4moda and tst-tls4modb.
5902         ($(objpfx)tst-tls4): Link against libdl and libpthread.
5903         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
5904         tst-tls4modb.so.
5905         * tst-tls4.c: New file.
5906         * tst-tls4moda.c: New file.
5907         * tst-tls4modb.c: New file.
5908
5909 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
5910
5911         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
5912         before __timer_dealloc.
5913         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
5914         Don't call list_unlink.
5915
5916 2003-07-29  Roland McGrath  <roland@redhat.com>
5917
5918         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
5919
5920 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
5921
5922         * tst-cancel17.c (do_test): Check if aio_cancel failed.
5923         Don't reuse struct aiocb A if it failed.
5924         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
5925         not just one byte, as that does not block.
5926
5927 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
5928
5929         * sysdeps/pthread/unwind-resume.c: New file.
5930         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
5931         unwind-resume in csu subdir.
5932         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
5933         exceptions.
5934         (librt-sysdep_routines, librt-shared-only-routines): Add
5935         rt-unwind-resume.
5936         * sysdeps/pthread/rt-unwind-resume.c: New file.
5937         * unwind-forcedunwind.c: New file.
5938         * Makefile (libpthread-routines): Add unwind-forcedunwind.
5939         (libpthread-shared-only-routines): Likewise.
5940         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
5941         * pthreadP.h (pthread_cancel_init): New prototype.
5942         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
5943
5944         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
5945         attr argument const struct pthread_attr *.
5946
5947         * res.c (__res_state): Return __resp.
5948         * descr.h: Include resolv.h.
5949         (struct pthread): Add res field.
5950         * pthread_create.c: Include resolv.h.
5951         (start_thread): Initialize __resp.
5952         * Makefile (tests): Add tst-_res1.
5953         (module-names): Add tst-_res1mod1, tst-_res1mod2.
5954         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
5955         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
5956         libpthread.
5957         * tst-_res1.c: New file.
5958         * tst-_res1mod1.c: New file.
5959         * tst-_res1mod2.c: New file.
5960
5961 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
5962
5963         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
5964
5965         * Makefile: Define various *-no-z-defs variables for test DSOs
5966         which has undefined symbols.
5967
5968 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
5969
5970         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
5971         Retry if the stwcx fails to store once_control.
5972
5973 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
5974
5975         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
5976         pthread_attr_setaffinity.
5977         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
5978         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
5979         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
5980         * pthread_attr_destroy.c: Free cpuset element if allocated.
5981         * pthread_create.c: Pass iattr as additional parameter to
5982         create_thread.
5983         * sysdeps/pthread/createthread.c: If attribute is provided and
5984         a new thread is created with affinity set or scheduling parameters,
5985         start thread with CLONE_STOPPED.
5986         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
5987         pthread_attr_setaffinity.
5988         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5989         cpuset element.
5990
5991 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
5992
5993         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
5994
5995 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
5996
5997         * sysdeps/pthread/configure.in: Require CFI directives also for
5998         ppc and s390.
5999
6000 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6001
6002         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6003         Add cfi directives.
6004
6005 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6006
6007         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6008         CLEANUP_JMP_BUF.
6009         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6010         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6011         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6012         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6013         not self pointer in __writer.  Compare with TID to determine
6014         deadlocks.
6015         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6016         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6017         Likewise.
6018         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6019         Likewise.
6020         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6021         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6022         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6023         macros also when compiling librt.
6024
6025 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6026
6027         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6028         -fasynchronous-unwind-tables.
6029         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6030         (PSEUDO): Add cfi directives.
6031         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6032         Likewise.
6033         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6034         Likewise.
6035
6036 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6037
6038         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6039         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6040         * unwind.c (__pthread_unwind_next): Add hidden_def.
6041         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6042         Likewise.
6043         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6044         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6045         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6046         Likewise.
6047         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6048         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6049         Likewise.
6050         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6051         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6052         __pthread_unregister_cancel and __pthread_unwind_next.
6053
6054 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6055
6056         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6057         different symbol for the cancellation syscall wrapper and
6058         non-cancellation syscall wrapper.
6059         (PSEUDO_END): Define.
6060
6061 2003-07-05  Richard Henderson  <rth@redhat.com>
6062
6063         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6064         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6065         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6066         return actual return value from the syscall, not 0.
6067
6068 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6069
6070         * descr.h (struct pthread): Add pid field.
6071         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6072         (__reclaim_stacks): Likewise.
6073         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6074         also check for PID of the signal source.
6075         (__pthread_initialize_minimal_internal): Also initialize pid field
6076         of initial thread's descriptor.
6077         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6078         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6079         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6080         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6081         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6082
6083 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6084
6085         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6086         Fix use of parameter.
6087         (__libc_cleanup_pop): Likewise.
6088
6089 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6090
6091         * init.c (sigcancel_handler): Change parameters to match handler
6092         for SA_SIGACTION.  Check signal number and code to recognize
6093         invalid invocations.
6094
6095 2003-07-03  Roland McGrath  <roland@redhat.com>
6096
6097         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6098         Apply sizeof (struct pthread) bias to r13 value.
6099
6100 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6101
6102         * sysdeps/pthread/configure.in: Require CFI directives.
6103
6104         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6105         definition.
6106         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6107         libpthread compilation.
6108         * unwind.c (__pthread_unwind): Add hidden_def.
6109         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6110
6111 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6112
6113         * libc-cancellation.c (__libc_cleanup_routine): Define.
6114         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6115         (__pthread_cleanup_pop): Define.
6116
6117 2003-07-01  Richard Henderson  <rth@redhat.com>
6118
6119         * sysdeps/alpha/elf/pt-initfini.c: New file.
6120         * sysdeps/alpha/pthread_spin_lock.S: New file.
6121         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6122         * sysdeps/alpha/pthreaddef.h: New file.
6123         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6124         * sysdeps/alpha/tls.h: New file.
6125         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6126         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6127         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6128         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6129         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6130         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6131         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6132         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6133         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6134         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6135
6136 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6137
6138         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6139         cleanup support and unwind info.
6140
6141 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6142
6143         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6144         Use correct cleanup handler registration.  Add unwind info.
6145         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6146         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6147         * tst-once3.c: Add cleanup handler and check it is called.
6148         * tst-once4.c: Likewise.
6149         * tst-oncex3.c: New file.
6150         * tst-oncex4.c: New file.
6151         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6152
6153 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6154
6155         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6156
6157 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6158
6159         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6160         (tf_msgsnd): Likewise.
6161
6162         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6163         premature returns a bit more.
6164
6165 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6166
6167         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6168         definition to the front.
6169
6170         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6171         the cleanup functions to make the names unique.  Fix dwarf opcode
6172         un unwind table.
6173         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6174         functions to make the names unique.  Fix CFA offset for two blocks.
6175
6176 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6177
6178         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6179         missing closing braces.
6180         Patch by Christophe Saout <christophe@saout.de>.
6181
6182 2003-06-24  Roland McGrath  <roland@redhat.com>
6183
6184         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6185
6186 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6187
6188         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6189         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6190
6191         * pthreadP.h: Declare __find_thread_by_id.
6192         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6193         * pthread_clock_gettime.c: Allow using other thread's clock.
6194         * pthread_clock_settime.c: Likewise.
6195         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6196         * Makefile: Add rules to build and run tst-clock2.
6197         * tst-clock2.c: New file.
6198
6199 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6200
6201         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6202         to use exception-based cleanup handler.
6203         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6204
6205         * tst-cond8.c (ch): Announce that we are done.
6206
6207         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6208
6209         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6210         Also test aio_suspend with timeout value.
6211
6212 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6213
6214         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6215         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6216         attribute_hidden.
6217
6218         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6219         (__pthread_mutex_lock_internal): Likewise.
6220         (__pthread_mutex_unlock_internal): Likewise.
6221         (__pthread_mutex_unlock_usercnt): Declare.
6222         * pthread_mutex_destroy.c: Always fail if used in any way.
6223         * pthread_mutex_init.c: Update comment.
6224         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6225         * pthread_mutex_timedlock.c: Adjust __nusers.
6226         * pthread_mutex_trylock.c: Adjust __nusers.
6227         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6228         and public interfaces are wrapper with pass additional parameter.
6229         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6230         parameter zero.
6231         * tst-mutex8.c: New file.
6232         * Makefile (tests): Add tst-mutex8.
6233         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6234         __pthread_mutex_unlock_usercnt.
6235         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6236         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6237         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6238         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6239         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6240         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6241         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6242         Add __nusers.
6243         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6244         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6245         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6246         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6247         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6248
6249         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6250         * pthread_mutex_timedlock.c: Likewise.
6251         * pthread_mutex_trylock.c: Adjust __nusers.
6252         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6253         * tst-mutex9.c: New file.
6254         * Makefile (tests): Add tst-mutex9.
6255         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6256         * sysdeps/ia64/tls.h: Likewise.
6257         * sysdeps/powerpc/tls.h: Likewise.
6258         * sysdeps/s390/tls.h: Likewise.
6259         * sysdeps/sh/tls.h: Likewise.
6260         * sysdeps/x86_64/tls.h: Likewise.
6261         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6262         Change type of __owner.
6263         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6264         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6265         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6266         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6267         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6268
6269 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6270
6271         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6272         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6273
6274         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6275         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6276         instead of nr to lll_futex_wake.  Only set errno and return -1
6277         if err < 0.
6278
6279         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6280         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6281         return actual return value from the syscall, not 0.
6282
6283 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6284
6285         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6286         find a random value.
6287         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6288         errno==EIDRM.
6289
6290         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6291         compat_timer_settime.
6292         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6293         compat_timer_gettime.
6294         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6295         compat_timer_getoverrun.
6296         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6297         compat_timer_delete.
6298
6299         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6300         error-checking mutex detect busy mutexes.
6301
6302 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6303
6304         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6305         Add ax to clobber list.
6306         (lll_mutex_cond_lock): Likewise.
6307         (lll_mutex_unlock): Likewise.
6308         (lll_lock): Likewise.
6309         (lll_unlock): Likewise.
6310
6311         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6312         * tst-cancel18.c: New file.
6313         * tst-cancelx18.c: New file.
6314
6315         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6316         and tcdrain.
6317
6318         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6319         * tst-cancel17.c: New file.
6320         * tst-cancelx17.c: New file.
6321
6322         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6323         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6324         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6325
6326         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6327
6328 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6329
6330         * sysdeps/pthread/createthread.c (create_thread): Set
6331         header.multiple_threads unconditionally.
6332         * allocatestack.c (allocate_stack): Likewise.
6333         * descr.h (struct pthread): Add header.multiple_threads
6334         unconditionally.
6335         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6336         Define for librt.  #error if neither libpthread, libc nor librt.
6337         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6338         Likewise.
6339         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6340         CDISABLE): Likewise.
6341         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6342         CDISABLE): Likewise.
6343         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6344         CDISABLE): Likewise.
6345         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6346         CDISABLE): Likewise.  Access header.multiple_threads outside of
6347         libc and libpthread.
6348         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6349         Likewise.
6350         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6351         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6352
6353 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6354
6355         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6356         Also test early cancellation before the thread reaches the cancellation
6357         point.
6358
6359         * Makefile: Compile forward.c with exceptions.
6360
6361         * sysdeps/unix/sysv/linux/sleep.c: New file.
6362
6363 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6364
6365         * Makefile: Add CFLAGS definition to compile function wrappers
6366         duplicated from libc with exceptions.
6367         * tst-cancel4.c: Also check cancellation handlers.
6368
6369         * Makefile: Add rules to build and run tst-cancel16 and
6370         tst-cancelx16.  Add missing CFLAGS definitions.
6371         * tst-cancel16.c: New file.
6372         * tst-cancelx16.c: New file.
6373
6374 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6375
6376         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6377         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6378         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6379         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6380
6381         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6382         (LIBC_CANCEL_RESET): Likewise.
6383         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6384         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6385         librt-cancellation.
6386         (CFLAGS-libcrt-cancellation.c): Define.
6387         * sysdeps/pthread/librt-cancellation.c: New file.
6388         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6389         macros also when compiling librt.
6390         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6391         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6392         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6393         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6394         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6395         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6396         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6397
6398         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6399         compat_timer_create.
6400
6401 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6402
6403         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6404
6405         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6406         __register_atfork.
6407         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6408         Add libc_hidden_def.
6409
6410 2003-06-13  Roland McGrath  <roland@redhat.com>
6411
6412         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6413         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6414
6415 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6416
6417         * allocatestack.c (queue_stack): Always inline.
6418         * ptreadhP.h (__do_cancel): Likewise.
6419
6420 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6421
6422         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6423         a typo.
6424
6425 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6426
6427         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6428         (__pthread_cond_signal): Remove incorrect second addition for
6429         cond_lock!=0.
6430
6431 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6432
6433         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6434         (__pthread_cond_signal): Use correct futex pointer in
6435         __lll_mutex_lock_wait call.
6436
6437         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6438         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6439
6440 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6441
6442         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6443         cancelable.
6444         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6445         Likewise.
6446
6447         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6448         hand-written CFI generation code.  Since ENTRY/END also initiated
6449         CFI frames this caused two CFI sets to be generated.
6450
6451 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6452
6453         * cleanup_routine.c: New file.
6454         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6455         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6456         cleanup handling.
6457         * Makefile (libpthread-routines): Add cleanup_routine.
6458         Add more CFLAGS variables to compile with exceptions.  Add comments
6459         why which file needs unwind tables.
6460         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6461         tests.
6462         * tst-cancelx1.c: New file.
6463         * tst-cancelx2.c: New file.
6464         * tst-cancelx3.c: New file.
6465         * tst-cancelx4.c: New file.
6466         * tst-cancelx5.c: New file.
6467         * tst-cancelx6.c: New file.
6468         * tst-cancelx7.c: New file.
6469         * tst-cancelx8.c: New file.
6470         * tst-cancelx9.c: New file.
6471         * tst-cancelx10.c: New file.
6472         * tst-cancelx11.c: New file.
6473         * tst-cancelx12.c: New file.
6474         * tst-cancelx13.c: New file.
6475         * tst-cancelx14.c: New file.
6476         * tst-cancelx15.c: New file.
6477         * tst-cleanupx0.c: New file.
6478         * tst-cleanupx0.expect: New file.
6479         * tst-cleanupx1.c: New file.
6480         * tst-cleanupx2.c: New file.
6481         * tst-cleanupx3.c: New file.
6482
6483         * tst-cleanup0.c: Make standard compliant.
6484         * tst-cleanup1.c: Likewise.
6485
6486         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6487         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6488         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6489         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6490         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6491         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6492         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6493         CLEANUP_JMP_BUF.
6494         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6495         * tst-cancel12.c: New file.
6496         * tst-cancel13.c: New file.
6497         * tst-cancel14.c: New file.
6498         * tst-cancel15.c: New file.
6499         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6500         and tst-cancel15.
6501
6502         * tst-cancel1.c: Add some comments.
6503
6504         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6505         timeout correctly.
6506
6507 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6508
6509         * Makefile (CFLAGS-pthread_cancel.c): Define.
6510
6511 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6512
6513         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6514         Change type of __writer element to int.
6515         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6516         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6517         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6518         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6519         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6520         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6521         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6522         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6523         Compare with TID to determine deadlocks.
6524         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6525         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6526         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6527         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6528         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6529         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6530         Likewise.
6531         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6532         Likewise.
6533         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6534         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6535         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6536         Likewise.
6537         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6538         Likewise.
6539         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6540         * Makefile (tests): Add tst-rwlock12.
6541         * tst-rwlock12.c: New file.
6542
6543 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6544
6545         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6546         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6547         Remove bogus hidden_proto.
6548         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6549         Likewise.
6550         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6551         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6552         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6553         ___lll_mutex_timedlock): Likewise.
6554
6555 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6556
6557         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6558         (__pthread_cond_signal): Add some code to eventually handle
6559         cond_lock!=0.
6560
6561 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6562
6563         * Makefile (tests): Add tst-exec4.
6564         (tst-exec4-ARGS): Define.
6565         * tst-exec4.c: New file.
6566
6567 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6568
6569         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6570         Also fail if tv_nsec < 0.
6571         (__lll_timedwait_tid): Likewise.
6572         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6573         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6574         Likewise.
6575         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6576         Likewise.
6577         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6578         Likewise.
6579         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6580         Likewise.
6581         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6582         Likewise.
6583         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6584         Likewise.
6585
6586         * Makefile (tests): Add tst-sem8 and tst-sem9.
6587         * tst-sem8.c: New file.
6588         * tst-sem9.c: New file.
6589         * sem_open.c: Fix creation of in_use record if the file exists but
6590         no internal record.
6591
6592         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6593         definitions.
6594
6595         * sysdeps/pthread/timer_create.c (timer_create): In case
6596         evp==NULL, assign timer ID to sival_ptr.
6597
6598         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6599         struct pthread_unwind_buf *.
6600         (struct pthread): Likewise for cleanup_jmp_buf element.
6601
6602         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6603         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6604         * unwind.c (__pthread_unwind_next): Likewise.
6605
6606 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6607
6608         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6609         (lll_futex_timed_wait): Use int for futex value parameter.
6610         (lll_futex_wake): Likewise.
6611         (lll_futex_requeue): Likewise.
6612
6613         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6614         Replace one memory operation with one register operation.
6615
6616         * tst-join4.c (do_test): Fix error message.
6617
6618         * tst-rwlock6.c (do_test): Use correct format specifier.
6619
6620         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6621         (__lll_mutex_lock_wait): Replace one memory operation with one
6622         register operation.
6623         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6624         (__lll_mutex_lock_wait): Likewise.
6625
6626         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6627         (__lll_mutex_cond_lock): Add one to value parameter of
6628         __lll_lock_wait to reflect reality in the futex syscall.
6629         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6630         (lll_mutex_cond_lock): Likewise.
6631
6632 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6633
6634         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6635         New function.
6636         (lll_mutex_cond_lock): Define.
6637
6638 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6639
6640         * Makefile (tests): Add tst-signal6.
6641         * tst-signal6.c: New file.
6642
6643         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6644         (__lll_mutex_unlock_force): New function
6645         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6646
6647         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6648         (__lll_mutex_unlock_force): New function.
6649         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6650
6651         * tst-rwlock7.c (do_test): Use correct format specifier.
6652
6653         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6654         Find break parameter in correct asm argument.
6655
6656 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6657
6658         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6659         Remove out4.
6660         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6661         error occured.
6662         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6663         Add __mutex.
6664         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6665         lll_futex_requeue, lll_mutex_unlock_force): Define.
6666
6667 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6668
6669         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6670         (pthread_cond_t): Add __mutex.
6671         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6672         lll_futex_requeue, lll_mutex_unlock_force): Define.
6673
6674 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6675
6676         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6677         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6678         Add __mutex field.
6679         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6680         Define.
6681         (lll_futex_wait, lll_futex_wake): Define.
6682         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6683         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6684         FUTEX_REQUEUE instead of FUTEX_WAIT.
6685         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6686         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6687         mutex which was used in condvar structure.  Call
6688         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6689         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6690
6691         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6692         include tcb-offsets.h.  Read wakeup value in locked region.
6693         Use the value of gbr register as THREAD_ID.
6694         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6695         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6696         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6697
6698         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6699         macros.
6700
6701 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6702
6703         * sysdeps/pthread/pthread_cond_broadcast.c
6704         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6705
6706 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6707
6708         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6709         typo in register name.
6710         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6711         correctly.  Actually use requeue.  Little optimization.
6712         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6713         mutex address early.  Handle cancellation state as 32-bit value.
6714         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6715         Remove unnecessary label.
6716
6717 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6718
6719         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6720         instead of FUTEX_WAIT.
6721         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6722         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6723         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6724         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6725         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6726         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6727         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6728         of __pthread_mutex_lock_internal.
6729         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6730         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6731         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6732         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6733         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6734         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6735         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6736         Add pthread_mutex_cond_lock.
6737         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6738         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6739         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6740         lll_mutex_cond_lock.
6741         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6742         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6743         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6744         Add __mutex field.
6745         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6746         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6747
6748         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6749         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6750
6751         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6752         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6753         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6754         macro don't define aliases.
6755
6756         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6757         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6758         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6759         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6760         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6761         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6762         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6763         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6764         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6765
6766 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6767
6768         * sem_open.c: Fix one endless loop.  Implement correct semantics
6769         wrt opening the same semaphore more then once.
6770         * sem_close.c: Adjust for sem_open change.
6771         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6772         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6773         * Makefile (tests): Add tst-sem7.
6774         * tst-sem7.c: New file.
6775
6776 2003-05-16  Roland McGrath  <roland@redhat.com>
6777
6778         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6779         uninitialized variable braino.
6780
6781 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6782
6783         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6784         test for syscall availability.
6785
6786         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6787         __no_posix_timers to -1 if the syscalls don't exist.
6788
6789         * pthread_join.c (pthread_join): Set tid field of the joined
6790         thread to -1.  This isn't necessary but helps to recognize some
6791         error conditions with almost no cost.
6792
6793         * allocatestack.c (FREE_P): Also negative values indicate an
6794         unused stack.
6795
6796         * unwind.c: Include <unistd.h>.
6797
6798 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6799
6800         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6801
6802 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6803
6804         * Makefile (crti-objs, crtn-objs): New variables.
6805         (omit-deps, extra-objs): Add crtn.
6806         ($(objpfx)libpthread.so): Depend on both crti and crtn
6807         and links to them in multidir.
6808         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6809
6810 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6811
6812         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6813         (lll_mutex_unlock): Use atomic_exchange_rel.
6814
6815 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6816
6817         * cond-perf.c (cons): Add missing locking around setting of alldone.
6818
6819 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6820
6821         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6822         related macros.
6823         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6824
6825 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6826
6827         * tst-sem6.c: New file.
6828         * Makefile (tests): Add tst-sem6.
6829
6830         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6831         Use atomic_exchange_rel instead of atomic_exchange.
6832         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6833         Likewise.
6834
6835         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6836         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6837         vsyscall is possible.
6838
6839         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6840         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6841         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6842         pthread_setaffinity_np.
6843         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6844         and pthread_setaffinity_np.
6845         * Makefile (libpthread-routines): Add pthread_getaffinity and
6846         pthread_setaffinity.
6847
6848         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6849         use it in case mmap to allocate the stack fails.
6850         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6851         ARCH_MAP_FLAGS here.
6852         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6853         ARCH_RETRY_MMAP.
6854
6855 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6856
6857         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6858         handler implementation.  It is now lockless in fork().
6859         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6860         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6861         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6862         declare the __fork_*_lists.
6863         (struct fork_handler): Include pointers to all three functions.
6864         Add next, refcntr and need_signal elements.
6865         (__fork_handlers): New declaration.
6866         (__register_atfork_malloc): Remove declaration.
6867         (HAVE_register_atfork_malloc): Remove definition.
6868         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
6869         __pthread_child_handler variable.
6870         (__libc_pthread_init): Use __register_atfork instead of explicitly
6871         adding to the list.
6872         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
6873         and lll_futex_wake.
6874         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6875
6876         * unwind.c (unwind_cleanup): Print error message and then abort.  This
6877         function must never be reached.
6878
6879         * cond-perf.c: New file.
6880
6881 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
6882
6883         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
6884
6885 2003-05-04  Roland McGrath  <roland@redhat.com>
6886
6887         * Makefile ($(objpfx)../libc.so): New target.
6888
6889 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
6890
6891         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6892         (pthread_condattr_t): Size is only an int, don't use long for
6893         alignment.
6894         (pthread_mutexattr_t): Likewise.
6895         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6896         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6897         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6898
6899 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
6900
6901         * sysdeps/i386/tls.h: Define THREAD_ID.
6902         * sysdeps/ia64/tls.h: Likewise.
6903         * sysdeps/powerpc/tls.h: Likewise.
6904         * sysdeps/s390/tls.h: Likewise.
6905         * sysdeps/sh/tls.h: Likewise.
6906         * sysdeps/x86_64/tls.h: Likewise.
6907         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
6908         record ownership.
6909         * pthread_mutex_timedlock.c: Likewise.
6910         * pthread_mutex_trylock.c: Likewise.
6911         * pthread_mutex_unlock.c: Likewise.
6912         * pthread_rwlock_trywrlock.c: Likewise.
6913         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
6914         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6915         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6916         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6917
6918         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
6919         flag.
6920
6921 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
6922
6923         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6924         (__SIZEOF_PTHREAD_COND_T): Define to 48.
6925         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
6926         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6927         Make __align long long instead of long.
6928         (pthread_rwlock_t): Formatting.
6929         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
6930         (pthread_rwlock_t): Formatting.
6931         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6932         (pthread_cond_t): Make __align long long instead of long.
6933         (pthread_rwlock_t): Move __flags field to the same position as in
6934         linuxthreads.
6935
6936 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
6937
6938         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
6939         * tst-rwlock7.c (do_test): Likewise.
6940
6941 2003-04-26  Roland McGrath  <roland@redhat.com>
6942
6943         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
6944
6945 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
6946
6947         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
6948         sizeof (struct pthread).
6949         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
6950         1 struct pthread.
6951         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
6952         to 0.
6953         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
6954         struct pthread.
6955         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
6956         to 32-bit bytes.
6957         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
6958         tcbp.
6959         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
6960         unneccessarily.
6961         (NO_TLS_OFFSET): Define.
6962         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
6963         add TLS_TCB_SIZE unnecessarily.
6964
6965 2003-04-22  Roland McGrath  <roland@redhat.com>
6966
6967         * Makeconfig (shared-thread-library): Reverse link order to work
6968         around linker bug.
6969
6970 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
6971
6972         * semaphore.h: Fix typo in comment.
6973
6974 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
6975
6976         * sysdeps/pthread/sigfillset.c: New file.
6977
6978         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
6979         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
6980         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
6981         * sysdeps/pthread/sigaction.c: Likewise.
6982         * sysdeps/pthread/sigprocmask.c: New file.
6983         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
6984         __SIGRTMIN+1.
6985         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
6986         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
6987         in this case.
6988
6989 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
6990
6991         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6992         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
6993
6994         * sysdeps/unix/sysv/linux/unregister-atfork.c
6995         (__unregister_atfork): Don't free memory not allocated dynamically.
6996
6997         * semaphore.h: Remove __THROW marker from cancellation points.
6998         * nptl/sysdeps/pthread/pthread.h: Likewise.
6999
7000 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7001
7002         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7003         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7004         __THROW.
7005
7006 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7007
7008         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7009
7010 2003-04-15  Roland McGrath  <roland@redhat.com>
7011
7012         * forward.c (__pthread_unwind): Tweak to avoid warning.
7013
7014 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7015
7016         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7017
7018 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7019
7020         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7021         overflow CFA advance instructions.
7022         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7023
7024 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7025
7026         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7027         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7028         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7029         defined.
7030
7031         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7032         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7033         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7034         DW_CFA_advance_loc for .Laddl-.Lsubl.
7035
7036 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7037
7038         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7039         position-independent unwind data for static libraries.
7040         Add missing unwind info.  Add comments.
7041
7042         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7043         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7044         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7045         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7046
7047 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7048
7049         * Makefile: Make sure all cancellation points are compiled with
7050         exception and asynchronous unwind tables.
7051
7052         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7053         which mishandles loading of global object addresses in PIC.
7054         (THREAD_SETMEM_NC): Likewise.
7055
7056 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7057
7058         * pthread.h: Define new data structure for cleanup buffer.  Declare
7059         new cleanup handler interfaces.
7060         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7061         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7062         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7063         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7064         it.  Declare old cleanup handler installation functions.
7065         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7066         handling.
7067         * cleanup_defer.c: Likewise.
7068         * cleanup_compat.c: New file.  Old cleanup code.
7069         * cleanup_def_compat.c: New file.  Old cleanup code.
7070         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7071         if own thread descriptor.
7072         * unwind.c: New file.
7073         * forward.c: Add __pthread_unwind.
7074         * init.c (pthread_functions): Add __pthread_unwind.
7075         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7076         Add ptr___pthread_unwind.
7077         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7078         and unwind function.
7079         * Makefile (libpthread-routines): Add cleanup_compat,
7080         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7081         table generation if necessary.
7082         * version.c: Record whether unwind support is compiled in.
7083         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7084         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7085         handler interfaces.
7086         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7087         complication to generate unwind information for syscall wrappers.
7088         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7089         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7090         __cleanup_fct_attribute.
7091
7092         * Makefile: Add rules to build and run tst-cleanup0.
7093         * tst-cleanup0.c: New file.
7094         * tst-cleanup0.expect: New file.
7095
7096         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7097         caller.  Optimize to avoid often unecessary local variable.
7098
7099 2003-04-11  Roland McGrath  <roland@redhat.com>
7100
7101         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7102         sets variable `multidir'; include that.
7103         (generated): Add it.
7104         ($(objpfx)$(multidir)/crti.o): New target.
7105         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7106
7107 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7108
7109         * tst-attr2.c (do_test): Add cast to avoid warning.
7110         * tst-mutex4.c (do_test): Likewise.
7111
7112 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7113
7114         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7115         in child.
7116
7117 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7118
7119         * Makefile (tests): Add tst-detach1.
7120         * tst-detach1.c: New file.
7121
7122 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7123
7124         * sysdeps/pthread/pthread.h: Remove duplicate
7125         pthread_cleanup_{push,pop} definitions.
7126
7127         * tst-barrier2.c: Eliminate warnings.
7128         * tst-cancel4.c: Likewise.
7129         * tst-cond4.c: Likewise.
7130         * tst-cond6.c: Likewise.
7131         * tst-detach1.c: Likewise.
7132         * tst-rwlock4.c: Likewise.
7133         * tst-rwlock6.c: Likewise.
7134         * tst-rwlock7.c: Likewise.
7135         * tst-sem3.c: Likewise.
7136         * tst-spin2.c: Likewise.
7137         * tst-umask1.c: Likewise.
7138
7139 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7140
7141         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7142
7143 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7144
7145         * descr.h (struct pthread): Move cancelhandling member to the front.
7146
7147 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7148
7149         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7150         malloc_parent, and malloc_child statically.
7151         (__register_atfork_malloc): New function.
7152         (free_mem): Don't free any of the malloc_* variables on the list.
7153         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7154         Define HAVE_register_atfork_malloc.
7155
7156 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7157
7158         * sysdeps/pthread/createthread.c (create_thread): Add some more
7159         comments explaining when to set multiple_threads and when not.
7160
7161         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7162         THREAD_ATOMIC_BIT_SET if not already defined.
7163         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7164         THREAD_ATOMIC_BIT_SET:
7165         * sysdeps/x86_64/tls.h: Likewise.
7166         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7167         THREAD_ATOMIC_CMPXCHG_VAL.
7168         (_pthread_cleanup_pop_restore): Likewise.
7169         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7170         (__pthread_enable_asynccancel_2): Likewise.
7171         (__pthread_disable_asynccancel): Likewise.
7172         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7173         (__libc_disable_asynccancel): Likewise.
7174         * init.c (sigcancel_handler): Likewise.
7175         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7176         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7177
7178 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7179
7180         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7181         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7182         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7183         * Makefile (tests): Add tst-cancel11.
7184         * tst-cancel11.c: New file.
7185
7186 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7187
7188         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7189         round, not the first.  Use specific_used flag instead of local
7190         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7191         (__free_tcb): Don't call deallocate_tsd here.
7192         (start_thread): Call deallocate_tsd here.
7193         * pthread_setspecific.c: Set specific_used flag really only when
7194         needed.
7195         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7196         * tst-tsd3.c: New file.
7197         * tst-tsd4.c: New file.
7198
7199 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7200
7201         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7202         Use atomic_exchange_and_add instead of __lll_add.
7203         (__lll_mutex_timedlock): Likewise.
7204         Patch by Ian Wienand.
7205
7206 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7207
7208         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7209         (SINGLE_THREAD_P): Fix typo.
7210         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7211
7212 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7213
7214         * Makefile (tests): Add tst-align.
7215         * tst-align.c: New file.
7216         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7217
7218         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7219         function correctly.
7220
7221         * tst-tsd2.c: Add casts to avoid warnings.
7222
7223 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7224
7225         * descr.h (struct pthread): Move most often used elements to the front.
7226
7227 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7228
7229         * Makefile (libpthread-routines): Add pthread_atfork.
7230         (libpthread-static-only-routines): Add pthread_atfork.
7231
7232 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7233
7234         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7235         of TLS_DTV_AT_TP.
7236         (INSTALL_DTV): Add parens.
7237         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7238         Use passed descr instead of THREAD_SELF.
7239         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7240         (__lll_mutex_timedlock_wait): Correct expected value after
7241         spurious wakeup.
7242         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7243         Release lock before waking up the waiters.
7244         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7245         criteria.  Reorderstruct passed to cleanup handler.  Fix
7246         handling of cancellation and failung pthread_mutex_unlock call.
7247         Use __pthread_enable_asynccancel_2 instead of
7248         __pthread_enable_asynccancel.
7249         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7250         Return result of lock re-get if it fails.
7251         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7252         for __pthread_cleanup_push.
7253         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7254         completely broken rwlock implementation.
7255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7256         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7257         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7258         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7259         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7260         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7261         versioned_symbol macro.
7262         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7263         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7264
7265 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7266
7267         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7268         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7269         and __helper_tid.
7270         (struct timer): Remove th and bar field.
7271         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7272         debugging code.  Create only one helper thread.
7273         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7274         helper thread.
7275         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7276         Renamed.  Define statically.  Use thread info from siginfo.
7277         (__helper_once): New variable.
7278         (__helper_tid): New variable.
7279         (__reset_helper_control): New function.
7280         (__start_helper_thread): New function.
7281
7282         * pthread_create.c (start_thread): Don't use setjmp inside
7283         __builtin_expect to work around gcc bug.
7284
7285         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7286         timer_delete syscall fails, but not with ENOSYS, set
7287         __no_posix_timers.
7288
7289         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7290         (timer_settime): Fix typo.
7291         * sysdeps/unix/sysv/linux/timer_getoverr.c
7292         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7293
7294 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7295
7296         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7297         offset of cleanupbuf.__prev.
7298
7299 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7300
7301         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7302         of included file.
7303
7304 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7305
7306         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7307         NULL provide default definition to syscall.
7308
7309 2003-03-25  Roland McGrath  <roland@redhat.com>
7310
7311         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7312         (timer_id2ptr): Fix typo.
7313
7314 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7315
7316         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7317         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7318         * sysdeps/ia64/pthreaddef.h: Likewise.
7319         * sysdeps/powerpc/pthreaddef.h: Likewise.
7320         * sysdeps/s390/pthreaddef.h: Likewise.
7321         * sysdeps/sh/pthreaddef.h: Likewise.
7322         * sysdeps/x86_64/pthreaddef.h: Likewise.
7323         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7324         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7325         being changed.
7326         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7327         SIGTIMER is not unblocked.
7328         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7329         RT signal taken.
7330         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7331         be send.
7332         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7333         pass pointer through as ID.
7334         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7335         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7336         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7337         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7338         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7339         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7340         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7341         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7342         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7343         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7344         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7345         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7346         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7347         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7348         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7349         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7350         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7351         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7352         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7353         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7354         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7355         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7356         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7357         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7358         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7359         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7360         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7361         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7362         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7363         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7364         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7365         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7366         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7367
7368         * pthreadP.h: Remove FRAME_LEFT definition.
7369         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7370         already left frame.  Programs which have this problem are not POSIX
7371         compliant.
7372         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7373
7374 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7375
7376         * sysdeps/pthread/tst-timer.c: Check return values of the
7377         functions we test.
7378
7379 2003-03-23  Roland McGrath  <roland@redhat.com>
7380
7381         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7382         * tst-tls3mod.c: Likewise.
7383         * tst-tls1.c: Likewise.
7384         * tst-tls2.c: Likewise.
7385
7386         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7387         undefined behavior.
7388
7389         * tst-join5.c (tf1, tf2): Add a cast.
7390
7391         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7392
7393         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7394         Don't test anything.
7395         * tst-cond4.c: Likewise.
7396         * tst-cond6.c: Likewise.
7397         * tst-flock2.c: Likewise.
7398         * tst-mutex4.c: Likewise.
7399         * tst-rwlock4.c: Likewise.
7400         * tst-signal1.c: Likewise.
7401         * tst-spin2.c: Likewise.
7402         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7403
7404         * tst-mutex4.c: Use test-skeleton.c.
7405         * tst-spin2.c: Likewise.
7406         * tst-sysconf.c: Likewise.
7407         * tst-barrier2.c: Likewise.
7408         * tst-cond4.c: Likewise.
7409         * tst-cond6.c: Likewise.
7410         * tst-rwlock4.c: Likewise.
7411         * tst-unload.c: Likewise.
7412         * tst-flock2.c (do_test): Use return instead of exit.
7413
7414 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7415
7416         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7417
7418 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7419
7420         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7421         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7422         instead of __lll_compare_and_swap.
7423         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7424         Likewise.
7425         Removed definition if __lll_compare_and_swap.
7426
7427         * cancellation.c: Adjust for new form of compare&exchange macros.
7428         * cleanup_defer.c: Likewise.
7429         * init.c: Likewise.
7430         * libc-cancellation.c: Likewise.
7431         * old_pthread_cond_broadcast.c: Likewise.
7432         * old_pthread_cond_signal.c: Likewise.
7433         * old_pthread_cond_timedwait.c: Likewise.
7434         * old_pthread_cond_wait.c: Likewise.
7435         * pthread_cancel.c: Likewise.
7436         * pthread_create.c: Likewise.
7437         * pthread_detach.c: Likewise.
7438         * pthread_join.c: Likewise.
7439         * pthread_key_delete.c: Likewise.
7440         * pthread_setcancelstate.c: Likewise.
7441         * pthread_setcanceltype.c: Likewise.
7442         * pthread_timedjoin.c: Likewise.
7443         * pthread_tryjoin.c: Likewise.
7444         * sysdeps/pthread/createthread.c: Likewise.
7445
7446 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7447
7448         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7449         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7450         definitions.  Replace uses with calls to atomic_* functions.
7451         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7452         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7453         __lll_test_and_set calls with atomic_exchange_and_add and
7454         atomic_exchange calls respectively.
7455         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7456         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7457         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7458         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7459         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7460         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7461         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7462
7463         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7464         returns the old value.
7465
7466 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7467
7468         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7469         int for variable OLDVAL and correct inline assembler contraint.
7470         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7471         type int for variable OLD.
7472
7473         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7474         only for s390-32.
7475         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7476         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7477         instead of multiple_threads field in the TCB.
7478
7479 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7480
7481         * sysdeps/i386/i686/bits/atomic.h: Removed.
7482         * sysdeps/i386/i586/bits/atomic.h: Removed.
7483         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7484         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7485         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7486         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7487         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7488         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7489         * atomic.h: Removed.  Moved to glibc.
7490
7491         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7492         support for clock selection.
7493
7494         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7495         signalling waiters.
7496
7497 2003-03-18  Roland McGrath  <roland@redhat.com>
7498
7499         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7500         Add __lll_rel_instr first.  Add memory clobber.
7501         (lll_mutex_unlock): Use __lll_test_and_set.
7502         From Paul Mackerras <paulus@samba.org>.
7503
7504         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7505         unconditionally.
7506         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7507         (SINGLE_THREAD_P):  Add `header.' prefix.
7508         From Paul Mackerras <paulus@samba.org>.
7509
7510         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7511         pthread_timedjoin_np to ...
7512         (libpthread: GLIBC_2.3.3): ... here.
7513         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7514
7515         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7516         Avoid shadowing VAL variable.
7517
7518         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7519         New macro.
7520
7521 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7522
7523         * Makefile (tests): Add tst-cond11.
7524         * tst-cond11.c: New file.
7525
7526         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7527         struct passed to cleanup handler to eliminate one more
7528         instruction.
7529         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7530
7531         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7532         (pthrad_cond_t): Replace __unused field with __clock.
7533
7534         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7535         waken all waiters in cleanup handler.
7536         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7537         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7538
7539         * pthread_condattr_getclock.c: New file.
7540         * pthread_condattr_setclock.c: New file.
7541         * sysdeps/pthread/pthread.h: Declare these new functions.
7542         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7543         * Makefile (libpthread-routines): Add the new functions.
7544         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7545         Renamed field to value.  Document use of the bits.
7546         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7547         change.
7548         * pthread_condattr_setpshared.c: Likewise.
7549         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7550         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7551         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7552         Add __clock field.
7553         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7554         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7555         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7556         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7557         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7558         Implement clock selection.
7559         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7560         * pthread-errnos.sym: Add ENOSYS.
7561         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7562         _POSIX_CLOCK_SELECTION.
7563         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7564
7565         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7566         invalid .size directive.
7567
7568 2003-03-17  Roland McGrath  <roland@redhat.com>
7569
7570         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7571         Formatting tweaks.
7572
7573 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7574
7575         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7576         Use __lll_add instead of spelling it out.  Use protected symbol names.
7577         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7578         Use __lll_add.
7579         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7580         Renamed from lll_compare_and_swap.  Use new name where necessary.
7581         (__lll_add): Defined.
7582         (__lll_dec_if_positive): Defined.
7583         (__lll_test_and_set): Defined.
7584         * sysdeps/ia64/pthread_spin_init.c: Removed.
7585         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7586         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7587         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7588         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7589         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7590         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7591         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7592         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7593         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7594         __sync_lock_release_si.
7595         Patch by Jakub Jelinek.
7596
7597         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7598         Fix timeout handling.
7599         (__lll_timedwait_tid): Likewise.
7600         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7601         Patch by Jakub Jelinek.
7602
7603         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7604
7605 2003-03-17  Roland McGrath  <roland@redhat.com>
7606
7607         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7608         * sysdeps/pthread/pthread_spin_init.c: New file.
7609         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7610         * sysdeps/powerpc/Makefile: New file.
7611         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7612         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7613         * sysdeps/powerpc/pthreaddef.h: New file.
7614         * sysdeps/powerpc/tcb-offsets.sym: New file.
7615         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7616         * sysdeps/powerpc/tls.h: New file.
7617         * sysdeps/powerpc/bits/atomic.h: New file.
7618         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7619         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7620         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7621
7622         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7623         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7624         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7625         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7626         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7627         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7628         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7629         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7630         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7631         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7632         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7633         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7634         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7635         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7636         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7637
7638         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7639         not gettimeofday.
7640         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7641         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7642         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7643         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7644         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7645
7646 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7647
7648         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7649         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7650         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7651         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7652         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7653
7654 2003-03-16  Roland McGrath  <roland@redhat.com>
7655
7656         * tst-fork4.c: Include <string.h>.
7657         * tst-signal2.c: Likewise.
7658         * tst-mutex5.c (do_test): exit -> return.
7659         * tst-mutex2.c: Include <stdlib.h>.
7660
7661 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7662
7663         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7664         (__lll_mutex_timedlock_wait): Correct expected value after
7665         spurious wakeup.  Otherwise we would never wait again.
7666
7667         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7668         zone versus inline asm stupidity.  Use correct instructions.
7669
7670         * tst-rwlock6.c: Add some more status output.
7671
7672 2003-03-15  Roland McGrath  <roland@redhat.com>
7673
7674         * sysdeps/pthread/configure.in: New file.
7675         * sysdeps/pthread/configure: New file (generated).
7676
7677 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7678
7679         * allocatestack.c (allocate_stack): Store the exact stack size of
7680         user allocated stacks.
7681
7682 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7683
7684         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7685         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7686         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7687         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7688         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7689         Use `header.' prefix.
7690         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7691
7692 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7693
7694         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7695         __builtin_frame_address, use stack pointer.
7696
7697         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7698         instead of __builtin_frame_pointer.
7699
7700 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7701
7702         * tst-basic1.c (do_test): Add cast to avoid warning.
7703         * tst-basic2.c (do_test): Likewise.
7704
7705         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7706         amount of stack correction.
7707
7708         * tst-fork4.c: Use test-skeleton.c.
7709
7710 2003-03-14  Roland McGrath  <roland@redhat.com>
7711
7712         * init.c: Fix typo "#eli" for "#else".
7713
7714 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7715
7716         * allocatestack.c (__stack_user): Use hidden_data_def.
7717         * pthread_create.c (__pthread_keys): Likewise.
7718
7719         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7720
7721 2003-03-14  Roland McGrath  <roland@redhat.com>
7722
7723         * tst-fork4.c: New file.
7724         * Makefile (tests): Add it.
7725
7726         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7727         we always define the padding space.
7728         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7729         stopped supporting its own extensions fully.
7730         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7731         struct also called `header', so `header.multiple_threads' is the field
7732         name to use on all machines.
7733         * allocatestack.c (allocate_stack): Use `header.' prefix.
7734         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7735         * pthread_create.c (__pthread_create_2_1): Likewise.
7736         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7737         (THREAD_SELF): Likewise.
7738         * sysdeps/x86_64/tls.h: Likewise.
7739         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7740         (SINGLE_THREAD_P): Likewise.
7741         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7742         (SINGLE_THREAD_P): Likewise.
7743         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7744         (SINGLE_THREAD_P): Likewise.
7745
7746         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7747         value directly.
7748
7749 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7750
7751         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7752         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7753
7754         * pthread_create.c (start_thread): setjmp is expected to return 0.
7755
7756         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7757         (THREAD_GETMEM_NC): Likewise.
7758
7759 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7760
7761         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7762         and the size of the stack which must be allocated is a multiple,
7763         allocate one more page.
7764         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7765         MULTI_PAGE_ALIASING.
7766
7767 2003-03-13  Roland McGrath  <roland@redhat.com>
7768
7769         * pthread_create.c (start_thread): Set EXITING_BIT after the
7770         event-reporting (and destructors), not before.
7771
7772 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7773
7774         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7775         lll_futex_wake): Declare register variables as long int instead of
7776         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7777         Make syscall arguments clobbered by the syscall.
7778         (lll_futex_wait): Define using lll_futex_timed_wait.
7779
7780         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7781         to void *.
7782
7783         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7784         PPID if [! NDEBUG].
7785
7786         * allocatestack.c (nptl_ncreated): Only declare if
7787         COLORING_INCREMENT != 0.
7788
7789         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7790         (__libc_enable_asynccancel_2): Remove prototype.
7791
7792         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7793         ctid to match kernel.
7794
7795 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7796
7797         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7798         libc_multiple_threads.
7799         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7800         __libc_multiple_threads to...
7801         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7802
7803         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7804         versioning.
7805         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7806         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7807
7808         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7809         (__pthread_once_internal): Define.
7810
7811         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7812         macros instead of .symver directly.
7813         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7814         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7815
7816         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7817         * sysdeps/x86_64/tcb-offsets.sym: New file.
7818         * sysdeps/x86_64/Makefile: New file.
7819
7820         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7821         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7822         to access own pthread_t in TCB.
7823         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7824         Likewise.
7825         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7826         Likewise.
7827         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7828
7829 2003-03-12  Roland McGrath  <roland@redhat.com>
7830
7831         * pthread-errnos.sym: New file.
7832         * Makefile (gen-as-const-headers): New variable, list that file.
7833         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7834         header <pthread-errnos.h> instead of defining errno values here.
7835         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7836         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7837         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7838         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7839         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7840         Likewise.
7841         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7842         Likewise.
7843         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7844         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7845         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7846         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7847         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7848         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7849         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7850         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7851         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7852         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7853         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7854         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7855         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7856         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7857         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7858         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7859         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7860         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7861         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7862         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7863         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7864         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7865         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
7866         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
7867         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
7868         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7869         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7870
7871         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
7872         CLONE_CHILD_SETTID worked.
7873
7874 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7875
7876         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
7877         file.
7878         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
7879         file.
7880
7881         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7882         (pthread_cond_t): Add padding.
7883
7884         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
7885         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
7886         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
7887
7888         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
7889         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
7890         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
7891         (__pthread_rwlock_timedrdlock): Likewise.
7892         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
7893         (__pthread_rwlock_wrlock): Likewise.
7894         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
7895         (__pthread_rwlock_rdlock): Likewise.
7896
7897         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
7898
7899         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
7900         result of lock re-get if it fails.
7901
7902 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7903
7904         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
7905         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7906         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7907         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7908         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7909         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7910         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7911         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7912         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7913         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7914
7915         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
7916         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
7917
7918         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
7919         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
7920         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
7921         (create_thread): Likewise.
7922         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
7923         * init.c (__pthread_initialize_minimal_internal): Initialize
7924         __libc_multiple_threads_ptr if necessary.
7925         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
7926         __pthread_multiple_threads and __libc_multiple_threads_ptr.
7927         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
7928         __libc_multiple_threads.
7929         (__libc_pthread_init): Return pointer to __libc_pthread_init if
7930         necessary.
7931
7932         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
7933         (THREAD_SETMEM_NC): Likewise.
7934
7935         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
7936         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
7937         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
7938         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
7939
7940         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
7941         Eliminate one entire instruction.
7942
7943         * cancellation.c (__pthread_enable_asynccancel_2): New function.
7944         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
7945         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7946         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
7947         instead of __pthread_enable_asynccancel.
7948         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7949         (__pthread_cond_wait): Likewise.
7950         * sysdeps/pthread/pthread_cond_timedwait.c
7951         (__pthread_cond_timedwait): Likewise.
7952         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
7953
7954         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7955         (__condvar_cleanup): Wake up all waiters in case we got signaled
7956         after being woken up but before disabling asynchronous
7957         cancellation.
7958         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
7959         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
7960         (__condvar_cleanup): Likewise.
7961
7962         * init.c (__NR_set_tid_address): If already defined, don't redefine.
7963         Make it an error if architecture has no #if case.  Add x86-64.
7964
7965         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
7966         pt-initfini.s generation.
7967
7968         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
7969         (TLS_INIT_TP): Fix typo.
7970
7971 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
7972
7973         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
7974         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
7975
7976         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
7977         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7978         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
7979         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
7980         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
7981         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7982         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
7983         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
7984
7985 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7986
7987         * sysdeps/pthread/pthread_cond_timedwait.c
7988         (__pthread_cond_timedwait): Return the result of the final
7989         locking.  If it succeeds, the regular function return value.
7990
7991         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
7992         Return result of the final locking.
7993         * version.c (__nptl_main): Work around problems with the strange
7994         INTERNAL_SYSCALL macro on ppc32.
7995         * init.c (__pthread_initialize_minimal_internal): Unblock
7996         SIGCANCEL in case the parent blocked it.
7997         Reported by Paul Mackerras <paulus@samba.org>.
7998
7999         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8000         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8001         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8002
8003 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8004
8005         * sysdeps/pthread/pthread_cond_timedwait.c
8006         (__pthread_cond_timedwait): Unlock and fail if
8007         __pthread_mutex_unlock_internal failed.
8008
8009         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8010         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8011         Use ARCH_CLONE.
8012         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8013         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8014         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8015         ALLOCATE_STACK): New macros.
8016         (TLS_TPADJ): New macro.
8017         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8018         (allocate_stack): Handle TLS_DTV_AT_TP and
8019         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8020         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8021         Don't set PD->self.
8022         * init.c [__ia64__] (__NR_set_tid_address): Define.
8023
8024         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8025         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8026         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8027         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8028         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8029         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8030         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8031         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8032         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8033         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8034         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8035         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8036         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8037         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8038         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8039         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8040         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8041         * sysdeps/ia64/bits/atomic.h: New file.
8042         * sysdeps/ia64/Makefile: New file.
8043         * sysdeps/ia64/pthread_spin_init.c: New file.
8044         * sysdeps/ia64/pthread_spin_lock.c: New file.
8045         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8046         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8047         * sysdeps/ia64/pthreaddef.h: New file.
8048         * sysdeps/ia64/tcb-offsets.sym: New file.
8049         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8050         * sysdeps/ia64/tls.h: New file.
8051
8052         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8053         to syscall instead of no arguments.
8054
8055 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8056
8057         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8058         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8059         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8060         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8061
8062         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8063         unused code.
8064
8065         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8066
8067         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8068         lowlevelbarrier.sym.
8069         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8070         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8071         Include lowlevelbarrier.h and don't define offsets locally.
8072         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8073
8074         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8075         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8076         (__lll_mutex_timedlock_wait): Likewise.
8077         (lll_mutex_lock): Adjust asm for that.
8078         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8079         (lll_lock): Adjust asm for operand order change.
8080         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8081         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8082
8083         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8084         Reverse order of parameters.
8085         (__lll_timedwait_tid): Remove regparms attribute.
8086         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8087         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8088
8089         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8090         (__lll_timedwait_tid): Remove one unnecessary instruction.
8091
8092         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8093         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8094         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8095         lowlevelmutex.S.
8096
8097         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8098         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8099         for NOT_IN_libc.
8100         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8101         lowlevellock.S.
8102
8103         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8104         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8105         for libc.so.
8106         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8107         define LOCK here (if UP is not defined).  The actual code is in
8108         lowlevelmutex.S.
8109
8110         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8111         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8112         __lll_timedwait_tid for libc.so.
8113         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8114         define LOCK here (if UP is not defined).  The actual code is in
8115         lowlevellock.S.
8116
8117         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8118         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8119         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8120         instead of lowlevelsem.h.
8121         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8122         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8123         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8124
8125         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8126         lowlevelrwlock.sym.
8127         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8128         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8129         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8130
8131         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8132         register loading.
8133         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8134         last changed.  D'oh.
8135
8136         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8137
8138         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8139         of __libc_locking_needed.
8140         (lll_trylock): Initialize %eax to zero.
8141
8142         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8143         pthread_cond_t definition.
8144
8145 2003-03-10  Roland McGrath  <roland@redhat.com>
8146
8147         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8148         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8149         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8150         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8151         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8152
8153         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8154         Instead of setting PD->multiple_threads, set globals
8155         __pthread_multiple_threads and __libc_multiple_threads.
8156         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8157         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8158         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8159
8160         * descr.h (struct pthread): Conditionalize first member on
8161         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8162         containing an anonymous tcbhead_t.  Move `list' member out.
8163         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8164         * allocatestack.c: Remove use of `header.data.' prefix.
8165         * pthread_create.c: Likewise.
8166         * init.c (__pthread_initialize_minimal_internal): Likewise.
8167         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8168         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8169         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8170         * sysdeps/x86_64/tls.h: Likewise.
8171         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8172         (SINGLE_THREAD_P): Likewise.
8173         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8174         (SINGLE_THREAD_P): Likewise.
8175         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8176         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8177
8178 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8179
8180         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8181
8182         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8183         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8184
8185         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8186         leftovers from the ia32 code.
8187
8188         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8189         memory load.
8190         (clear_once_control): Don't load %esi.
8191
8192         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8193         handling.
8194
8195         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8196
8197         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8198         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8199
8200         * Makefile (tests): Add tst-cond10.
8201         * tst-cond10.c: New file.
8202
8203 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8204
8205         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8206         * tst-signal3.c (do_test): Likewise.
8207         * tst-sem5.c (do_test): Likewise.
8208         * tst-kill6.c (do_test): Likewise.
8209         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8210
8211         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8212         of inc/dec.
8213         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8214         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8215         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8216         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8218         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8220         Likewise.
8221         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8222         Likewise.
8223         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8224         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8225         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8226         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8227         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8228         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8229         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8230         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8231
8232         * allocatestack.c (allocate_stack): If mprotect() fails free the
8233         TLS memory.
8234
8235 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8236
8237         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8238
8239         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8240         lll_wake_tid.  This was used only to work around kernel limits in
8241         the early days.
8242         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8243         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8244         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8245         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8246
8247         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8248         (__pthread_initialize_minimal_internal): Change initialization of
8249         __static_tls_align_m1 appropriately.
8250         * pthreadP.h (__static_tls_align_m1): Renamed from
8251         __static_tls_align.
8252         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8253         instead of __static_tls_align-1.
8254
8255 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8256
8257         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8258
8259         * pthread_create.c: Define __pthread_keys using nocommon
8260         attribute, not by placing it explicitly in bss.
8261         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8262
8263         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8264         Use it in mmap call to allocate stacks.
8265
8266         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8267
8268         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8269         result of the thread function.
8270
8271 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8272
8273         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8274         version is just fine.
8275
8276         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8277         (__pthread_child_handler): Renamed from pthread_child_handler,
8278         exported, and marked hidden.  Change all users.
8279         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8280         free __pthread_child_handler from child list.
8281
8282 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8283
8284         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8285
8286         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8287         Fix handling of cancellation and failing pthread_mutex_unlock call.
8288         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8289         (__pthread_cond_wait): Likewise.
8290
8291         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8292         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8293         lll_futex_timed_wait call.
8294         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8295         (pthread_rwlock_timedwrlock): Likewise.
8296
8297         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8298         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8299         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8300
8301         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8302         check of lll_futex_wake return value.
8303
8304 2003-03-03  Roland McGrath  <roland@redhat.com>
8305
8306         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8307
8308         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8309         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8310         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8311
8312 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8313
8314         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8315         error for CPU clocks.
8316
8317         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8318         _POSIX_MONOTONIC_CLOCK.
8319         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8320
8321         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8322         recent kernels.
8323
8324 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8325
8326         * descr.h (struct pthread): Move cleanup field to the front.
8327
8328 2003-03-01  Roland McGrath  <roland@redhat.com>
8329
8330         * sem_open.c (sem_open): Braino fix.
8331
8332 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8333
8334         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8335         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8336         __pthread_cleanup_pop functionality.
8337         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8338
8339         * descr.h (struct pthread): Move tid field to the front now that
8340         it is often used.
8341
8342         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8343         (__lll_mutex_timedlock_wait): Remove.
8344         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8345         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8346         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8347         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8348         (lll_unlock_wake_cb): Don't save and restore %esi.
8349         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8350         %esi.
8351         (__lll_timedwait_tid): Add alignment.
8352         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8353         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8354         %esi.
8355         (__lll_timedwait_tid): Removed.
8356         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8357         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8358         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8359         (pthread_barrier_wait): Don't save, load, and restore %esi for
8360         last thread.
8361         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8362         (__pthread_cond_signal): Don't save, load, and restore %esi.
8363         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8364         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8365         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8366         Don't save, load, and restore %esi.
8367
8368 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8369
8370         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8371         Release lock before waking up the waiters.
8372
8373         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8374
8375         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8376         (reader_thread): Likewise.
8377
8378         * sysdeps/pthread/pthread_rwlock_unlock.c
8379         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8380         to wake up readers if there are none.
8381
8382         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8383         Release internal lock before wake threads.
8384
8385 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8386
8387         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8388         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8389         predefined.
8390         * tst-rwlock9.c: Likewise.
8391         * tst-rwlock10.c: New file.
8392         * tst-rwlock11.c: New file.
8393
8394         * Makefile (tests): Add tst-dlsym1.
8395         * tst-dlsym1.c: New file.
8396
8397         * init.c (__pthread_initialize_minimal_internal): Set
8398         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8399         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8400
8401 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8402
8403         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8404
8405         * tst-cond2.c: Fix sychronization with child.
8406
8407         * tst-rwlock8.c (reader_thread): Remove unused variable.
8408
8409         * Makefile: Add rules to build and run tst-tls3.
8410         * tst-tls3.c: New file.
8411         * tst-tls3mod.c: New file.
8412
8413         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8414         * tst-rwlock8.c: New file.
8415         * tst-rwlock9.c: New file.
8416         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8417         complete broken rwlock implementation.
8418         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8419         Likewise.
8420         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8421         Likewise.
8422         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8423         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8424         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8425         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8426         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8427         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8428         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8429
8430 2003-02-23  Roland McGrath  <roland@redhat.com>
8431
8432         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8433
8434 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8435
8436         * Makefile (tests): Add tst-context1.
8437         * tst-context1.c: New file.
8438
8439         * Makefile (tests): Add tst-tls1 and tst-tls2.
8440         * tst-tls1.c: New file.
8441         * tst-tls2.c: New file.
8442
8443         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8444         for failed cmpxchg.
8445
8446         * pthread_create.c (start_thread): Set EXITING_BIT early.
8447
8448         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8449         (THREAD_GETMEM_NC): Likewise.
8450
8451 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8452
8453         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8454         off 3 more bytes by using offset-less instructions when possible.
8455
8456         * Makefile: Add dependency for $(objpfx)version.d.
8457
8458         * eintr.c (eintr_source): Add unnecessary return but the compiler
8459         insists.
8460
8461         * tst-kill3.c: Include <unistd.h>.
8462
8463 2003-02-21  Roland McGrath  <roland@redhat.com>
8464
8465         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8466
8467 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8468
8469         * Makefile (tests): Add tst-eintr1.
8470         (distribute): Add eintr.c.
8471         * tst-eintr1.c: New file.
8472         * eintr.c: New file.
8473
8474         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8475
8476         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8477         Disallow sending SIGCANCEL.
8478
8479         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8480         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8481         * tst-kill1.c: New file.
8482         * tst-kill2.c: New file.
8483         * tst-kill3.c: New file.
8484         * tst-kill5.c: New file.
8485         * tst-kill6.c: New file.
8486         * tst-basic7.c: Renamed to...
8487         * tst-kill4.c: ...this.
8488
8489 2003-02-21  Roland McGrath  <roland@redhat.com>
8490
8491         * Makefile (install-lib-ldscripts): New variable.
8492
8493 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8494
8495         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8496         * pthread_cancel.c: Use INVALID_TD_P.
8497         * pthread_detach.c: Likewise.
8498         * pthread_getschedparam.c: Likewise.
8499         * pthread_setschedparam.c: Likewise.
8500         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8501         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8502         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8503         * pthread_timedjoin.c: Likewise.
8504
8505         * tst-basic7.c: Include <signal.h>.
8506
8507         * pthread_join.c (pthread_join): Limited checking for invalid
8508         descriptors.
8509         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8510
8511 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8512
8513         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8514         beginning of the loop.  Clear the entire first block of TSD.
8515         * Makefile (tests): Add tst-key4.
8516         * tst-key4.c: New file.
8517
8518 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8519
8520         * Makefile (tests): Add tst-basic7.
8521         * tst-basic7.c: New file.
8522
8523         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8524         Add some more __builtin_expect.
8525
8526         * pthreadP.h: Define dummy version of DEBUGGING_P.
8527
8528 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8529
8530         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8531         _POSIX_THREAD_PRIORITY_SCHEDULING.
8532         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8533         _XOPEN_REALTIME_THREADS.
8534         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8535
8536         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8537         kernel returns EINVAL for PID <= 0, work around it.
8538
8539         * Makefile (tests): Add tst-signal5.
8540         * tst-signal5.c: New file.
8541
8542         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8543         and LOGIN_NAME_MAX.
8544
8545         * tst-cancel1.c (tf): Block all signals.
8546
8547         * Makefile (tests): Add tst-basic6.
8548         * tst-basic6.c: New file.
8549
8550         * tst-basic1.c: Add test for process ID.
8551
8552         * Makefile (tests): Add tst-cancel10.
8553         * tst-cancel10.c: New file.
8554
8555         * Makefile (tests): Add tst-signal4.
8556         * tst-signal4.c: New file.
8557
8558         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8559         __sigismember instead of sigismember.  Add __builtin_expect.
8560
8561 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8562
8563         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8564         pthread_setcancelstate, and pthread_rwlock_setpshared.
8565
8566         * tst-cancel7.c (do_test): Make sure the pid file exists before
8567         canceling the thread.
8568
8569         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8570         pthread_rwlock_timedrdlock tests.
8571         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8572         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8573         Check for invalid tv_nsec field.
8574         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8575         Likewise.
8576
8577         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8578         recursive mutex of overflow.
8579
8580         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8581
8582         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8583         going into an endless loop.
8584         * Makefile (tests): Add tst-cancel9.
8585         * tst-cancel9.c: New file.
8586
8587         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8588
8589 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8590
8591         * tst-mutex5.c (do_test): Add more timedlock tests.
8592
8593         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8594         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8595
8596         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8597         use INLINE_SYSCALL.  Error number is returned, not -1.
8598
8599         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8600         and __deallocate_stack with internal_function.
8601         * pthread_create.c: Adjust definitions appropriately.
8602         * allocatestack.c: Likewise.
8603
8604         * pthread_join.c: Add one more __builtin_expect.
8605         * pthread_timedjoin.c: Likewise.
8606
8607         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8608         not data of sequence number does not match.
8609         Add one __builtin_expect.
8610
8611         * Makefile (tests): Add tst-clock1.
8612         * tst-clock1.c: New file.
8613
8614         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8615         negative arguments.
8616         * Makefile (tests): Add tst-basic5.
8617         * tst-basic5.c: New file.
8618
8619 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8620
8621         * Makefile (tests): Add tst-basic4.
8622         * tst-basic4.c: New file.
8623
8624         * pthreadP.h: Add declaraction for __nptl_nthreads.
8625         * pthread_create.c: Define __nptl_nthreads
8626         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8627         after thread is done.  If then zero, call exit(0).
8628         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8629         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8630         * init.c (pthread_functions): Initialize ptr_nthreads.
8631         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8632         (__reclaim_stacks): Decrement __nptl_nthreads.
8633         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8634         Define.
8635         * Makefile (tests): Add tst-basic3.
8636         * tst-basic3.c: New file.
8637
8638         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8639         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8640         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8641         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8642         if asynchronous canceling is enabled.
8643         * pthread_join.c (pthread_join): When recognizing circular joins,
8644         take into account the other thread might be already canceled.
8645         * Makefile (tests): Add tst-join5.
8646         * tst-join5.c: New file.
8647
8648         * Makefile (tests): Add tst-join4.
8649         * tst-join4.c: New file.
8650
8651 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8652
8653         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8654
8655 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8656
8657         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8658         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8659         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8660         warning.
8661         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8662         to avoid warning.
8663         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8664         error if lll_futex_wake failed.
8665
8666 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8667
8668         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8669         handling of cancellation and failung pthread_mutex_unlock call.
8670         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8671         * Makefile (tests): Add tst-cond8 and tst-cond9.
8672         * tst-cond8.c: New file.
8673         * tst-cond9.c: New file.
8674
8675         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8676
8677         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8678         non-standard initializers with __USE_GNU.
8679
8680         * Makefile (tests): Add tst-cleanup3.
8681         * tst-cleanup3.c: New file.
8682
8683 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8684
8685         * Makefile (tests): Add tst-attr1 and tst-attr2.
8686         * tst-attr1.c: New file.
8687         * tst-attr2.c: New file.
8688
8689         * Makefile: Add rules to build and run tst-atfork2 test.
8690         * tst-atfork2.c: New file.
8691         * tst-atfork2mod.c: New file.
8692
8693         * sysdeps/unix/sysv/linux/unregister-atfork.c
8694         (__unregister_atfork): Free the memory allocated for the handlers
8695         after removing them from the lists.
8696
8697         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8698         cleanup function.
8699
8700         * tst-atfork1.c (do_test): Wait for the child we forked.
8701         Report error in child.
8702
8703         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8704
8705         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8706
8707 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8708
8709         * Makefile (tests): Add tst-cancel8.
8710         * tst-cancel8.c: New file.
8711
8712         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8713         clearing of control variable.
8714         * Makefile (tests): Add tst-once3 and tst-once4.
8715         * tst-once3.c: New file.
8716         * tst-once4.c: New file.
8717
8718 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8719
8720         * sysdeps/sh/Makefile: New file.
8721         * sysdeps/sh/bits/atomic.h: New file.
8722         * sysdeps/sh/pthread_spin_init.c: New file.
8723         * sysdeps/sh/pthread_spin_lock.c: New file.
8724         * sysdeps/sh/pthread_spin_trylock.S: New file.
8725         * sysdeps/sh/pthread_spin_unlock.S: New file.
8726         * sysdeps/sh/pthreaddef.h: New file.
8727         * sysdeps/sh/tcb-offsets.sym: New file.
8728         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8729         * sysdeps/sh/tls.h: New file.
8730         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8731         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8732         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8733         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8734         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8735         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8736         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8737         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8738         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8739         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8740         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8741         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8742         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8743         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8744         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8745         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8746         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8747         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8748         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8749         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8750         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8751         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8752         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8753         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8754         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8755         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8756         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8757         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8758         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8759         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8760
8761 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8762
8763         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8764         according to POSIX.
8765
8766         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8767
8768 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8769
8770         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8771         (TLS_GET_FS): New #define.
8772         (TLS_SET_FS): New #define.
8773         Correct value of __NR_set_thread_area.
8774
8775         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8776
8777 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8778
8779         * Makefile (tests): Add tst-popen1.
8780         * tst-popen1.c: New file.
8781
8782         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8783         but inactive generalization.
8784         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8786         Minor optimization, remove one instruction.
8787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8788
8789 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8790
8791         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8792
8793 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8794
8795         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8796         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8797         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8798         * sysdeps/pthread/pthread_cond_signal.c: New file.
8799         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8800         * sysdeps/pthread/pthread_cond_wait.c: New file.
8801         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8802         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8803         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8804         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8805         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8806         * sysdeps/s390/Makefile: New file.
8807         * sysdeps/s390/bits/atomic.h: New file.
8808         * sysdeps/s390/pthread_spin_init.c: New file.
8809         * sysdeps/s390/pthread_spin_lock.c: New file.
8810         * sysdeps/s390/pthread_spin_trylock.c: New file.
8811         * sysdeps/s390/pthread_spin_unlock.c: New file.
8812         * sysdeps/s390/pthreaddef.h: New file.
8813         * sysdeps/s390/tcb-offsets.sym: New file.
8814         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8815         * sysdeps/s390/tls.h: New file.
8816         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8817         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8818         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8819         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8820         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8821         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8822         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8823         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8824         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8825         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8826         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8827         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8828         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8829         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8830         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8831         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8832         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8833         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8834         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8835         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8836         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8837         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8838         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8839
8840 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8841
8842         * atomic.h: Add a couple more default implementations.
8843         (atomic_compare_and_exchange_acq): Use
8844         __arch_compare_and_exchange_32_acq in return value definition.  It
8845         always exists.
8846         (atomic_bit_set): Renamed from atomic_set_bit.
8847         Add missing atomic_ prefixes.
8848
8849         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8850         thread library is available, use correct value to mark initialized
8851         once variable.
8852
8853 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8854
8855         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8856         __sysconf to determine pagesize.
8857
8858         * pthread_create.c: Include <atomic.h>.
8859         * allocatestack.c (allocate_stack): Implement coloring of the
8860         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8861         size minus one.  Adjust users.
8862         * sysdeps/i386/i686/Makefile: New file.
8863
8864 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
8865
8866         * allocatestack.c: Improve comment throughout the file.
8867
8868         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8869         (__lll_lock_wait): Add branch prediction.
8870         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8871         (__lll_lock_wait): Likewise.
8872         (lll_unlock_wake_cb): Removed.
8873
8874 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
8875
8876         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
8877         _POSIX_THREAD_PRIORITY_SCHEDULING.
8878
8879 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
8880
8881         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8882         Fix return type of ptr___pthread_getspecific.
8883
8884 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
8885
8886         * Makefile (tests): Add tst-umask1.
8887         (tst-umask1-ARGS): Define.
8888         * tst-umask1.c: New file.
8889
8890 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
8891
8892         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
8893         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
8894         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
8895         pthread_rwlock_unlock.
8896         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
8897         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
8898         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
8899         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
8900         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8901         New file.
8902         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
8903         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8904         New file.
8905         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
8906         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
8907         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
8908         New file.
8909         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
8910         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
8911         New file.
8912         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
8913         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
8914         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
8915         New file.
8916         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
8917         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
8918         New file.
8919         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
8920
8921         * Makefile (libpthread-routines): Remove lowlevelcond and
8922         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
8923         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
8924         and pthread_cond_broadcast.
8925         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
8926         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
8927         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
8928         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
8929         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
8930         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
8931         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
8932         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
8933         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
8934         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
8935         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
8936         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
8937         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
8938         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
8939         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
8940         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
8941         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
8942         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
8943         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
8944         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
8945         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
8946         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
8947         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
8948         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
8949         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
8950         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
8951         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
8952         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
8953         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
8954         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
8955         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
8956
8957         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
8958         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
8959         of the code is moved to ...
8960         * sysdeps/pthread/createthread.c: ...here.  New file.
8961
8962 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
8963
8964         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
8965         (__new_sem_post): Clear %eax before returning.
8966         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
8967
8968         * Makefile (tests): Add tst-cleanup2.
8969         * tst-cleanup2.c: New file.
8970
8971         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
8972         Interpret first parameter correctly.
8973
8974 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
8975
8976         * Makefile (headers): Add bits/semaphore.h.
8977
8978 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
8979
8980         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
8981         if not SHARED.
8982
8983 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
8984
8985         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
8986         must be used and mapping failed.
8987         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
8988
8989         * Makefile (CFLAGS-pthread_self.os): Define this, not
8990         CFLAGS-pthread_self.c.
8991
8992 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
8993
8994         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
8995         lll_unlock_wake_cb.
8996
8997         * Makefile (libpthread-routines): Add version.  Add rules to build
8998         version.os and banner.h.
8999         * version.c: New file.
9000
9001 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9002
9003         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9004         the alias unconditional.
9005         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9006
9007 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9008
9009         * Makefile (CFLAGS-pthread_self.c): New definition.
9010
9011 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9012
9013         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9014         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9015         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9016         * init.c (__pthread_initialize_minimal_internal): Likewise.
9017
9018 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9019
9020         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9021
9022         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9023         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9024         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9025         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9026         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9027         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9028
9029 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9030
9031         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9032         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9033         * tst-cancel-wrappers.sh: Remove all exceptions.
9034
9035 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9036
9037         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9038         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9039
9040         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9041         Use __libc_pthread_functions array if SHARED.
9042
9043         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9044         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9045
9046         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9047         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9048         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9049         __libc_ptf_call instead of __libc_maybe_call.
9050         (PTF): New #define.
9051         (__libc_cleanup_region_start): Wrap function name with PTF call.
9052         (__libc_cleanup_region_end): Likewise.
9053         (__libc_cleanup_end): Likewise.
9054
9055         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9056         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9057         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9058         * pthreadP.h: Add prototypes.
9059
9060         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9061         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9062         __pthread_rwlock_unlock aliases.
9063         * pthreadP.h: Add prototypes for new aliases.
9064
9065         * pthreadP.h (struct pthead_functions): Moved to...
9066         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9067         * init.c (pthread_functions): Add initializers for new elements.
9068
9069         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9070         __pthread_cleanup_pop_restore aliases.
9071         * pthreadP.h: Add prototypes.
9072
9073         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9074         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9075         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9076         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9077         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9078         * pthreadP.h: Adjust prototypes and callers.
9079
9080 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9081
9082         * Makefile (tests): Add tst-cancel7.
9083         (tst-cancel7-ARGS): New variable.
9084         * tst-cancel7.c: New file.
9085
9086         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9087         around gcc defficiencies.
9088         * old_pthread_cond_signal.c: Likewise.
9089         * old_pthread_cond_timedwait.c: Likewise.
9090         * old_pthread_cond_wait.c: Likewise.
9091
9092         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9093
9094 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9095
9096         * Makefile (tests): Add tst-cond7.
9097         * tst-cond7.c: New file.
9098
9099         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9100         (condvar_cleanup): Get condvar address from the right place.
9101
9102         * atomic.h: Correct definitions of atomic_full_barrier,
9103         atomic_read_barrier, atomic_write_barrier.
9104
9105         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9106         race-free.
9107         * old_pthread_cond_signal.c: Likewise.
9108         * old_pthread_cond_timedwait.c: Likewise.
9109         * old_pthread_cond_wait.c: Likewise.
9110
9111 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9112
9113         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9114
9115 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9116
9117         * pthreadP.h (pthread_cond_2_0_t): New type.
9118         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9119         Use new type for the 2.0 condvar function prototypes.
9120         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9121         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9122         parameter.
9123         * old_pthread_cond_destroy.c: Likewise.
9124         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9125         * old_pthread_cond_signal.c: Likewise.
9126         * old_pthread_cond_timedwait.c: Likewise.
9127         * old_pthread_cond_wait.c: Likewise.
9128
9129         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9130         (__pthread_cond_wait): Don't save cancellation mode and seq value
9131         in same location.
9132
9133         * herrno.c (__h_errno_location): Don't define as weak.
9134
9135 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9136
9137         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9138         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9139         and pthread_cond_wait.
9140         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9141         Renamed to...
9142         (__pthread_cond_broadcast_2_0): ... this.
9143         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9144         Renamed to...
9145         (__pthread_cond_destroy_2_0): ... this.
9146         * old_pthread_cond_init.c (__old_pthread_cond_init):
9147         Renamed to...
9148         (__pthread_cond_init_2_0): ... this.
9149         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9150         Renamed to...
9151         (__pthread_cond_signal_2_0): ... this.
9152         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9153         Renamed to...
9154         (__pthread_cond_wait_2_0): ... this.
9155         * pthread_cond_destroy.c: Include shlib-compat.h.
9156         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9157         * pthread_cond_init.c: Include shlib-compat.h.
9158         (pthread_cond_init): Change strong_alias into versioned_symbol.
9159         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9160         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9161         fields.
9162         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9163         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9164         __pthread_cond_wait_2_0): New prototypes.
9165         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9166         __old_pthread_cond_init, __old_pthread_cond_signal,
9167         __old_pthread_cond_wait): Removed.
9168         * init.c: Include shlib-compat.h.
9169         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9170         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9171         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9172         ptr___pthread_cond_*_2_0 fields.
9173         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9174         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9175
9176         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9177         LIBC_SIGACTION was not yet defined.
9178         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9179         [!defined LIBC_SIGACTION] (__sigaction): New function and
9180         libc_hidden_weak.
9181         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9182         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9183
9184 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9185
9186         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9187
9188 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9189
9190         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9191         New, larger type definition.
9192         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9193         implementation.
9194         * Versions [libpthread]: Add definitions for new pthread_cond_*
9195         interfaces for version GLIBC_2.3.2.
9196         * pthread_cond_init.c: Update initialization for new type definition.
9197         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9198         pthread_cond_timedwait, pthread_cond_signal, and
9199         pthread_cond_broadcast.  Add old_pthread_cond_init,
9200         old_pthread_cond_destroy, old_pthread_cond_wait,
9201         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9202         old_pthread_cond_broadcast.
9203         * old_pthread_cond_broadcast.c: New file.
9204         * old_pthread_cond_destroy.c: New file.
9205         * old_pthread_cond_init.c: New file.
9206         * old_pthread_cond_signal.c: New file.
9207         * old_pthread_cond_timedwait.c: New file.
9208         * old_pthread_cond_wait.c: New file.
9209         * pthreadP.h: Add prototypes for the compatibility interfaces.
9210
9211         * pthread_cond_destroy.c: Don't include <errno.h>.
9212
9213 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9214
9215         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9216         unnecessary zero offset when addressing MUTEX.
9217
9218 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9219
9220         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9221         __register_atfork.
9222         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9223         for __register_atfork.
9224
9225 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9226
9227         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9228         instead of ASSEMBLER test macro.
9229
9230         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9231         __libc_current_sigrtmax): Add libc_hidden_def.
9232
9233         * sysdeps/pthread/list.h: Remove assert.h include.
9234
9235 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9236
9237         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9238         __pthread_initialize_minimal_internal not
9239         __pthread_initialize_minimal.
9240
9241 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9242
9243         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9244         __pthread_initialize_minimal as hidden.
9245
9246         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9247         constructor.
9248
9249 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9250
9251         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9252         $(common-objpfx)format.lds, include that into the output script.
9253         Fix comment.
9254         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9255
9256 2002-12-28  Andreas Jaeger  <aj@suse.de>
9257
9258         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9259         nsec resolution changes.
9260         (xstat64_conv): Likewise.
9261         (xstat32_conv): Likewise.
9262         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9263         struct kernel_stat.
9264         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9265         structs stat and stat64.
9266         * time/time.h (__timespec_defined): Define for __USE_MISC.
9267         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9268
9269 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9270
9271         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9272         argument.
9273         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9274         (pthread_exit): Use strong_alias to avoid warnings.
9275         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9276         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9277         ptr___pthread_attr_init_2_*.
9278         * init.c (pthread_functions): Adjust.
9279
9280 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9281
9282         * forward.c: Make all functions available by default again.  It
9283         caused too much trouble.
9284
9285         * pt-siglongjmp.c: Removed.
9286
9287 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9288
9289         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9290         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9291         * sysdeps/i386/Makefile: New file.
9292         * sysdeps/i386/tcb-offsets.sym: New file.
9293         * sysdeps/pthread/tcb-offsets.h: New file.
9294         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9295         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9296
9297         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9298         __register_atfork...
9299         (GLIBC_2.3.2): ...here.
9300
9301 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9302
9303         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9304         pthread_attr_setstackaddr with __attribute_deprecated__.
9305
9306 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9307
9308         * pt-system.c (system): Remove cancellation handling.
9309         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9310         cancellation routines.
9311
9312 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9313
9314         * descr.h: Include <dl-sysdep.h>.
9315         (struct pthread): Move header.data.list to the back of the struct.
9316         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9317         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9318         (SYSINFO_OFFSEET): Likewise.
9319
9320 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9321
9322         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9323         Define.
9324         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9325         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9326         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9327         (USE_DL_SYSINFO): Undef.
9328
9329 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9330
9331         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9332         $(common-objpfx)libc.so.
9333         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9334         it is bigger than pipe buffer size even on arches with bigger
9335         page size.
9336         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9337
9338 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9339
9340         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9341         correct errno access for case that USE___THREAD is not defined.
9342
9343 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9344
9345         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9346         Patch by Marijn Ros <marijn@mad.scientist.com>.
9347
9348 2002-12-22  Roland McGrath  <roland@redhat.com>
9349
9350         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9351
9352 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9353
9354         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9355
9356 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9357
9358         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9359         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9360         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9361
9362         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9363         of int $0x80.
9364         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9365         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9366         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9367         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9368         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9369         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9370         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9371         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9372
9373         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9374         sysenter.
9375         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9376
9377         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9378
9379         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9380         in new TCB.
9381         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9382         that sysinfo is properly initialized.
9383         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9384         to 1 only for ld.so.
9385
9386         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9387         RTLD_CORRECT_DYNAMIC_WEAK.
9388
9389 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9390
9391         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9392         Use return 0 as 6th argument to FORWARD4.
9393         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9394
9395 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9396
9397         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9398         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9399         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9400         (INIT_SYSINFO): New #define.
9401         (TLS_TP_INIT): Use INIT_SYSINFO.
9402         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9403         At test to make sure SYSINFO_OFFSET value is correct.
9404         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9405
9406 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9407
9408         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9409         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9410         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9411         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9412         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9413         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9414         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9415
9416 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9417
9418         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9419         macro instead of using int $0x80 directly.
9420
9421         * sysdeps/pthread/bits/stdio-lock.h: New file.
9422         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9423         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9424         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9425         * Makefile (routines): Add libc-lowlevelmutex.
9426
9427         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9428         __i686.get_pc_thunk.dx.
9429
9430 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9431
9432         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9433         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9434         ($(objpfx)tst-cancel-wrappers.out): New rule.
9435         * tst-cancel-wrappers.sh: New test.
9436         * tst-locale1.c: Include signal.h.
9437         (uselocale): Test static linking of __libc_current_sigrt*.
9438
9439 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9440
9441         * Makefile (tests): Add tst-cancel6.
9442         * tst-cancel6.c: New file
9443
9444 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9445
9446         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9447         Define meaningfully for assembler as well.
9448         * pthreadP.h (struct pthread_functions): Remove
9449         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9450         and ptr_pthread_attr_init_2_1 fields.
9451         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9452         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9453         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9454         (FORWARD3): Define using FORWARD4.
9455         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9456         versions.
9457         * pt-system.c: Remove duplicate stdlib.h include.
9458
9459 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9460
9461         * sem_init.c: Define sem_init@GLIBC_2.0.
9462         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9463         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9464
9465         * flockfile.c: Moved to...
9466         * sysdeps/pthread/flockfile.c: ...here.  New file.
9467         * funlockfile.c: Moved to...
9468         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9469         * ftrylockfile.c: Moved to...
9470         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9471
9472 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9473
9474         * libc-cancellation.c: Guard both function with
9475         #if !defined NOT_IN_libc.
9476         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9477         automatically provided pthread wrappers.
9478         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9479         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9480         nor in libpthread.
9481         * pt-open.c: Removed.
9482         * pt-fcntl.c: Removed.
9483         * pt-fsync.c: Removed.
9484         * pt-lseek.c: Removed.
9485         * pt-msgrcv.c: Removed.
9486         * pt-msgsnd.c: Removed.
9487         * pt-msync.c: Removed.
9488         * pt-nanosleep.c: Removed.
9489         * pt-open64.c: Removed.
9490         * pt-pause.c: Removed.
9491         * pt-pread.c: Removed.
9492         * pt-pread64.c: Removed.
9493         * pt-pwrite.c: Removed.
9494         * pt-pwrite64.c: Removed.
9495         * pt-read.c: Removed.
9496         * pt-recv.c: Removed.
9497         * pt-recvfrom.c: Removed.
9498         * pt-recvmsg.c: Removed.
9499         * pt-send.c: Removed.
9500         * pt-sendto.c: Removed.
9501         * pt-sigtimedwait.c: Removed.
9502         * pt-sigwait.c: Removed.
9503         * pt-wait.c: Removed.
9504         * pt-waitpid.c: Removed.
9505         * pt-write.c: Removed.
9506         * pt-accept.c: Removed.
9507         * pt-close.c: Removed.
9508         * pt-connect.c: Removed.
9509         * pt-lseek64.c: Removed.
9510         * pt-sendmsg.c: Removed.
9511         * pt-tcdrain.c: Removed.
9512
9513 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9514
9515         * init.c (__pthread_initialize_minimal_internal): Renamed from
9516         __pthread_initialize_minimal.  Make old name an alias.  This
9517         converts a normal relocation into a relative relocation.
9518
9519         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9520
9521         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9522         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9523         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9524         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9525         pt-sigwaitinfo, pt-waitid, and pt-writev.
9526         * pt-creat.c: Removed.
9527         * pt-poll.c: Removed.
9528         * pt-pselect.c: Removed.
9529         * pt-readv.c: Removed.
9530         * pt-select.c: Removed.
9531         * pt-sigpause.c: Removed.
9532         * pt-sigsuspend.c: Removed.
9533         * pt-sigwaitinfo.c: Removed.
9534         * pt-waitid.c: Removed.
9535         * pt-writev.c: Removed.
9536
9537         * init.c (pthread_functions): New variable.
9538         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9539         (or NULL) to __libc_pthread_init.
9540         * forward.c: Rewrite to use __libc:pthread_functions array to get
9541         function addresses.
9542         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9543         prototype.
9544         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9545         Take new parameter.  Copy content of variable pointed to by it
9546         to __libc_pthread_init.
9547
9548         * pthreadP.h (struct pthread_functions): New type.
9549         (__libc_pthread_init): Declare.
9550
9551         * pthread_attr_destroy.c: Add namespace protected alias.
9552         * pthread_attr_getdetachstate.c: Likewise.
9553         * pthread_attr_getinheritsched.c: Likewise.
9554         * pthread_attr_getschedparam.c: Likewise.
9555         * pthread_attr_getschedpolicy.c: Likewise.
9556         * pthread_attr_getscope.c: Likewise.
9557         * pthread_attr_setdetachstate.c: Likewise.
9558         * pthread_attr_setinheritsched.c: Likewise.
9559         * pthread_attr_setschedparam.c: Likewise.
9560         * pthread_attr_setschedpolicy.c: Likewise.
9561         * pthread_attr_setscope.c: Likewise.
9562         * pthread_cond_broadcast.c: Likewise.
9563         * pthread_cond_destroy.c: Likewise.
9564         * pthread_cond_init.c: Likewise.
9565         * pthread_cond_signal.c: Likewise.
9566         * pthread_cond_wait.c: Likewise.
9567         * pthread_condattr_destroy.c: Likewise.
9568         * pthread_condattr_init.c: Likewise.
9569         * pthread_equal.c: Likewise.
9570         * pthread_exit.c: Likewise.
9571         * pthread_getschedparam.c: Likewise.
9572         * pthread_self.c: Likewise.
9573         * pthread_setcancelstate.c: Likewise.
9574         * pthread_setschedparam.c: Likewise.
9575         * pthread_mutex_destroy.c: Likewise.
9576         * pthread_mutex_init.c: Likewise.
9577         * pthreadP.h: Add prototypes for the aliases.
9578
9579         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9580         multiple_threads member in correct TCB to 1.
9581
9582         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9583         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9584         member of thread decriptor, otherwise return unconditionally 1.
9585
9586 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9587
9588         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9589         regular Linux version.  Remove file.
9590         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9591         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9592         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9593         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9594         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9595         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9596         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9597         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9598         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9599         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9600         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9601         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9602         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9603         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9604         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9605         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9606         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9607         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9608         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9609         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9610         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9611         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9612         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9613         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9614         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9615         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9616         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9617         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9618         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9619         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9620
9621 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9622
9623         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9624         * sysdeps/unix/sysv/linux/open.c: Removed.
9625         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9626         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9627         * sysdeps/unix/sysv/linux/msync.c: Removed.
9628         * sysdeps/unix/sysv/linux/read.c: Removed.
9629         * sysdeps/unix/sysv/linux/close.c: Removed.
9630         * sysdeps/unix/sysv/linux/creat.c: Removed.
9631         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9632         * sysdeps/unix/sysv/linux/pause.c: Removed.
9633         * sysdeps/unix/sysv/linux/select.c: Removed.
9634         * sysdeps/unix/sysv/linux/write.c: Removed.
9635
9636 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9637
9638         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9639         element in TCB to see whether locking is needed.
9640
9641         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9642         MULTIPLE_THREADS_OFFSET value is correct.
9643
9644         * sysdeps/unix/sysv/linux/close.c: New file.
9645         * sysdeps/unix/sysv/linux/connect.S: New file.
9646         * sysdeps/unix/sysv/linux/creat.c: New file.
9647         * sysdeps/unix/sysv/linux/fsync.c: New file.
9648         * sysdeps/unix/sysv/linux/llseek.c: New file.
9649         * sysdeps/unix/sysv/linux/lseek.c: New file.
9650         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9651         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9652         * sysdeps/unix/sysv/linux/msync.c: New file.
9653         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9654         * sysdeps/unix/sysv/linux/open.c: New file.
9655         * sysdeps/unix/sysv/linux/open64.c: New file.
9656         * sysdeps/unix/sysv/linux/pause.c: New file.
9657         * sysdeps/unix/sysv/linux/poll.c: New file.
9658         * sysdeps/unix/sysv/linux/pread.c: New file.
9659         * sysdeps/unix/sysv/linux/pread64.c: New file.
9660         * sysdeps/unix/sysv/linux/pselect.c: New file.
9661         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9662         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9663         * sysdeps/unix/sysv/linux/readv.c: New file.
9664         * sysdeps/unix/sysv/linux/recv.S: New file.
9665         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9666         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9667         * sysdeps/unix/sysv/linux/select.c: New file.
9668         * sysdeps/unix/sysv/linux/send.S: New file.
9669         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9670         * sysdeps/unix/sysv/linux/sendto.S: New file.
9671         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9672         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9673         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9674         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9675         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9676         * sysdeps/unix/sysv/linux/system.c: New file.
9677         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9678         * sysdeps/unix/sysv/linux/wait.c: New file.
9679         * sysdeps/unix/sysv/linux/waitid.c: New file.
9680         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9681         * sysdeps/unix/sysv/linux/writev.c: New file.
9682         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9683
9684         * pt-readv.c: Fix comment.
9685
9686 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9687
9688         * tst-cleanup1.c: Include stdlib.h.
9689
9690         * tst-cancel5.c: New test.
9691         * Makefile (tests): Add tst-cancel5.
9692         (tst-cancel5): Link against libc.so libpthread.so in that order.
9693
9694 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9695
9696         * forward.c (test_loaded): Prevent recursive calls.
9697
9698         * Makefile (routines): Add libc-cancellation.
9699         * libc-cancellation.c: New file.
9700         * descr.h (struct pthread): Add multiple_threads field.
9701         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9702         new thread descriptor to 1.
9703         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9704         Initialize multiple_thread field after successful thread creation.
9705         * cancellation.c (__do_cancel): Move to pthreadP.h.
9706         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9707         (__pthread_disable_asynccancel): Add internal_function attribute.
9708         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9709         * pthread_setcancelstate.c: Likewise.
9710         * pthread_setcanceltype.c: Likewise.
9711         * pthread_exit.c: Likewise.
9712         * pthreadP.h (CANCELLATION_P): Likewise.
9713         (__do_cancel): Define as static inline.
9714         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9715         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9716         declarations.
9717         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9718         fields.  Define MULTIPLE_THREADS_OFFSET.
9719         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9720         declaration.
9721         * sysdeps/unix/sysv/linux/accept.S: New file.
9722         * sysdeps/unix/sysv/linux/read.c: New file.
9723         * sysdeps/unix/sysv/linux/write.c: New file.
9724         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9725         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9726         initialization of __libc_locking_needed.
9727         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9728         __libc_locking_needed, use multiple_threads field in TCB.
9729         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9730
9731 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9732
9733         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9734         version.
9735         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9736
9737         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9738         access to __libc_locking_needed for PIC.
9739
9740 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9741
9742         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9743         declare for libc.so.
9744         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9745         expression.
9746         (__libc_lock_lock): Put into statement expression.
9747         (__libc_lock_unlock): Remove trailing semicolon.
9748         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9749
9750 2002-12-12  Roland McGrath  <roland@redhat.com>
9751
9752         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9753         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9754
9755 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9756
9757         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9758         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9759         Initialize __libc_locking_needed.
9760         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9761         instead of __register_pthread_fork_handler.
9762         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9763         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9764         fork-gen with libc_pthread_init.
9765         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9766         of __register_pthread_fork_handler.
9767         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9768         of __register_pthread_fork_handler.
9769         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9770         __libc_locking_needed to determine whether lock prefix can be avoided.
9771         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9772
9773 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9774
9775         * Makefile (tests): Add tst-cleanup1.
9776         * tst-cleanup1.c: New file.
9777         * cancellation.c (__cleanup_thread): Removed.
9778         (__do_cancel): Remove call to __cleanup_thread.
9779         * pthreadP.h: Remove __cleanup_thread prorotype.
9780
9781         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9782         Remember function and argument even if cancellation handler
9783         function is not available.
9784         (__libc_cleanup_region_end): Execute registered function directly if
9785         pthread functions are not available.
9786         (__libc_cleanup_end): Likewise.
9787
9788         * init.c (__pthread_initialize_minimal): Fix initialization in
9789         static lib by preventing gcc from being too clever.
9790
9791 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9792
9793         * init.c (__pthread_initialize_minimal): Remove unneccesary
9794         sigaddset call.
9795
9796         * Makefile (tests): We can run tst-locale2 now.
9797
9798 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9799
9800         * Versions: Remove duplicated sigwait entry.
9801
9802 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9803
9804         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9805         inside libpthread.
9806
9807         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9808
9809         * pthreadP.h: Declare __pthread_enable_asynccancel and
9810         __pthread_disable_asynccancel.
9811         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9812         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9813         * cancellation.c (__pthread_enable_asynccancel): New function.
9814         (__pthread_disable_asynccancel): New function.
9815         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9816         * pt-close.c: Likewise.
9817         * pt-connect.c: Likewise.
9818         * pt-creat.c: Likewise.
9819         * pt-fcntl.c: Likewise.
9820         * pt-fsync.c: Likewise.
9821         * pt-lseek.c: Likewise.
9822         * pt-lseek64.c: Likewise.
9823         * pt-msgrcv.c: Likewise.
9824         * pt-msgsnd.c: Likewise.
9825         * pt-msync.c: Likewise.
9826         * pt-nanosleep.c: Likewise.
9827         * pt-open.c: Likewise.
9828         * pt-open64.c: Likewise.
9829         * pt-pause.c: Likewise.
9830         * pt-poll.c: Likewise.
9831         * pt-pread.c: Likewise.
9832         * pt-pread64.c: Likewise.
9833         * pt-pselect.c: Likewise.
9834         * pt-pwrite.c: Likewise.
9835         * pt-pwrite64.c: Likewise.
9836         * pt-read.c: Likewise.
9837         * pt-readv.c: Likewise.
9838         * pt-recv.c: Likewise.
9839         * pt-recvfrom.c: Likewise.
9840         * pt-recvmsg.c: Likewise.
9841         * pt-select.c: Likewise.
9842         * pt-send.c: Likewise.
9843         * pt-sendmsg.c: Likewise.
9844         * pt-sendto.c: Likewise.
9845         * pt-sigpause.c: Likewise.
9846         * pt-sigsuspend.c: Likewise.
9847         * pt-sigtimedwait.c: Likewise.
9848         * pt-sigwait.c: Likewise.
9849         * pt-sigwaitinfo.c: Likewise.
9850         * pt-system.c: Likewise.
9851         * pt-tcdrain.c: Likewise.
9852         * pt-wait.c: Likewise.
9853         * pt-waitid.c: Likewise.
9854         * pt-waitpid.c: Likewise.
9855         * pt-write.c: Likewise.
9856         * pt-writev.c: Likewise.
9857         * pthread_join.c: Likewise.
9858         * pthread_timedjoin.c: Likewise.
9859
9860         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9861         (__xpg_sigpause): New function.
9862         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9863
9864 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
9865
9866         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
9867
9868         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
9869         _GI_pthread_cleanup_pop to pthreadP.h.
9870
9871         * ftrylockfile.c: Use _IO_lock_trylock instead of
9872         pthread_mutex_trylock.
9873
9874         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
9875         (CANCEL_RESET): Likewise.
9876         (__pthread_setcanceltype_): Declare.
9877         (__pthread_mutex_lock_internal): Declare.
9878         (__pthread_mutex_unlock_internal): Declare.
9879         (__pthread_once_internal): Declare.
9880         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
9881         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
9882
9883         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
9884         and pthread_mutex_unlock.
9885         * pthread_cond_wait.c: Likewise.
9886         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
9887         * pthread_mutex_unlock.c: Likewise.
9888
9889         * pthread_setcanceltype.c: Add additional alias
9890         __pthread_setcanceltype.
9891
9892         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
9893         * sem_open.c (sem_open): Likewise.
9894         Use __libc_open, __libc_write, and __libc_close instead of
9895         open, write, and close respectively.
9896
9897         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
9898         Rewrite as statement expression since it must return a value.
9899
9900         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
9901         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
9902         __pthread_kill.
9903
9904         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
9905         alias __pthread_once_internal.
9906
9907         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
9908
9909 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
9910
9911         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
9912         * tst-stdio1.c: New file.
9913         * tst-stdio2.c: New file.
9914
9915         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
9916
9917         * Makefile (tests): Comment out tst-locale2 for now.
9918         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
9919
9920         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
9921         -D_IO_MTSAFE_IO.
9922         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
9923         Use _IO_lock_init instead of explicit assignment.
9924
9925         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
9926         Define __libc_lock_* and __libc_lock_recursive macros with
9927         lowlevellock macros, not pthread mutexes.
9928
9929         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
9930         of pthread_mutex_lock.
9931         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
9932         instead of pthread_mutex_unlock.
9933
9934 2002-12-06  Roland McGrath  <roland@redhat.com>
9935
9936         * allocatestack.c (__stack_user): Use uninitialized defn.
9937         * init.c (__pthread_initialize_minimal): Initialize it here.
9938
9939 2002-12-05  Roland McGrath  <roland@redhat.com>
9940
9941         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
9942         string.
9943         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
9944
9945         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
9946         missing & here too.
9947
9948 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
9949
9950         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
9951         lowlevellock.
9952         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
9953         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
9954         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
9955         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
9956         for __libc_lock_* macros.
9957         * Makefile (routines): Add libc-lowlevellock.
9958
9959 2002-10-09  Roland McGrath  <roland@redhat.com>
9960
9961         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
9962         Under [__PIC__], call the function via the pointer fetched for
9963         comparison rather than a call by name that uses the PLT.
9964         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
9965         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
9966         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
9967         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
9968         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
9969
9970 2002-12-04  Roland McGrath  <roland@redhat.com>
9971
9972         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
9973
9974         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
9975         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
9976
9977         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
9978
9979 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9980
9981         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
9982         a completely opaque, non-integer type.
9983         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9984
9985 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
9986
9987         * sysdeps/i386/tls.h: Include stdlib.h.
9988         * sysdeps/x86_64/tls.h: Likewise.
9989
9990 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
9991
9992         * Makefile (tests): Add tst-locale2.
9993         (tests-static): Likewise.
9994         * tst-locale2.c: New file.
9995
9996         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
9997         volatile and add memory clobbers to lock operations.
9998
9999 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10000
10001         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10002         * sysdeps/i386/i486/bits/atomic.h: New file.
10003         * sysdeps/i386/i586/bits/atomic.h: New file.
10004         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10005         include i486 version.
10006         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10007         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10008         Patch by Marijn Ros <marijn@mad.scientist.com>.
10009
10010         * allocatestack.c (get_cached_stack): Don't crash if we first
10011         found a stack with a larger size then needed.
10012         Reported by Hui Huang <hui.huang@sun.com>.
10013
10014         * Makefile (tests): Add tst-sysconf.
10015         * tst-sysconf.c: New file.
10016
10017         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10018         PTHREAD_THREADS_MAX.
10019
10020 2002-12-02  Roland McGrath  <roland@redhat.com>
10021
10022         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10023         Declare using hidden_proto instead of attribute_hidden, so there are
10024         non-.hidden static symbols for gdb to find.
10025         (__pthread_keys): Likewise.
10026         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10027         * allocatestack.c (__stack_user): Likewise.
10028         * pthread_create.c (__pthread_keys): Likewise.
10029         (__nptl_threads_events, __nptl_last_event): Make these static instead
10030         of hidden.
10031         * pthread_key_create.c (__pthread_pthread_keys_max,
10032         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10033
10034 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10035
10036         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10037         statically.
10038         * tst-locale1.c: New file.
10039
10040         * pthread_cond_timedwait.c: Include <stdlib.h>.
10041
10042         * Makefile (tests): Add tst-fork2 and tst-fork3.
10043         * tst-fork2.c: New file.
10044         * tst-fork3.c: New file.
10045
10046 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10047
10048         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10049
10050         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10051         require it to 200112L.
10052
10053         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10054         instruction only if HAVE_CMOV is defined.
10055         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10056
10057         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10058
10059         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10060
10061         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10062
10063         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10064
10065 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10066
10067         * sysdeps/x86_64/bits/atomic.h: New file.
10068
10069         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10070         16-bit operations.
10071
10072         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10073         possible since gettid cannot fail.
10074
10075         * sysdeps/x86_64/pthreaddef.h: New file.
10076
10077         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10078
10079         * sysdeps/x86_64/pthread_spin_init.c: New file.
10080         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10081         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10082         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10083
10084         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10085         Add missing lock prefix.  Minute optimization.
10086
10087         * tst-spin2.c (main): Also check successful trylock call.
10088
10089         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10090         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10091
10092         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10093         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10094
10095         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10096         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10097         value in case of an error.  Add support for INTERNAL_SYSCALL.
10098
10099         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10100         value in case of an error.
10101
10102         * sysdeps/x86_64/tls.h: New file.
10103
10104 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10105
10106         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10107         takes the array member name and the index as parameters.
10108         (THREAD_SETMEM_NC): Likewise.
10109         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10110         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10111         interfaces.
10112
10113         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10114         to decide which code to use.
10115         (THREAD_SETMEM_NC): Likewise.
10116
10117         * allocatestack.c (queue_stack): Don't remove stack from list here.
10118         Do it in the caller.  Correct condition to prematurely terminate
10119         loop to free stacks.
10120         (__deallocate_stack): Remove stack from list here.
10121
10122 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10123
10124         * Makefile (tests): Add tst-stack1.
10125         * tst-stack1.c: New file.
10126
10127         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10128         provided stack.
10129
10130         * pthread_attr_getstack.c: Return bottom of the thread area.
10131
10132 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10133
10134         * Makefile (libpthread-routines): Add pt-allocrtsig and
10135         pthread_kill_other_threads.
10136         * pt-allocrtsig.c: New file.
10137         * pthread_kill_other_threads.c: New file.
10138         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10139         all three functions.
10140         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10141         allocrtsig.
10142         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10143         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10144         and __libc_allocate_rtsig_private.
10145         * Versions (libpthread): Export pthread_kill_other_threads_np,
10146         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10147
10148 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10149
10150         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10151         the end of the stack.  Adjust computations.
10152         When mprotect call fails dequeue stack and free it.
10153         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10154         attribute.
10155         * pthread_getattr_np.c: Likewise.
10156
10157         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10158         surprises.
10159
10160 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10161
10162         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10163         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10164
10165 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10166
10167         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10168         * pthread_setspecific.c: Likewise.
10169
10170 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10171
10172         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10173         definitions.  Get them from the official place.
10174         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10175
10176         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10177         Use new CLONE_ flags in clone() calls.
10178
10179         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10180         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10181
10182         * Versions: Add pthread_* functions for libc.
10183         * forward.c: New file.
10184
10185         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10186         errno-loc.
10187         * herrno.c: New file.
10188         * res.c: New file.
10189
10190         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10191         sem_trywait, and sem_timedwait.  Add herrno and res.
10192         * sem_init.c: Don't initialize lock and waiters members.
10193         * sem_open.c: Likewise.
10194         * sem_post.c: Removed.
10195         * sem_wait.c: Removed.
10196         * sem_trywait.c: Removed.
10197         * sem_timedwait.c: Removed.
10198         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10199         Includes full implementations of sem_post, sem_wait, sem_trywait,
10200         and sem_timedwait.
10201         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10202         for new implementation.
10203         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10204         and waiters fields.
10205
10206         * tst-sem3.c: Improve error message.
10207         * tst-signal3.c: Likewise.
10208
10209         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10210         to tell the kernel about the termination futex and to initialize tid
10211         member.  Don't initialize main_thread.
10212         * descr.h (struct pthread): Remove main_thread member.
10213         * cancelllation.c (__do_cancel): Remove code handling main thread.
10214         The main thread is not special anymore.
10215
10216         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10217         size of the stacks to stack_cache_actsize.
10218
10219         * pt-readv.c: Add missing "defined".
10220         * pt-sigwait.c: Likewise.
10221         * pt-writev.c: Likewise.
10222
10223 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10224
10225         * Versions: Export __connect from libpthread.
10226         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10227
10228         * Makefile (libpthread-routines): Add pt-raise.
10229         * sysdeps/unix/sysv/linux/raise.c: New file.
10230         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10231         * sysdeps/generic/pt-raise.c: New file.
10232
10233         * pthread_cond_init.c: Initialize all data elements of the condvar
10234         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10235
10236         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10237         * pthread_create.c: Likewise.
10238
10239         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10240         * tst-key1.c: New file.
10241         * tst-key2.c: New file.
10242         * tst-key3.c: New file.
10243
10244         * Versions: Export pthread_detach for version GLIBC_2.0.
10245         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10246
10247 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10248
10249         * pthread_key_create.c: Terminate search after an unused key was found.
10250         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10251
10252         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10253         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10254
10255 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10256
10257         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10258         dynamic lookup for errno in PIC.
10259
10260         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10261         release the stack lock as soon as possible.
10262         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10263         the static TLS block.
10264         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10265
10266         * cancellation.c: Renamed from cancelation.c.
10267         * Makefile: Adjust accordingly.
10268         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10269         * cleanup_defer.c: Use CANCELLATION_P.
10270         * pthread_testcancel.c: Likewise.
10271         * descr.h: Fix spelling in comments.
10272         * init.c: Likewise.
10273         * pthread_getattr_np.c: Likewise.
10274         * pthread_getschedparam.c: Likewise.
10275         * pthread_setschedparam.c: Likewise.
10276         * Versions: Likewise.
10277
10278         * pt-pselect.c: New file.
10279         * Makefile (libpthread-routines): Add pt-pselect.
10280         * Versions: Add pselect.
10281
10282         * tst-cancel4.c: New file.
10283         * Makefile (tests): Add tst-cancel4.
10284
10285 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10286
10287         * pthread_mutex_lock.c: Always record lock ownership.
10288         * pthread_mutex_timedlock.c: Likewise.
10289         * pthread_mutex_trylock.c: Likewise.
10290
10291         * pt-readv.c: New file.
10292         * pt-writev.c: New file.
10293         * pt-creat.c: New file.
10294         * pt-msgrcv.c: New file.
10295         * pt-msgsnd.c: New file.
10296         * pt-poll.c: New file.
10297         * pt-select.c: New file.
10298         * pt-sigpause.c: New file.
10299         * pt-sigsuspend.c: New file.
10300         * pt-sigwait.c: New file.
10301         * pt-sigwaitinfo.c: New file.
10302         * pt-waitid.c: New file.
10303         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10304         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10305         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10306         * Versions: Add all the new functions.
10307
10308         * tst-exit1.c: New file.
10309         * Makefile (tests): Add tst-exit1.
10310
10311         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10312
10313 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10314
10315         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10316
10317         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10318         call.  pthread_join is an official cancellation point.
10319         * pthread_timedjoin.c: Likewise.
10320
10321         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10322         and the condvar's mutex are retrieved.
10323         * pthread_cond_timedwait.c: Likewise.
10324         Reported by dice@saros.East.Sun.COM.
10325
10326 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10327
10328         * pthreadP.h: Cut out all type definitions and move them...
10329         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10330         * pthreadP.h: Include <internaltypes.h>.
10331
10332         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10333         performance tweaks.
10334
10335         * sem_trywait.c: Shuffle #includes around to get right order.
10336         * sem_timedwait.c: Likewise.
10337         * sem_post.c: Likewise.
10338         * sem_wait.c: Likewise.
10339
10340         * nptl 0.3 released.
10341
10342         * Makefile (tests): Add tst-signal3.
10343         * tst-signal3.c: New file.
10344
10345 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10346
10347         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10348         the asms modify the sem object.
10349         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10350
10351         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10352         the actual members.
10353         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10354         * semaphoreP.h: Include pthreadP.h.
10355         * sem_getvalue.c: Adjust to sem_t change.
10356         * sem_init.c: Likewise.
10357         * sem_open.c: Likewise.
10358         * sem_post.c: Likewise.
10359         * sem_timedwait.c: Likewise.
10360         * sem_trywait.c: Likewise.
10361         * sem_wait.c: Likewise.
10362
10363 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10364
10365         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10366         * tst-basic2.c: New file.
10367         * tst-exec1.c: New file.
10368         * tst-exec2.c: New file.
10369         * tst-exec3.c: New file.
10370
10371         * tst-fork1.c: Remove extra */.
10372
10373         * nptl 0.2 released.  The API for IA-32 is complete.