* configure.in (add_ons_automatic): New variable, set to yes or no
[glibc.git] / nptl / ChangeLog
blobd9eb8ba453c1b0392b5df8cce965a7d7f6b3ed89
1 2004-08-15  Roland McGrath  <roland@frob.com>
3         * pthread_atfork.c: Update copyright terms including special exception
4         for these trivial files, which are statically linked into executables
5         that use dynamic linking for the significant library code.
7 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
9         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
10         pthread_rwlock_rdlock.
11         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
12         Decrease __nr_readers_queued after reacquiring lock.
13         * sysdeps/pthread/pthread_rwlock_timedrdlock
14         (pthread_rwlock_timedrdlock): Likewise.
15         Reported by Bob Cook <bobcook47@hotmail.com>.
17 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
19         * tst-rwlock14.c (tf): Read main thread handle from *ARG
20         before pthread_barrier_wait.
22 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
24         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
25         Remove unnecessary exception handling data.
27 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
29         [BZ #284]
30         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
31         instead of clockid_t.
33 2004-07-21  Roland McGrath  <roland@redhat.com>
35         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
37 2004-07-19  Roland McGrath  <roland@redhat.com>
39         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
41 2004-07-02  Roland McGrath  <roland@redhat.com>
43         * configure: Don't exit.
45 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
47         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
48         (__pthread_cond_timedwait): Check for invalid nanosecond in
49         timeout value.
51 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
53         * Makefile: Add rules to build and run tst-fini1.
54         * tst-fini1.c: New file.
55         * tst-fini1mod.c: New file.
57 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
59         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
60         if no cancellation support is needed.
61         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
62         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
63         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
64         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
65         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
66         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
67         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
68         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
69         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
71         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
72         only if not already defined.
74 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
76         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
77         constraint "m" instead of "0" for futex.
79         * shlib-versions: Add powerpc64-.*-linux.*.
81 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
83         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
84         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
85         for valid tv_nsec.
86         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
87         1 billion and 64-bit tv_nsec which is valid when truncated to 32
88         bits.
90 2004-06-29  Roland McGrath  <roland@redhat.com>
92         * Banner: NPTL no longer has its own version number.
93         * Makefile (nptl-version): Variable removed.
94         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
95         using $(version), the glibc version number.
97 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
99         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
100         Fix branch offset for a PLT entry.
101         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
102         Likewise.
103         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
104         Likewise.
105         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
106         Likewise.
107         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
108         Likewise.
110 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
112         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
113         unconditionally.
115 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
117         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
118         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
119         instead of tv_sec.
120         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
121         (pthread_rwlock_timedrdlock): Likewise.
123 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
125         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
126         Set __r7 to val, not mutex.
128 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
130         * Makefile: Add rules to build tst-rwlock14.
131         * tst-rwlock14.c: New file.
133 2004-06-24  Boris Hu  <boris.hu@intel.com>
135         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
136         check.
137         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
139 2004-06-19  Andreas Jaeger  <aj@suse.de>
141         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
142         assembler in last patch.
144 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
146         * sysdeps/pthread/pthread_cond_timedwait.c
147         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
148         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
149         (__pthread_cond_timedwait): Check for invalid nanosecond in
150         timeout value.
151         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
152         * tst-cond19.c: New file.
153         * Makefile: Add rules to build and run tst-cond19.
155 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
157         * tst-context1.c (GUARD_PATTERN): Defined.
158         (tst_context_t): Define struct containing ucontext_t & guard words.
159         (ctx): Declare as an array of tst_context_t.
160         (fct): Verify uc_link & guard words are still valid.
161         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
163 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
165         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
166         Add __data.__futex field, reshuffle __data.__clock.
167         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
168         (__pthread_cond_signal): Increment __futex at the same time as
169         __wakeup_seq or __total_seq.  Pass address of __futex instead of
170         address of low 32-bits of __wakeup_seq to futex syscall.
171         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
172         (__pthread_cond_wait): Likewise.  Pass __futex value from before
173         releasing internal lock to FUTEX_WAIT.
174         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
175         (__pthread_cond_timedwait): Likewise.
176         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
177         (FUTEX_CMP_REQUEUE): Define.
178         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
179         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
180         Pass __futex value from before the unlock and __futex address instead
181         of address of low 32-bits of __wakeup_seq to futex syscall.
182         Fallback to FUTEX_WAKE all on any errors.
184 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
186         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
187         comment typo.
188         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
189         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
190         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
191         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
192         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
194 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
196         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
197         Add memory clobber to inline assembly.
198         (__lll_mutex_trylock): Likewise.
199         (__lll_mutex_cond_trylock): Likewise.
201 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
203         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
204         Pass val argument as 6th system call argument in %r7.
206 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
208         * Makefile (tests): Add tst-cond16.
209         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
210         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
211         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
212         Add __data.__futex field, reshuffle __data.__clock.
213         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
214         (__pthread_cond_signal): Increment __futex at the same time as
215         __wakeup_seq or __total_seq.  Pass address of __futex instead of
216         address of low 32-bits of __wakeup_seq to futex syscall.
217         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
218         (__pthread_cond_wait): Likewise.  Pass __futex value from before
219         releasing internal lock to FUTEX_WAIT.
220         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
221         (__pthread_cond_timedwait): Likewise.
222         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
223         (FUTEX_CMP_REQUEUE): Define.
224         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
225         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
226         Pass __futex value from before the unlock and __futex address instead
227         of address of low 32-bits of __wakeup_seq to futex syscall.
228         Fallback to FUTEX_WAKE all on any errors.
229         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
230         Define.
231         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
232         internally.  Return non-zero if error, zero if success.
233         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
234         Add __data.__futex field, reshuffle __data.__clock.
235         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
236         Define.
237         (lll_futex_requeue): Add val argument, return 1 unconditionally
238         for the time being.
239         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
240         Add __data.__futex field, reshuffle __data.__clock.
241         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
242         Define.
243         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
244         internally.  Return non-zero if error, zero if success.
245         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
246         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
247         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
248         Define.
249         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
250         internally.  Return non-zero if error, zero if success.
251         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
252         Add __data.__futex field, reshuffle __data.__clock.
253         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
254         Define.
255         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
256         internally.  Return non-zero if error, zero if success.
257         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
258         Add __data.__futex field, reshuffle __data.__clock.
259         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
260         Add __data.__futex field, reshuffle __data.__clock.
261         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
262         Increment __futex at the same time as __wakeup_seq or __total_seq.
263         Pass address of __futex instead of address of low 32-bits of
264         __wakeup_seq to futex syscall.
265         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
266         Pass __futex value from before releasing internal lock
267         to FUTEX_WAIT.
268         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
269         Likewise.  Avoid unnecessary shadowing of variables.
270         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
271         Set __futex to 2 * __total_seq.  Pass __futex value from before the
272         unlock and __futex address instead of address of low 32-bits of
273         __wakeup_seq to futex_requeue macro, adjust for new return value
274         meaning.
275         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
276         (__pthread_cond_signal): Increment __futex at the same time as
277         __wakeup_seq or __total_seq.  Pass address of __futex instead of
278         address of low 32-bits of __wakeup_seq to futex syscall.
279         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
280         (__pthread_cond_wait): Likewise.  Pass __futex value from before
281         releasing internal lock to FUTEX_WAIT.
282         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
283         (__pthread_cond_timedwait): Likewise.
284         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
285         (FUTEX_CMP_REQUEUE): Define.
286         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
287         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
288         Pass __futex value from before the unlock and __futex address instead
289         of address of low 32-bits of __wakeup_seq to futex syscall.
290         Fallback to FUTEX_WAKE all on any errors.
292 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
294         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
295         Add nop to align the end of critical section.
296         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
298 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
300         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
301         Add __broadcast_seq field.
302         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
303         all waiters as woken with woken_seq and bump broadcast counter.
304         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
305         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
306         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
307         Comment typo fixes.  Avoid returning -ETIMEDOUT.
309 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
311         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
312         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
313         Reported by Kaz Kojima.
315 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
317         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
319 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
321         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
322         __broadcast_seq with bc_seq after acquiring internal lock instead of
323         before it.
325 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
327         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
328         compilation.
329         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
330         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
331         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
332         (pthread_cond_t): Add __data.__broadcast_seq field.
333         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
334         (FRAME_SIZE): Define.
335         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
336         Comment typo fixes.
337         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
338         Define.
339         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
340         typo fixes.
341         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
342         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
343         fixes.
345 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
347         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
348         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
349         Add __broadcast_seq field.
350         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
351         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
352         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
353         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
354         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
355         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
356         all waiters as woken with woken_seq and bump broadcast counter.
357         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
358         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
359         __broadcast_seq field.
360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
361         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
362         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
363         * pthread_cond_init.c: Initialize __broadcast_seq field.
364         * Makefile (tests): Add tst-cond17 and tst-cond18.
365         Add .NOTPARALLEL goal.
366         * tst-cond16.c: New file.  From Jakub.
367         * tst-cond17.c: New file.  From Jakub.
368         * tst-cond18.c: New file.  From Jakub.
370 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
372         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
373         unwind info.
375         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
376         Parametrize frame size.  Correct some unwind info.
377         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
379 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
381         * tst-stack3.c: Note testing functionality beyond POSIX.
383 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
385         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
386         Change conditional from ifdef to if.
388 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
390         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
391         SYSDEP_CANCEL_ERROR): Define.
392         (PSEUDO): Use it.
394 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
396         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
398 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
400         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
402 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
404         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
405         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
406         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
407         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
409 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
411         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
412         thread has all signals blocked.
414 2004-04-18  Andreas Jaeger  <aj@suse.de>
416         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
417         (SEM_VALUE_MAX): Add missing brace.
419 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
421         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
422         in rt subdir.
423         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
424         * sysdeps/pthread/tst-mqueue8x.c: New test.
425         * tst-cancel4.c: Update comment about message queues.
427         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
428         return it_value { 0, 0 }.
429         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
430         like SIGEV_SIGNAL.
431         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
432         assertion for SIGEV_NONE.
433         (thread_attr_compare): Compare all attributes, not just a partial
434         subset.
436 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
438         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
440 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
442         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
443         Just use a plain number.
444         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
445         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
446         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
447         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
448         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
449         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
450         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
452 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
454         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
455         frame info.
456         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
458 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
460         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
461         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
462         of calling sigwaitinfo.
464 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
466         * allocatestack.c (allocate_stack): Set reported_guardsize
467         unconditionally.
468         * pthread_getattr_np.c (pthread_getattr_np): Use
469         reported_guardsize instead of guardsize.
470         * descr.h (struct pthread): Add reported_guardsize field.
472 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
474         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
476 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
478         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
480 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
482         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
483         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
484         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
485         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
486         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
487         Define.
488         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
489         (_POSIX_MESSAGE_PASSING): Define.
490         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
491         (_POSIX_MESSAGE_PASSING): Define.
492         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
493         (_POSIX_MESSAGE_PASSING): Define.
495 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
497         * tst-context1.c (fct): Check whether correct stack is used.
499 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
501         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
502         matching constraints for asm mem parameters.
504         * tst-clock2.c (tf): Don't define unless needed.
506 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
508         * Makefile (link-libc-static): Use $(static-gnulib) instead of
509         $(gnulib).
511 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
513         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
514         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
515         * pthreadP.h: Declare __nptl_deallocate_tsd.
516         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
517         Adjust caller.
519         * Makefile (tests): Add tst-tsd5.
520         * tst-tsd5.c: New file.
522 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
524         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
525         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
526         is SHLIB_COMPAT check.
527         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
528         (__pthread_attr_getaffinity_old): Likewise.
529         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
530         (__pthread_getaffinity_old): Likewise.
531         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
532         (__pthread_setaffinity_old): Likewise.
534 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
536         * allocatestack.c (_make_stacks_executable): Call
537         _dl_make_stack_executable first.
539 2004-03-24  Roland McGrath  <roland@redhat.com>
541         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
542         constraint instead of "0".
544 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
546         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
547         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
549         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
550         code to avoid warning.
552 2004-03-24  Andreas Jaeger  <aj@suse.de>
554         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
555         (__pthread_attr_setaffinity_old): Remove const.
557 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
559         * sysdeps/unix/sysv/linux/smp.h: New file.
560         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
561         * init.c: Define __is_smp.
562         (__pthread_initialize_minimal_internal): Call is_smp_system to
563         initialize __is_smp.
564         * pthreadP.h: Declare __is_smp.
565         Define MAX_ADAPTIVE_COUNT is necessary.
566         * pthread_mutex_init.c: Add comment regarding __spins field.
567         * pthread_mutex_lock.c: Implement adaptive mutex type.
568         * pthread_mutex_timedlock.c: Likewise.
569         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
570         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
571         Add __spins field.
572         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
573         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
574         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
575         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
576         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
577         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
578         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
579         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
580         lll_mutex_cond_trylock.
581         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
582         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
583         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
584         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
585         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
586         Define BUSY_WAIT_NOP.
587         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
588         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
590         * tst-mutex5.c: Add support for testing adaptive mutexes.
591         * tst-mutex7.c: Likewise.
592         * tst-mutex5a.c: New file.
593         * tst-mutex7a.c: New file.
594         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
596         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
597         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
598         vgettimeofday call might destroy the content.
600         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
601         @pause in the loop.
603         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
604         No need to restrict type of ret.  Make it int.  Add comment.
606         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
607         Remove unnecessary setne instruction.
609 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
611         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
612         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
613         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
614         If realloc fails, break out of the loop.
616 2004-03-20  Andreas Jaeger  <aj@suse.de>
618         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
619         (__pthread_setaffinity_old): Fix interface.
620         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
621         (__pthread_getaffinity_old): Likewise.
623         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
624         (__pthread_setaffinity_new): Remove duplicate declaration.
626 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
628         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
629         the return value to a safe register.
630         (CDISABLE): Set the function argument correctly.
632 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
634         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
635         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
636         Rewrite so that only one locked memory operation per round is needed.
637         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
638         (pthread_barrier_wait): After wakeup, release lock only when the
639         last thread stopped using the barrier object.
640         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
641         (__pthread_cond_wait): Don't store mutex address if the current
642         value is ~0l.  Add correct cleanup support and unwind info.
643         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
644         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
645         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
646         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
647         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
648         Add correct cleanup support and unwind info.
649         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
650         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
651         information for syscall wrappers.
653 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
655         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
656         cpusetsize field, remove next.
657         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
658         parameter for size of the CPU set.
659         (pthread_setaffinity_np): Likewise.
660         (pthread_attr_getaffinity_np): Likewise.
661         (pthread_attr_setaffinity_np): Likewise.
662         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
663         interface change, keep compatibility code.
664         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
665         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
666         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
667         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
668         __pthread_getaffinity_np.
669         * Versions: Add version for changed interfaces.
670         * tst-attr3.c: Adjust test for interface change.
671         * pthread_getattr_np.c: Query the kernel about the affinity mask with
672         increasing buffer sizes.
673         * pthread_attr_destroy.c: Remove unused list handling.
674         * pthread_attr_init.c: Likewise.
676 2004-03-17  Roland McGrath  <roland@redhat.com>
678         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
679         first argument to clock_getres so we ever enable kernel timers.
681 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
683         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
685 2004-03-12  Richard Henderson  <rth@redhat.com>
687         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
688         oldvalue from CENABLE to CDISABLE.
690 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
692         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
693         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
694         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
695         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
697 2004-03-11  Richard Henderson  <rth@redhat.com>
699         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
700         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
701         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
703 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
705         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
706         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
707         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
709 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
711         * forward.c (__pthread_cond_broadcast_2_0,
712         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
713         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
714         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
716 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
718         * sysdeps/sh/tcb-offsets.sym: Add PID.
719         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
720         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
722 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
724         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
725         include <sysdep-cancel.h>, vfork is no cancellation point.
726         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
727         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
728         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
730 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
732         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
733         libc_hidden_def.
734         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
735         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
736         Likewise.
737         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
738         Likewise.
739         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
740         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
741         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
742         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
743         of DO_CALL_VIA_BREAK.  Work around a gas problem.
745         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
746         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
747         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
748         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
749         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
750         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
752         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
753         a local register for saving old PID.  Negate PID in parent upon exit.
755         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
756         tcb-offsets.h.
757         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
758         before syscall, set to the old value in the parent afterwards.
759         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
760         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
761         tcb-offsets.h.
762         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
763         before syscall, set to the old value in the parent afterwards.
764         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
765         * sysdeps/s390/tcb-offsets.sym: Add PID.
767         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
768         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
769         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
770         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
771         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
772         * sysdeps/sparc/tcb-offsets.sym: Add PID.
774 2004-03-10  Andreas Schwab  <schwab@suse.de>
776         * sysdeps/ia64/tcb-offsets.sym: Add PID.
777         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
778         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
780 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
782         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
783         * tst-cancel21.c (do_one_test): Likewise.
784         Reported by Gordon Jin <gordon.jin@intel.com>.
786 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
788         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
789         if non-zero and set to INT_MIN if zero.
790         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
791         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
792         (SAVE_PID, RESTORE_PID): Define.
793         (__vfork): Use it.
794         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
795         Use relative path to avoid including NPTL i386/vfork.S.
796         (SAVE_PID, RESTORE_PID): Define.
797         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
798         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
799         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
800         tst-vfork2x.
801         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
802         * tst-vfork1.c: New test.
803         * tst-vfork2.c: New test.
804         * tst-vfork1x.c: New test.
805         * tst-vfork2x.c: New test.
807 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
809         * sysdeps/i386/tcb-offsets.sym: Add PID.
810         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
811         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
812         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
814 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
816         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
818 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
820         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
821         _rtld_global_ro.
823 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
825         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
826         _rtld_global_ro.
828         * tst-once4.c: Remove unnecessary macro definition.
830         * tst-mutex7.c (do_test): Limit thread stack size.
831         * tst-once2.c (do_test): Likewise.
832         * tst-tls3.c (do_test): Likewise.
833         * tst-tls1.c (do_test): Likewise.
834         * tst-signal3.c (do_test): Likewise.
835         * tst-kill6.c (do_test): Likewise.
836         * tst-key4.c (do_test): Likewise.
837         * tst-join4.c (do_test): Likewise.
838         * tst-fork1.c (do_test): Likewise.
839         * tst-context1.c (do_test): Likewise.
840         * tst-cond2.c (do_test): Likewise.
841         * tst-cond10.c (do_test): Likewise.
842         * tst-clock2.c (do_test): Likewise.
843         * tst-cancel10.c (do_test): Likewise.
844         * tst-basic2.c (do_test): Likewise.
845         * tst-barrier4.c (do_test): Likewise.
847 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
849         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
851 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
853         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
854         (__pthread_cond_timedwait): Optimize wakeup test.
855         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
856         (__pthread_cond_wait): Likewise.
857         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
858         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
859         Likewise.
861 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
863         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
864         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
865         the atomic instruction needed.
866         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
867         (__lll_mutex_lock_wait): Likewise.
869 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
871         * Makefile (tests): Add tst-cond14 and tst-cond15.
872         * tst-cond14.c: New file.
873         * tst-cond15.c: New file.
875 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
877         * sysdeps/pthread/createthread.c (create_thread): Remove use of
878         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
879         needs to be implemented differently to be useful.
881 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
883         * pthread_attr_setschedparam.c: Don't test priority against limits
884         here.  Set ATTR_FLAG_SCHED_SET flag.
885         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
886         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
887         from parent thread to child.  If attribute is used and scheduling
888         parameters are not inherited, copy parameters from attribute or
889         compute them.  Check priority value.
890         * pthread_getschedparam.c: If the parameters aren't known yet get
891         them from the kernel.
892         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
893         ATTR_FLAG_POLICY_SET flag for thread.
894         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
895         and ATTR_FLAG_POLICY_SET.
897         * sysdeps/pthread/createthread.c: Use tgkill if possible.
899         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
900         fail if stack address hasn't been set.  Just return 0.
902 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
904         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
905         libpthread for the files in this list.
906         (CFLAGS-tst-unload): Removed.
907         * tst-unload.c (do_test): Don't use complete path for
908         LIBPHREAD_SO.
910         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
911         tst-_res1mod2.
913 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
915         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
916         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
917         operation per round is needed.
918         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
919         (__lll_mutex_lock_wait): Likewise.
921 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
923         * tst-cancel9.c (cleanup): Don't print to stderr.
925 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
927         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
929 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
931         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
932         (__syscall_error_handler2): Call CDISABLE.
933         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
934         (__syscall_error_handler2): Call CDISABLE.
936         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
937         Release lock before the loop, don't reacquire it.
939         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
941 2004-02-19  Andreas Schwab  <schwab@suse.de>
943         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
944         Fix last change.
946 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
948         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
949         (pthread_barrier_wait): After wakeup, release lock only when the
950         last thread stopped using the barrier object.
951         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
952         (pthread_barrier_wait): Likewise.
953         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
954         Likewise.
955         * Makefile (tests): Add tst-barrier4.
956         * tst-barrier4.c: New file.
958         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
959         (__pthread_cond_timedwait): Perform timeout test while holding
960         internal lock to prevent wakeup race.
961         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
962         * sysdeps/pthread/pthread_cond_timedwait.c
963         (__pthread_cond_timedwait): Likewise.
964         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
965         (__pthread_cond_timedwait): Likewise.
967 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
969         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
970         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
971         * Makefile (tests): Add tst-rwlock13.
972         * tst-rwlock13.c: New test.
974 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
976         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
977         (__condvar_tw_cleanup): Little optimization.
978         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
980 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
982         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
983         libpthread as "lib" parameter to SHLIB_COMPAT.
984         (__novmx_siglongjmp): Fix typo in function name.
985         (__novmx_longjmp): Fix typo in function name.
987 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
989         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
990         __builtin_expect.
992         * sysdeps/generic/pt-longjmp.c: Moved to...
993         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
995 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
997         * Makefile (libpthread-routines): Add pt-cleanup.
998         * pt-longjmp.c: Removed.
999         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1000         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1001         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1002         Version longjmp, siglongjmp for GLIBC_2.3.4.
1003         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1005 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1007         * sysdeps/pthread/pthread_cond_timedwait.c
1008         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1009         Reuse code.  Add __builtin_expects.
1011         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1012         (__pthread_cond_timedwait): Get internal lock in case timeout has
1013         passed before the futex syscall.
1014         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1016 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1018         * allocatestack.c: Pretty printing.
1020         * sysdeps/pthread/createthread.c (create_thread): Don't add
1021         CLONE_DETACHED bit if it is not necessary.
1023 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1025         * pthread_getattr_np.c: Include ldsodefs.h.
1027 2004-01-16  Richard Henderson  <rth@redhat.com>
1029         * allocatestack.c: Don't declare __libc_stack_end.
1030         * init.c (__pthread_initialize_minimal_internal): Likewise.
1031         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1033 2004-01-15  Richard Henderson  <rth@redhat.com>
1035         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1036         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1037         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1038         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1039         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1040         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1041         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1042         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1044 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1046         * init.c (pthread_functions): Make array const.
1048 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1050         * allocatestack.c (__make_stacks_executable): Change interface.
1051         Check parameters.  Pass parameter on to libc counterpart.
1052         * pthreadP.h: Change declaration.
1054 2004-01-13  Richard Henderson  <rth@redhat.com>
1056         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1057         prototype form.
1058         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1059         Likewise.
1061         * sysdeps/alpha/Makefile: New file.
1062         * sysdeps/alpha/tcb-offsets.sym: New file.
1063         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1064         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
1066         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
1067         on powerpc version.
1069 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
1071         * Makefile (tests): Add tst-backtrace1.
1072         * tst-backtrace1.c: New test.
1074 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
1076         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
1077         register as second parameter to the REGISTER macro.
1078         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
1079         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
1080         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
1081         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
1082         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
1083         of thread register as second parameter to REGISTER macro in 64 case.
1085 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
1087         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
1088         (CFLAGS-getpid.o): Defined.
1089         (CFLAGS-getpid.os): Defined.
1091 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
1093         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
1094         returned for main thread does not overlap with any other VMA.
1095         Patch by Jakub Jelinek.
1097 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
1099         * tst-raise1.c: Include stdio.h.
1101 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
1103         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
1104         setting with __ASSUME_TGKILL || defined __NR_tgkill.
1105         If pid is 0, set it to selftid.
1106         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
1107         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
1108         != 0, return self->tid without doing a syscall.
1109         * descr.h (struct pthread): Move pid field after tid.
1111         * Makefile (tests): Add tst-raise1.
1112         * tst-raise1.c: New file.
1114 2003-12-23  Roland McGrath  <roland@redhat.com>
1116         * tst-oddstacklimit.c: New file.
1117         * Makefile (tests): Add it.
1118         (tst-oddstacklimit-ENV): New variable.
1120         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
1121         value up to page size for __default_stacksize.
1123 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
1125         * Makefile (tests): Add tst-eintr5.
1126         * tst-eintr5.c: New file.
1128         * eintr.c (eintr_source): Prevent sending signal to self.
1130         * tst-eintr2.c (tf1): Improve error message.
1132 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
1134         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
1135         * sysdeps/unix/sysv/linux/getpid.c: New file.
1136         * pthread_cancel.c: Add comment explaining use of PID field.
1137         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1138         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
1139         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
1140         temporarily to signal the field must not be relied on and updated
1141         by getpid().
1142         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
1143         temporarily negative.
1144         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1146 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
1148         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
1149         (eintr_source): If ARG != NULL, use pthread_kill.
1150         * tst-eintr1.c: Adjust for this change.
1151         * tst-eintr2.c: Likewise.
1152         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
1153         * tst-eintr3.c: New file.
1154         * tst-eintr4.c: New file.
1156 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
1158         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
1159         if CANCELSTATE_BITMASK is set.
1160         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
1161         Likewise.
1163         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
1164         (tests-reverse): Add tst-cancel23.
1165         * tst-cancel22.c: New test.
1166         * tst-cancel23.c: New test.
1168 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
1170         * tst-eintr1.c: Better error messages.
1172         * Makefile (tests): Add tst-eintr2.
1173         * tst-eintr2.c: New file.
1175 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
1177         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
1178         (CFLAGS-tst-cancelx21.c): Set.
1179         * tst-cancel21.c: New test.
1180         * tst-cancelx21.c: New test.
1182         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
1183         comparison operand.
1184         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
1185         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
1186         * pt-longjmp.c: Include jmpbuf-unwind.h.
1187         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
1188         _JMPBUF_UNWINDS.  Adjust compared pointers.
1189         * init.c (__pthread_initialize_minimal_internal): Initialize
1190         pd->stackblock_size.
1191         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
1192         * sysdeps/alpha/jmpbuf-unwind.h: New file.
1193         * sysdeps/i386/jmpbuf-unwind.h: New file.
1194         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
1195         * sysdeps/s390/jmpbuf-unwind.h: New file.
1196         * sysdeps/sh/jmpbuf-unwind.h: New file.
1197         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
1198         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
1199         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
1200         (_JMPBUF_CFA_UNWINDS): Remove.
1201         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
1203 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
1205         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
1206         (CFLAGS-tst-cancelx20.c): Set.
1207         * tst-cancel20.c: New test.
1208         * tst-cancelx20.c: New test.
1210 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
1212         * init.c (__pthread_initialize_minimal_internal): Don't treat
1213         architectures with separate register stack special here when
1214         computing default stack size.
1216 2003-12-17  Roland McGrath  <roland@redhat.com>
1218         * Makefile (tst-cancelx7-ARGS): New variable.
1219         Reportd by Greg Schafer <gschafer@zip.com.au>.
1221 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
1223         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
1224         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
1225         (tst-stack3-ENV): Set.
1226         ($(objpfx)tst-stack3-mem): New.
1227         * tst-stack3.c: New test.
1229 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
1231         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
1232         Add unwind directives.  Drop unused .regstk directive.
1233         (_fini_EPILOG_BEGINS): Add unwind directives.
1235 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
1237         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1238         Assume parameter is a pointer.
1239         (lll_futex_wake): Likewise.
1240         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
1241         Likewise.
1242         (lll_futex_wake): Likewise.
1243         Reported by Boris Hu.
1244         * sysdeps/unix/sysv/linux/unregister-atfork.c
1245         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
1247         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
1249 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
1251         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
1252         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
1253         __rtld_lock_initialize for ld.so lock.
1254         Patch in part by Adam Li <adam.li@intel.com>.
1256 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
1258         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
1259         in $(gnulib).  Also, remove stale comment.
1261 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
1263         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
1264         advantage of new syscall stub and optimize accordingly.
1266         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
1267         from SYS_futex, to match expectations of
1268         sysdep.h:DO_INLINE_SYSCALL.
1269         (lll_futex_clobbers): Remove.
1270         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
1271         (lll_futex_wake): Likewise.
1272         (lll_futex_requeue): Likewise.
1273         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
1274         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
1275         Jelinek).
1276         (__lll_mutex_lock): Likewise.
1277         (__lll_mutex_cond_lock): Likewise.
1278         (__lll_mutex_timed_lock): Likewise.
1279         (__lll_mutex_unlock): Likewise.
1280         (__lll_mutex_unlock_force): Likewise.
1282         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
1283         comes before the include of <sysdep.h>.
1284         (THREAD_SELF_SYSINFO): New macro.
1285         (THREAD_SYSINFO): Likewise.
1286         (INIT_SYSINFO): New macro.
1287         (TLS_INIT_TP): Call INIT_SYSINFO.
1289         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
1291         * sysdeps/pthread/createthread.c (create_thread): Use
1292         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
1293         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
1294         THREAD_SELF_SYSINFO instead of open code.
1295         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
1296         (THREAD_SYSINFO): Likewise.
1298         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
1300         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
1302 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
1304         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
1305         instead of .init.  Patch by David Mosberger.
1307 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
1309         * sysdeps/pthread/configure.in: Remove broken declaration in C
1310         cleanup handling check.
1312 2003-11-30  Andreas Jaeger  <aj@suse.de>
1314         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
1315         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
1316         Likewise.
1318 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
1320         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
1321         * pthread_attr_destroy.c: Include shlib-compat.h.
1322         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
1323         is set in iattr->flags.
1324         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
1326 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
1328         * Makefile (distribute): Add tst-cleanup4aux.c.
1330         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
1331         include.
1333 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
1335         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
1336         pthread_cond_signal.
1338         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
1339         store mutex address if the current value is ~0l.
1340         * sysdeps/pthread/pthread_cond_timedwait.c
1341         (__pthread_cond_timedwait): Likewise.
1342         * sysdeps/pthread/pthread_cond_broadcast.c
1343         (__pthread_cond_broadcast): Don't use requeue for pshared
1344         condvars.
1346         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1347         (__pthread_cond_wait): Don't store mutex address if the current
1348         value is ~0l.
1349         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1350         (__pthread_cond_timedwait): Likewise.
1351         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1352         (__pthread_cond_broadcast): Don't use requeue for pshared
1353         condvars.
1355         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
1356         element with ~0l for pshared condvars, with NULL otherwise.
1358         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1359         (__pthread_cond_wait): Don't store mutex address if the current
1360         value is ~0l.
1361         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1362         (__pthread_cond_timedwait): Likewise.
1363         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1364         (__pthread_cond_broadcast): Don't use requeue for pshared
1365         condvars.
1367         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
1368         * tst-cond12.c: New file.
1369         * tst-cond13.c: New file.
1371 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
1373         * sysdeps/pthread/configure.in: Make missing forced unwind support
1374         fatal.
1376 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
1378         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
1380 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
1382         * Makefile: Add magic to clean up correctly.
1384 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
1386         * unwind.c (FRAME_LEFT): Define.
1387         (unwind_stop): Handle old style cleanups here.
1388         (__pthread_unwind): Handle old style cleanups only if
1389         !HAVE_FORCED_UNWIND.
1390         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
1391         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
1392         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
1393         ($(objpfx)tst-cleanupx4): Likewise.
1394         * tst-cleanup4.c: New test.
1395         * tst-cleanup4aux.c: New.
1396         * tst-cleanupx4.c: New test.
1398 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
1400         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
1401         lll_mutex_*lock macros to skip atomic operations on some archs.
1403 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
1405         * sysdeps/pthread/tst-timer.c (main): Initialize
1406         sigev2.sigev_value as well.
1408 2003-10-15  Roland McGrath  <roland@redhat.com>
1410         * sysdeps/pthread/configure.in: Barf if visibility attribute support
1411         is missing.
1412         * sysdeps/pthread/configure: Regenerated.
1414 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1416         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
1417         locking macros.  No distinction between normal and mutex locking
1418         anymore.
1419         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
1420         Merge bits from lowlevelmutex.S we still need.
1421         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
1422         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
1423         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
1424         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
1425         new mutex implementation.
1426         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
1427         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
1428         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1429         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1430         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1431         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1432         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1433         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1434         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1435         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
1436         symbol for entry point to avoid cancellation.
1438 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
1440         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
1441         changes.
1442         (SAVE_OLDTYPE_0): Fix a typo.
1444 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
1446         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1447         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
1449 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1451         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
1452         correct offset.
1454 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
1456         * Makefile (tests): Add tst-cancel19.
1457         * tst-cancel19.c: New test.
1459 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1461         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
1462         restoring of the old cancellation type.
1464 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
1466         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
1468 2003-09-27  Wolfram Gloger  <wg@malloc.de>
1470         * sysdeps/pthread/malloc-machine.h: New file
1472 2003-09-24  Roland McGrath  <roland@redhat.com>
1474         * allocatestack.c (__make_stacks_executable): Don't ignore return
1475         value from _dl_make_stack_executable.
1477 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
1479         * allocatestack.c (__make_stacks_executable): Also change
1480         permission of the currently unused stacks.
1482         * allocatestack.c (change_stack_perm): Split out from
1483         __make_stacks_executable.
1484         (allocate_stack): If the required permission changed between the time
1485         we started preparing the stack and queueing it, change the permission.
1486         (__make_stacks_executable): Call change_stack_perm.
1488         * Makefile: Build tst-execstack-mod locally.
1489         * tst-execstack-mod.c: New file.
1491 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
1493         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
1495 2003-09-23  Roland McGrath  <roland@redhat.com>
1497         * tst-execstack.c: New file.
1498         * Makefile (tests): Add it.
1499         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
1500         (LDFLAGS-tst-execstack): New variable.
1502         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
1503         whether to use PROT_EXEC for stack mmap.
1504         (__make_stacks_executable): New function.
1505         * pthreadP.h: Declare it.
1506         * init.c (__pthread_initialize_minimal_internal): Set
1507         GL(dl_make_stack_executable_hook) to that.
1509 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1511         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
1512         recommendation from AMD re avoidance of lock prefix.
1514 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
1516         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
1517         lll_futex_timed_wait instead of lll_futex_wait.
1518         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
1519         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
1520         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
1521         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
1522         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
1523         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
1524         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
1525         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
1526         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
1527         Completely revamp the locking macros.  No distinction between
1528         normal and mutex locking anymore.
1529         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1530         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
1531         __lll_lock_timedwait): Fix prototypes.
1532         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
1533         __lll_lock_timedwait): Likewise.
1534         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
1535         macros, add __builtin_expect.
1536         (lll_mutex_timedlock): Likewise.  Fix return value.
1537         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
1538         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
1539         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
1540         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
1541         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
1542         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
1543         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
1544         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
1546 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1548         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1549         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
1550         operation if possible.
1552         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
1553         like jumping over the lock prefix.
1555 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
1557         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
1558         locking macros.  No distinction between normal and mutex locking
1559         anymore.
1560         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1561         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1562         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1563         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
1564         locking.  Merge bits from lowlevelmutex.S we still need.
1565         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1566         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1567         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
1568         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
1569         * Makefile (routines): Remove libc-lowlevelmutex.
1570         (libpthread-rountines): Remove lowlevelmutex.
1571         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
1572         for new mutex implementation.
1573         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1574         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1575         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1576         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1577         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1578         Likewise.
1579         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1580         Likewise.
1581         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1582         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1583         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
1584         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1585         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1586         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1587         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1588         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1589         Likewise.
1590         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1591         Likewise.
1592         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1593         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1594         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1595         Don't use requeue.
1596         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1597         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
1599 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
1601         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
1602         in parameters of asm with output parameters.
1604         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
1605         type of DECR parameter to int.
1606         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
1608 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
1610         * tst-attr3.c (tf, do_test): Print stack start/end/size and
1611         guardsize for each thread.
1613 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1615         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
1616         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1617         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
1619         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1620         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
1621         NULL.
1622         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
1623         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
1624         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1625         (pthread_getaffinity_np): Add hidden_def.
1627         * Makefile (tests): Add tst-attr3.
1628         * tst-attr3.c: New test.
1630         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
1632 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1634         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
1635         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
1637 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1639         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
1640         * tst-align.c: Include tst-stack-align.h.
1641         (tf, do_test): Use TEST_STACK_ALIGN macro.
1643 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
1645         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
1646         variable.
1648 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
1650         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
1651         stack-related values for the initial thread.
1653 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1655         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
1657 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
1659         * pthread_mutex_lock.c: Minor code rearrangements.
1661 2003-09-05  Roland McGrath  <roland@redhat.com>
1663         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
1664         Instead, include ../nptl_db/db_info.c to do its magic.
1665         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
1666         (__pthread_pthread_key_2ndlevel_size): Likewise.
1667         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
1668         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
1669         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
1670         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
1671         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
1672         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
1673         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
1674         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
1675         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
1676         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
1677         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
1678         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
1679         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
1680         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
1681         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
1682         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
1683         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
1685 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
1687         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
1688         of pthread_t to be compatible with LT.
1689         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1690         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1691         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1692         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1693         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1694         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1695         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1697 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
1699         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
1701 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
1703         * unwind-forcedunwind.c: Move to...
1704         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
1705         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
1706         * sysdeps/pthread/jmpbuf-unwind.h: New file.
1707         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
1708         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
1709         * unwind.c: Include jmpbuf-unwind.h.
1710         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
1712 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
1714         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
1715         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
1716         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
1717         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
1718         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1719         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
1720         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
1721         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
1722         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
1723         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
1724         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
1725         function.
1726         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
1727         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
1728         * Makefile (tests): Add tst-stack2.
1729         * tst-stack2.c: New test.
1730         * tst-stack1.c: Include limits.h and sys/param.h.
1731         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
1733         * pthread_condattr_setpshared.c: Include errno.h.
1734         (pthread_condattr_setpshared): Return EINVAL if pshared
1735         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
1737         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
1738         defined symbol for entry point to avoid cancellation.
1739         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
1740         Likewise.
1741         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1742         Likewise.
1743         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
1744         Likewise.
1745         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
1746         Likewise.
1747         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
1748         Likewise.
1749         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
1750         __close_nocancel, __read_nocancel, __write_nocancel,
1751         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
1752         libpthread.so or librt.so, define to corresponding function
1753         without _nocancel suffix.
1754         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
1755         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
1756         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
1758         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
1760 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
1762         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
1763         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
1765         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
1766         in subsections has a symbol associated with it.
1768         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
1769         defined symbol for entry point to avoid cancellation.
1770         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
1772 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1774         * Makefile (tests): Add tst-tls5.
1775         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
1776         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
1777         ($(objpfx)tst-tls5): New.
1778         ($(objpfx)tst-tls6.out): Likewise.
1779         (tests): Depend on $(objpfx)tst-tls6.out.
1780         * tst-tls3.c: Include stdint.h and pthreaddef.h.
1781         (do_test): Check pthread_self () return value alignment.
1782         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
1783         (tf): Check pthread_self () return value alignment.
1784         * tst-tls5.c: New test.
1785         * tst-tls5.h: New.
1786         * tst-tls5mod.c: New.
1787         * tst-tls5moda.c: New.
1788         * tst-tls5modb.c: New.
1789         * tst-tls5modc.c: New.
1790         * tst-tls5modd.c: New.
1791         * tst-tls5mode.c: New.
1792         * tst-tls5modf.c: New.
1793         * tst-tls6.sh: New test.
1795         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
1796         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
1797         * init.c (pthread_functions): Initialize them.
1798         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
1799         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
1800         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
1801         pthread_cond_timedwait@@GLIBC_2.3.2.
1803 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1805         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
1806         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
1807         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
1808         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
1809         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
1810         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1812         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
1814         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
1815         _POSIX_THREAD_PRIORITY_SCHEDULING.
1816         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1818 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
1820         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
1821         nested function, use static inline function from libio.h.
1822         Code by Richard Henderson.
1824         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
1825         weak.
1827 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
1829         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
1830         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
1831         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
1832         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
1833         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
1834         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
1835         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
1836         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
1837         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
1838         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
1839         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
1840         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
1841         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
1842         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
1843         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
1844         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
1845         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
1846         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
1847         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
1848         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
1849         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
1850         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
1851         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
1852         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
1853         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
1854         * sysdeps/sparc/tls.h: New file.
1855         * sysdeps/sparc/tcb-offsets.sym: New file.
1856         * sysdeps/sparc/Makefile: New file.
1857         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
1858         * init.c [__sparc__] (__NR_set_tid_address): Define.
1860 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
1862         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
1863         _IO_release_lock): Define.
1865 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
1867         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
1868         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
1870 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
1872         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
1873         (__pthread_cleanup_class): Add missing return types of member
1874         functions.
1876 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
1878         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1879         (lll_mutex_unlock_force): Add memory barrier between store and futex
1880         syscall.
1882 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
1884         * tst-cancel4.c (do_test): Also unlink tempfname and remove
1885         tempmsg in first loop.
1887 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
1889         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1890         _POSIX_THREAD_PRIORITY_SCHEDULING.
1891         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1893 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
1895         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
1896         (__rtld_lock_default_lock_recursive,
1897         __rtld_lock_default_unlock_recursive): Define.
1898         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
1899         __rtld_lock_unlock_recursive): Define using
1900         GL(_dl_rtld_*lock_recursive).
1901         * init.c (__pthread_initialize_minimal_internal): Initialize
1902         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
1903         Lock GL(_dl_load_lock) the same number of times as
1904         GL(_dl_load_lock) using non-mt implementation was nested.
1906         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
1907         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
1909 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
1911         * tst-cancel17.c (do_test): Make len2 maximum of page size and
1912         PIPE_BUF.
1914 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
1916         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
1918 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
1920         * sysdeps/pthread/createthread.c (do_clone): Move error handling
1921         to first syscall error check.  Move syscall error check for tkill
1922         into __ASSUME_CLONE_STOPPED #ifdef.
1924 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
1926         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
1927         is not defined, do explicit synchronization.
1928         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
1929         is not defined also unlock pd->lock for non-debugging case in case
1930         it is necessary.
1931         * pthread_create.c (start_thread): Always get and release pd->lock
1932         if __ASSUME_CLONE_STOPPED is not defined.
1933         (start_thread_debug): Removed.  Adjust users.
1934         * allocatestack.c (allocate_stack): Always initialize lock if
1935         __ASSUME_CLONE_STOPPED is not defined.
1936         * Makefile (tests): Add tst-sched1.
1937         * tst-sched1.c: New file.
1939         * sysdeps/pthread/createthread.c (do_clone): Only use
1940         sched_setschduler and pass correct parameters.
1942 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
1944         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
1945         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
1946         PTHREAD_STACK_MIN in comments.
1948 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
1950         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1951         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
1952         argument.
1953         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
1954         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
1955         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
1956         (__pthread_cleanup_upto): Fix prototype.
1957         (_longjmp_unwind): Adjust caller.
1958         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
1959         Change second argument to const struct pointer.
1960         * tst-sem8.c (main): Remove unused s2 and s3 variables.
1961         * tst-sem9.c (main): Likewise.
1962         * unwind.c: Include string.h for strlen prototype.
1964 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
1966         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1967         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
1968         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
1969         Define HAVE_CMOV.
1970         Patch by Nicholas Miell <nmiell@attbi.com>.
1972 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
1974         * init.c (__pthread_initialize_minimal_internal): Initialize
1975         GL(dl_init_static_tls).
1976         * pthreadP.h (__pthread_init_static_tls): New prototype.
1977         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
1978         New functions.
1979         * Makefile (tests): Add tst-tls4.
1980         (modules-names): Add tst-tls4moda and tst-tls4modb.
1981         ($(objpfx)tst-tls4): Link against libdl and libpthread.
1982         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
1983         tst-tls4modb.so.
1984         * tst-tls4.c: New file.
1985         * tst-tls4moda.c: New file.
1986         * tst-tls4modb.c: New file.
1988 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
1990         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
1991         before __timer_dealloc.
1992         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
1993         Don't call list_unlink.
1995 2003-07-29  Roland McGrath  <roland@redhat.com>
1997         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
1999 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2001         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2002         Don't reuse struct aiocb A if it failed.
2003         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2004         not just one byte, as that does not block.
2006 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2008         * sysdeps/pthread/unwind-resume.c: New file.
2009         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2010         unwind-resume in csu subdir.
2011         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2012         exceptions.
2013         (librt-sysdep_routines, librt-shared-only-routines): Add
2014         rt-unwind-resume.
2015         * sysdeps/pthread/rt-unwind-resume.c: New file.
2016         * unwind-forcedunwind.c: New file.
2017         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2018         (libpthread-shared-only-routines): Likewise.
2019         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2020         * pthreadP.h (pthread_cancel_init): New prototype.
2021         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2023         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2024         attr argument const struct pthread_attr *.
2026         * res.c (__res_state): Return __resp.
2027         * descr.h: Include resolv.h.
2028         (struct pthread): Add res field.
2029         * pthread_create.c: Include resolv.h.
2030         (start_thread): Initialize __resp.
2031         * Makefile (tests): Add tst-_res1.
2032         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2033         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2034         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2035         libpthread.
2036         * tst-_res1.c: New file.
2037         * tst-_res1mod1.c: New file.
2038         * tst-_res1mod2.c: New file.
2040 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2042         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2044         * Makefile: Define various *-no-z-defs variables for test DSOs
2045         which has undefined symbols.
2047 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2049         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2050         Retry if the stwcx fails to store once_control.
2052 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2054         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2055         pthread_attr_setaffinity.
2056         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2057         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2058         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2059         * pthread_attr_destroy.c: Free cpuset element if allocated.
2060         * pthread_create.c: Pass iattr as additional parameter to
2061         create_thread.
2062         * sysdeps/pthread/createthread.c: If attribute is provided and
2063         a new thread is created with affinity set or scheduling parameters,
2064         start thread with CLONE_STOPPED.
2065         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
2066         pthread_attr_setaffinity.
2067         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2068         cpuset element.
2070 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
2072         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2074 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
2076         * sysdeps/pthread/configure.in: Require CFI directives also for
2077         ppc and s390.
2079 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
2081         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2082         Add cfi directives.
2084 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2086         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
2087         CLEANUP_JMP_BUF.
2088         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
2089         registers as variables.  Call __pthread_mutex_unlock_usercnt.
2090         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2091         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
2092         not self pointer in __writer.  Compare with TID to determine
2093         deadlocks.
2094         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2095         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2096         Likewise.
2097         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2098         Likewise.
2099         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
2100         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2101         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
2102         macros also when compiling librt.
2104 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
2106         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
2107         -fasynchronous-unwind-tables.
2108         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2109         (PSEUDO): Add cfi directives.
2110         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
2111         Likewise.
2112         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2113         Likewise.
2115 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
2117         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
2118         __pthread_unregister_cancel): Add prototypes and hidden_proto.
2119         * unwind.c (__pthread_unwind_next): Add hidden_def.
2120         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
2121         Likewise.
2122         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2123         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2124         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2125         Likewise.
2126         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
2127         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2128         Likewise.
2129         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
2130         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
2131         __pthread_unregister_cancel and __pthread_unwind_next.
2133 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
2135         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
2136         different symbol for the cancellation syscall wrapper and
2137         non-cancellation syscall wrapper.
2138         (PSEUDO_END): Define.
2140 2003-07-05  Richard Henderson  <rth@redhat.com>
2142         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
2143         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
2144         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2145         return actual return value from the syscall, not 0.
2147 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
2149         * descr.h (struct pthread): Add pid field.
2150         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
2151         (__reclaim_stacks): Likewise.
2152         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
2153         also check for PID of the signal source.
2154         (__pthread_initialize_minimal_internal): Also initialize pid field
2155         of initial thread's descriptor.
2156         * pthread_cancel.c: Use tgkill instead of tkill if possible.
2157         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2158         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
2159         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2160         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2162 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
2164         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
2165         Fix use of parameter.
2166         (__libc_cleanup_pop): Likewise.
2168 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
2170         * init.c (sigcancel_handler): Change parameters to match handler
2171         for SA_SIGACTION.  Check signal number and code to recognize
2172         invalid invocations.
2174 2003-07-03  Roland McGrath  <roland@redhat.com>
2176         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
2177         Apply sizeof (struct pthread) bias to r13 value.
2179 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
2181         * sysdeps/pthread/configure.in: Require CFI directives.
2183         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
2184         definition.
2185         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
2186         libpthread compilation.
2187         * unwind.c (__pthread_unwind): Add hidden_def.
2188         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2190 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2192         * libc-cancellation.c (__libc_cleanup_routine): Define.
2193         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
2194         (__pthread_cleanup_pop): Define.
2196 2003-07-01  Richard Henderson  <rth@redhat.com>
2198         * sysdeps/alpha/elf/pt-initfini.c: New file.
2199         * sysdeps/alpha/pthread_spin_lock.S: New file.
2200         * sysdeps/alpha/pthread_spin_trylock.S: New file.
2201         * sysdeps/alpha/pthreaddef.h: New file.
2202         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
2203         * sysdeps/alpha/tls.h: New file.
2204         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
2205         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
2206         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
2207         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
2208         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
2209         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
2210         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
2211         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
2212         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
2213         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2215 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2217         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
2218         cleanup support and unwind info.
2220 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
2222         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2223         Use correct cleanup handler registration.  Add unwind info.
2224         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
2225         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
2226         * tst-once3.c: Add cleanup handler and check it is called.
2227         * tst-once4.c: Likewise.
2228         * tst-oncex3.c: New file.
2229         * tst-oncex4.c: New file.
2230         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2232 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
2234         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2236 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
2238         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
2239         (tf_msgsnd): Likewise.
2241         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
2242         premature returns a bit more.
2244 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
2246         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
2247         definition to the front.
2249         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
2250         the cleanup functions to make the names unique.  Fix dwarf opcode
2251         un unwind table.
2252         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
2253         functions to make the names unique.  Fix CFA offset for two blocks.
2255 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
2257         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
2258         missing closing braces.
2259         Patch by Christophe Saout <christophe@saout.de>.
2261 2003-06-24  Roland McGrath  <roland@redhat.com>
2263         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2265 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
2267         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
2268         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
2270         * pthreadP.h: Declare __find_thread_by_id.
2271         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
2272         * pthread_clock_gettime.c: Allow using other thread's clock.
2273         * pthread_clock_settime.c: Likewise.
2274         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2275         * Makefile: Add rules to build and run tst-clock2.
2276         * tst-clock2.c: New file.
2278 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
2280         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
2281         to use exception-based cleanup handler.
2282         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2284         * tst-cond8.c (ch): Announce that we are done.
2286         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
2288         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
2289         Also test aio_suspend with timeout value.
2291 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
2293         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
2294         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
2295         attribute_hidden.
2297         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
2298         (__pthread_mutex_lock_internal): Likewise.
2299         (__pthread_mutex_unlock_internal): Likewise.
2300         (__pthread_mutex_unlock_usercnt): Declare.
2301         * pthread_mutex_destroy.c: Always fail if used in any way.
2302         * pthread_mutex_init.c: Update comment.
2303         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
2304         * pthread_mutex_timedlock.c: Adjust __nusers.
2305         * pthread_mutex_trylock.c: Adjust __nusers.
2306         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
2307         and public interfaces are wrapper with pass additional parameter.
2308         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
2309         parameter zero.
2310         * tst-mutex8.c: New file.
2311         * Makefile (tests): Add tst-mutex8.
2312         * sysdeps/pthread/pthread_cond_timedwait.c: Call
2313         __pthread_mutex_unlock_usercnt.
2314         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2315         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2316         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2317         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2318         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2319         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
2320         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2321         Add __nusers.
2322         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2323         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2324         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2325         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2326         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2328         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
2329         * pthread_mutex_timedlock.c: Likewise.
2330         * pthread_mutex_trylock.c: Adjust __nusers.
2331         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
2332         * tst-mutex9.c: New file.
2333         * Makefile (tests): Add tst-mutex9.
2334         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
2335         * sysdeps/ia64/tls.h: Likewise.
2336         * sysdeps/powerpc/tls.h: Likewise.
2337         * sysdeps/s390/tls.h: Likewise.
2338         * sysdeps/sh/tls.h: Likewise.
2339         * sysdeps/x86_64/tls.h: Likewise.
2340         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2341         Change type of __owner.
2342         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2343         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2344         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2345         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2346         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2348 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
2350         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
2351         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
2353         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
2354         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
2355         instead of nr to lll_futex_wake.  Only set errno and return -1
2356         if err < 0.
2358         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
2359         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2360         return actual return value from the syscall, not 0.
2362 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
2364         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
2365         find a random value.
2366         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
2367         errno==EIDRM.
2369         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
2370         compat_timer_settime.
2371         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
2372         compat_timer_gettime.
2373         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
2374         compat_timer_getoverrun.
2375         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
2376         compat_timer_delete.
2378         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
2379         error-checking mutex detect busy mutexes.
2381 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2383         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
2384         Add ax to clobber list.
2385         (lll_mutex_cond_lock): Likewise.
2386         (lll_mutex_unlock): Likewise.
2387         (lll_lock): Likewise.
2388         (lll_unlock): Likewise.
2390         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
2391         * tst-cancel18.c: New file.
2392         * tst-cancelx18.c: New file.
2394         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
2395         and tcdrain.
2397         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
2398         * tst-cancel17.c: New file.
2399         * tst-cancelx17.c: New file.
2401         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
2402         * sysdeps/unix/sysv/linux/sigwait.c: New file.
2403         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
2405         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
2407 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
2409         * sysdeps/pthread/createthread.c (create_thread): Set
2410         header.multiple_threads unconditionally.
2411         * allocatestack.c (allocate_stack): Likewise.
2412         * descr.h (struct pthread): Add header.multiple_threads
2413         unconditionally.
2414         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
2415         Define for librt.  #error if neither libpthread, libc nor librt.
2416         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
2417         Likewise.
2418         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
2419         CDISABLE): Likewise.
2420         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
2421         CDISABLE): Likewise.
2422         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
2423         CDISABLE): Likewise.
2424         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
2425         CDISABLE): Likewise.  Access header.multiple_threads outside of
2426         libc and libpthread.
2427         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
2428         Likewise.
2429         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
2430         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
2432 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2434         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
2435         Also test early cancellation before the thread reaches the cancellation
2436         point.
2438         * Makefile: Compile forward.c with exceptions.
2440         * sysdeps/unix/sysv/linux/sleep.c: New file.
2442 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
2444         * Makefile: Add CFLAGS definition to compile function wrappers
2445         duplicated from libc with exceptions.
2446         * tst-cancel4.c: Also check cancellation handlers.
2448         * Makefile: Add rules to build and run tst-cancel16 and
2449         tst-cancelx16.  Add missing CFLAGS definitions.
2450         * tst-cancel16.c: New file.
2451         * tst-cancelx16.c: New file.
2453 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
2455         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2456         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
2457         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2458         (DL_SYSINFO_IMPLEMENTATION): Likewise.
2460         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
2461         (LIBC_CANCEL_RESET): Likewise.
2462         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
2463         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
2464         librt-cancellation.
2465         (CFLAGS-libcrt-cancellation.c): Define.
2466         * sysdeps/pthread/librt-cancellation.c: New file.
2467         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
2468         macros also when compiling librt.
2469         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2470         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2471         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2472         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2473         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2474         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2475         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2477         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
2478         compat_timer_create.
2480 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
2482         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
2484         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2485         __register_atfork.
2486         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
2487         Add libc_hidden_def.
2489 2003-06-13  Roland McGrath  <roland@redhat.com>
2491         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
2492         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
2494 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
2496         * allocatestack.c (queue_stack): Always inline.
2497         * ptreadhP.h (__do_cancel): Likewise.
2499 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
2501         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
2502         a typo.
2504 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
2506         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2507         (__pthread_cond_signal): Remove incorrect second addition for
2508         cond_lock!=0.
2510 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
2512         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2513         (__pthread_cond_signal): Use correct futex pointer in
2514         __lll_mutex_lock_wait call.
2516         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2517         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
2519 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
2521         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
2522         cancelable.
2523         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2524         Likewise.
2526         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
2527         hand-written CFI generation code.  Since ENTRY/END also initiated
2528         CFI frames this caused two CFI sets to be generated.
2530 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
2532         * cleanup_routine.c: New file.
2533         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
2534         * sysdeps/pthread/pthread.h: Add support for fully exception-based
2535         cleanup handling.
2536         * Makefile (libpthread-routines): Add cleanup_routine.
2537         Add more CFLAGS variables to compile with exceptions.  Add comments
2538         why which file needs unwind tables.
2539         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
2540         tests.
2541         * tst-cancelx1.c: New file.
2542         * tst-cancelx2.c: New file.
2543         * tst-cancelx3.c: New file.
2544         * tst-cancelx4.c: New file.
2545         * tst-cancelx5.c: New file.
2546         * tst-cancelx6.c: New file.
2547         * tst-cancelx7.c: New file.
2548         * tst-cancelx8.c: New file.
2549         * tst-cancelx9.c: New file.
2550         * tst-cancelx10.c: New file.
2551         * tst-cancelx11.c: New file.
2552         * tst-cancelx12.c: New file.
2553         * tst-cancelx13.c: New file.
2554         * tst-cancelx14.c: New file.
2555         * tst-cancelx15.c: New file.
2556         * tst-cleanupx0.c: New file.
2557         * tst-cleanupx0.expect: New file.
2558         * tst-cleanupx1.c: New file.
2559         * tst-cleanupx2.c: New file.
2560         * tst-cleanupx3.c: New file.
2562         * tst-cleanup0.c: Make standard compliant.
2563         * tst-cleanup1.c: Likewise.
2565         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
2566         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2567         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2568         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2569         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2570         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2571         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
2572         CLEANUP_JMP_BUF.
2573         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2574         * tst-cancel12.c: New file.
2575         * tst-cancel13.c: New file.
2576         * tst-cancel14.c: New file.
2577         * tst-cancel15.c: New file.
2578         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
2579         and tst-cancel15.
2581         * tst-cancel1.c: Add some comments.
2583         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
2584         timeout correctly.
2586 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
2588         * Makefile (CFLAGS-pthread_cancel.c): Define.
2590 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
2592         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
2593         Change type of __writer element to int.
2594         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2595         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2596         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2597         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2598         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2599         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
2600         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2601         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
2602         Compare with TID to determine deadlocks.
2603         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2604         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2605         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
2606         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2607         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2608         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2609         Likewise.
2610         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2611         Likewise.
2612         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2613         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2614         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2615         Likewise.
2616         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2617         Likewise.
2618         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2619         * Makefile (tests): Add tst-rwlock12.
2620         * tst-rwlock12.c: New file.
2622 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
2624         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
2625         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
2626         Remove bogus hidden_proto.
2627         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2628         Likewise.
2629         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
2630         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
2631         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
2632         ___lll_mutex_timedlock): Likewise.
2634 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
2636         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2637         (__pthread_cond_signal): Add some code to eventually handle
2638         cond_lock!=0.
2640 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
2642         * Makefile (tests): Add tst-exec4.
2643         (tst-exec4-ARGS): Define.
2644         * tst-exec4.c: New file.
2646 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
2648         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2649         Also fail if tv_nsec < 0.
2650         (__lll_timedwait_tid): Likewise.
2651         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
2652         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
2653         Likewise.
2654         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
2655         Likewise.
2656         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
2657         Likewise.
2658         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2659         Likewise.
2660         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
2661         Likewise.
2662         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
2663         Likewise.
2665         * Makefile (tests): Add tst-sem8 and tst-sem9.
2666         * tst-sem8.c: New file.
2667         * tst-sem9.c: New file.
2668         * sem_open.c: Fix creation of in_use record if the file exists but
2669         no internal record.
2671         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
2672         definitions.
2674         * sysdeps/pthread/timer_create.c (timer_create): In case
2675         evp==NULL, assign timer ID to sival_ptr.
2677         * descr.h (struct pthread_unwind_buf): Change type of prev element to
2678         struct pthread_unwind_buf *.
2679         (struct pthread): Likewise for cleanup_jmp_buf element.
2681         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
2682         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
2683         * unwind.c (__pthread_unwind_next): Likewise.
2685 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2687         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2688         (lll_futex_timed_wait): Use int for futex value parameter.
2689         (lll_futex_wake): Likewise.
2690         (lll_futex_requeue): Likewise.
2692         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2693         Replace one memory operation with one register operation.
2695         * tst-join4.c (do_test): Fix error message.
2697         * tst-rwlock6.c (do_test): Use correct format specifier.
2699         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2700         (__lll_mutex_lock_wait): Replace one memory operation with one
2701         register operation.
2702         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
2703         (__lll_mutex_lock_wait): Likewise.
2705         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2706         (__lll_mutex_cond_lock): Add one to value parameter of
2707         __lll_lock_wait to reflect reality in the futex syscall.
2708         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2709         (lll_mutex_cond_lock): Likewise.
2711 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2713         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
2714         New function.
2715         (lll_mutex_cond_lock): Define.
2717 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
2719         * Makefile (tests): Add tst-signal6.
2720         * tst-signal6.c: New file.
2722         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
2723         (__lll_mutex_unlock_force): New function
2724         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2726         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2727         (__lll_mutex_unlock_force): New function.
2728         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2730         * tst-rwlock7.c (do_test): Use correct format specifier.
2732         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
2733         Find break parameter in correct asm argument.
2735 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
2737         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
2738         Remove out4.
2739         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
2740         error occured.
2741         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2742         Add __mutex.
2743         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
2744         lll_futex_requeue, lll_mutex_unlock_force): Define.
2746 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2748         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2749         (pthread_cond_t): Add __mutex.
2750         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
2751         lll_futex_requeue, lll_mutex_unlock_force): Define.
2753 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2755         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
2756         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2757         Add __mutex field.
2758         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
2759         Define.
2760         (lll_futex_wait, lll_futex_wake): Define.
2761         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
2762         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
2763         FUTEX_REQUEUE instead of FUTEX_WAIT.
2764         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2765         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
2766         mutex which was used in condvar structure.  Call
2767         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
2768         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2770         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
2771         include tcb-offsets.h.  Read wakeup value in locked region.
2772         Use the value of gbr register as THREAD_ID.
2773         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2774         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2775         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2777         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
2778         macros.
2780 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
2782         * sysdeps/pthread/pthread_cond_broadcast.c
2783         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
2785 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
2787         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
2788         typo in register name.
2789         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
2790         correctly.  Actually use requeue.  Little optimization.
2791         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
2792         mutex address early.  Handle cancellation state as 32-bit value.
2793         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2794         Remove unnecessary label.
2796 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
2798         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
2799         instead of FUTEX_WAIT.
2800         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
2801         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2802         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2803         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2804         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2805         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
2806         used in condvar structure.  Call __pthread_mutex_cond_lock instead
2807         of __pthread_mutex_lock_internal.
2808         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2809         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2810         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2811         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
2812         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2813         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2814         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
2815         Add pthread_mutex_cond_lock.
2816         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
2817         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
2818         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
2819         lll_mutex_cond_lock.
2820         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2821         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2822         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2823         Add __mutex field.
2824         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2825         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2827         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
2828         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2830         * pthreadP.h: Declare __pthread_mutex_cond_lock.
2831         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
2832         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
2833         macro don't define aliases.
2835         * cancellation.c: Remove __pthread_enable_asynccancel_2.
2836         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
2837         * sysdeps/pthread/pthread_cond_timedwait.c: Use
2838         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
2839         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2840         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2841         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2842         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2843         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2845 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
2847         * sem_open.c: Fix one endless loop.  Implement correct semantics
2848         wrt opening the same semaphore more then once.
2849         * sem_close.c: Adjust for sem_open change.
2850         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
2851         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
2852         * Makefile (tests): Add tst-sem7.
2853         * tst-sem7.c: New file.
2855 2003-05-16  Roland McGrath  <roland@redhat.com>
2857         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
2858         uninitialized variable braino.
2860 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
2862         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
2863         test for syscall availability.
2865         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
2866         __no_posix_timers to -1 if the syscalls don't exist.
2868         * pthread_join.c (pthread_join): Set tid field of the joined
2869         thread to -1.  This isn't necessary but helps to recognize some
2870         error conditions with almost no cost.
2872         * allocatestack.c (FREE_P): Also negative values indicate an
2873         unused stack.
2875         * unwind.c: Include <unistd.h>.
2877 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
2879         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
2881 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
2883         * Makefile (crti-objs, crtn-objs): New variables.
2884         (omit-deps, extra-objs): Add crtn.
2885         ($(objpfx)libpthread.so): Depend on both crti and crtn
2886         and links to them in multidir.
2887         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
2889 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
2891         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2892         (lll_mutex_unlock): Use atomic_exchange_rel.
2894 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
2896         * cond-perf.c (cons): Add missing locking around setting of alldone.
2898 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
2900         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
2901         related macros.
2902         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2904 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
2906         * tst-sem6.c: New file.
2907         * Makefile (tests): Add tst-sem6.
2909         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
2910         Use atomic_exchange_rel instead of atomic_exchange.
2911         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
2912         Likewise.
2914         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
2915         code for lll_futex_wait and lll_futex_wake in static apps.  Use
2916         vsyscall is possible.
2918         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
2919         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
2920         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
2921         pthread_setaffinity_np.
2922         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
2923         and pthread_setaffinity_np.
2924         * Makefile (libpthread-routines): Add pthread_getaffinity and
2925         pthread_setaffinity.
2927         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
2928         use it in case mmap to allocate the stack fails.
2929         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
2930         ARCH_MAP_FLAGS here.
2931         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
2932         ARCH_RETRY_MMAP.
2934 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
2936         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
2937         handler implementation.  It is now lockless in fork().
2938         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2939         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2940         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
2941         declare the __fork_*_lists.
2942         (struct fork_handler): Include pointers to all three functions.
2943         Add next, refcntr and need_signal elements.
2944         (__fork_handlers): New declaration.
2945         (__register_atfork_malloc): Remove declaration.
2946         (HAVE_register_atfork_malloc): Remove definition.
2947         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
2948         __pthread_child_handler variable.
2949         (__libc_pthread_init): Use __register_atfork instead of explicitly
2950         adding to the list.
2951         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
2952         and lll_futex_wake.
2953         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2955         * unwind.c (unwind_cleanup): Print error message and then abort.  This
2956         function must never be reached.
2958         * cond-perf.c: New file.
2960 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
2962         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
2964 2003-05-04  Roland McGrath  <roland@redhat.com>
2966         * Makefile ($(objpfx)../libc.so): New target.
2968 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
2970         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2971         (pthread_condattr_t): Size is only an int, don't use long for
2972         alignment.
2973         (pthread_mutexattr_t): Likewise.
2974         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2975         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2976         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2978 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
2980         * sysdeps/i386/tls.h: Define THREAD_ID.
2981         * sysdeps/ia64/tls.h: Likewise.
2982         * sysdeps/powerpc/tls.h: Likewise.
2983         * sysdeps/s390/tls.h: Likewise.
2984         * sysdeps/sh/tls.h: Likewise.
2985         * sysdeps/x86_64/tls.h: Likewise.
2986         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
2987         record ownership.
2988         * pthread_mutex_timedlock.c: Likewise.
2989         * pthread_mutex_trylock.c: Likewise.
2990         * pthread_mutex_unlock.c: Likewise.
2991         * pthread_rwlock_trywrlock.c: Likewise.
2992         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
2993         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2994         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2995         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2997         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
2998         flag.
3000 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3002         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3003         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3004         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3005         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3006         Make __align long long instead of long.
3007         (pthread_rwlock_t): Formatting.
3008         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3009         (pthread_rwlock_t): Formatting.
3010         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3011         (pthread_cond_t): Make __align long long instead of long.
3012         (pthread_rwlock_t): Move __flags field to the same position as in
3013         linuxthreads.
3015 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3017         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3018         * tst-rwlock7.c (do_test): Likewise.
3020 2003-04-26  Roland McGrath  <roland@redhat.com>
3022         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3024 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3026         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3027         sizeof (struct pthread).
3028         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3029         1 struct pthread.
3030         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3031         to 0.
3032         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3033         struct pthread.
3034         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3035         to 32-bit bytes.
3036         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3037         tcbp.
3038         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3039         unneccessarily.
3040         (NO_TLS_OFFSET): Define.
3041         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3042         add TLS_TCB_SIZE unnecessarily.
3044 2003-04-22  Roland McGrath  <roland@redhat.com>
3046         * Makeconfig (shared-thread-library): Reverse link order to work
3047         around linker bug.
3049 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3051         * semaphore.h: Fix typo in comment.
3053 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3055         * sysdeps/pthread/sigfillset.c: New file.
3057         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3058         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3059         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3060         * sysdeps/pthread/sigaction.c: Likewise.
3061         * sysdeps/pthread/sigprocmask.c: New file.
3062         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3063         __SIGRTMIN+1.
3064         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3065         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
3066         in this case.
3068 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
3070         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3071         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
3073         * sysdeps/unix/sysv/linux/unregister-atfork.c
3074         (__unregister_atfork): Don't free memory not allocated dynamically.
3076         * semaphore.h: Remove __THROW marker from cancellation points.
3077         * nptl/sysdeps/pthread/pthread.h: Likewise.
3079 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
3081         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
3082         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
3083         __THROW.
3085 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3087         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
3089 2003-04-15  Roland McGrath  <roland@redhat.com>
3091         * forward.c (__pthread_unwind): Tweak to avoid warning.
3093 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
3095         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
3097 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
3099         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
3100         overflow CFA advance instructions.
3101         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3103 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
3105         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
3106         * sysdeps/i386/pthread_spin_lock.c: Likewise.
3107         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
3108         defined.
3110         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
3111         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
3112         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
3113         DW_CFA_advance_loc for .Laddl-.Lsubl.
3115 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
3117         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
3118         position-independent unwind data for static libraries.
3119         Add missing unwind info.  Add comments.
3121         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
3122         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3123         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3124         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3126 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
3128         * Makefile: Make sure all cancellation points are compiled with
3129         exception and asynchronous unwind tables.
3131         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
3132         which mishandles loading of global object addresses in PIC.
3133         (THREAD_SETMEM_NC): Likewise.
3135 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3137         * pthread.h: Define new data structure for cleanup buffer.  Declare
3138         new cleanup handler interfaces.
3139         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
3140         (struct pthread): Add cleanup_jmp_buf pointer.  Define
3141         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
3142         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
3143         it.  Declare old cleanup handler installation functions.
3144         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
3145         handling.
3146         * cleanup_defer.c: Likewise.
3147         * cleanup_compat.c: New file.  Old cleanup code.
3148         * cleanup_def_compat.c: New file.  Old cleanup code.
3149         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
3150         if own thread descriptor.
3151         * unwind.c: New file.
3152         * forward.c: Add __pthread_unwind.
3153         * init.c (pthread_functions): Add __pthread_unwind.
3154         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
3155         Add ptr___pthread_unwind.
3156         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
3157         and unwind function.
3158         * Makefile (libpthread-routines): Add cleanup_compat,
3159         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
3160         table generation if necessary.
3161         * version.c: Record whether unwind support is compiled in.
3162         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
3163         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
3164         handler interfaces.
3165         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
3166         complication to generate unwind information for syscall wrappers.
3167         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3168         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3169         __cleanup_fct_attribute.
3171         * Makefile: Add rules to build and run tst-cleanup0.
3172         * tst-cleanup0.c: New file.
3173         * tst-cleanup0.expect: New file.
3175         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
3176         caller.  Optimize to avoid often unecessary local variable.
3178 2003-04-11  Roland McGrath  <roland@redhat.com>
3180         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
3181         sets variable `multidir'; include that.
3182         (generated): Add it.
3183         ($(objpfx)$(multidir)/crti.o): New target.
3184         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
3186 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3188         * tst-attr2.c (do_test): Add cast to avoid warning.
3189         * tst-mutex4.c (do_test): Likewise.
3191 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
3193         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
3194         in child.
3196 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
3198         * Makefile (tests): Add tst-detach1.
3199         * tst-detach1.c: New file.
3201 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
3203         * sysdeps/pthread/pthread.h: Remove duplicate
3204         pthread_cleanup_{push,pop} definitions.
3206         * tst-barrier2.c: Eliminate warnings.
3207         * tst-cancel4.c: Likewise.
3208         * tst-cond4.c: Likewise.
3209         * tst-cond6.c: Likewise.
3210         * tst-detach1.c: Likewise.
3211         * tst-rwlock4.c: Likewise.
3212         * tst-rwlock6.c: Likewise.
3213         * tst-rwlock7.c: Likewise.
3214         * tst-sem3.c: Likewise.
3215         * tst-spin2.c: Likewise.
3216         * tst-umask1.c: Likewise.
3218 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
3220         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
3222 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
3224         * descr.h (struct pthread): Move cancelhandling member to the front.
3226 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
3228         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
3229         malloc_parent, and malloc_child statically.
3230         (__register_atfork_malloc): New function.
3231         (free_mem): Don't free any of the malloc_* variables on the list.
3232         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
3233         Define HAVE_register_atfork_malloc.
3235 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
3237         * sysdeps/pthread/createthread.c (create_thread): Add some more
3238         comments explaining when to set multiple_threads and when not.
3240         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3241         THREAD_ATOMIC_BIT_SET if not already defined.
3242         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3243         THREAD_ATOMIC_BIT_SET:
3244         * sysdeps/x86_64/tls.h: Likewise.
3245         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
3246         THREAD_ATOMIC_CMPXCHG_VAL.
3247         (_pthread_cleanup_pop_restore): Likewise.
3248         * cancellation.c (__pthread_enable_asynccancel): Likewise.
3249         (__pthread_enable_asynccancel_2): Likewise.
3250         (__pthread_disable_asynccancel): Likewise.
3251         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3252         (__libc_disable_asynccancel): Likewise.
3253         * init.c (sigcancel_handler): Likewise.
3254         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
3255         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
3257 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
3259         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
3260         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3261         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
3262         * Makefile (tests): Add tst-cancel11.
3263         * tst-cancel11.c: New file.
3265 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
3267         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
3268         round, not the first.  Use specific_used flag instead of local
3269         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
3270         (__free_tcb): Don't call deallocate_tsd here.
3271         (start_thread): Call deallocate_tsd here.
3272         * pthread_setspecific.c: Set specific_used flag really only when
3273         needed.
3274         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
3275         * tst-tsd3.c: New file.
3276         * tst-tsd4.c: New file.
3278 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3280         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
3281         Use atomic_exchange_and_add instead of __lll_add.
3282         (__lll_mutex_timedlock): Likewise.
3283         Patch by Ian Wienand.
3285 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
3287         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3288         (SINGLE_THREAD_P): Fix typo.
3289         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
3291 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3293         * Makefile (tests): Add tst-align.
3294         * tst-align.c: New file.
3295         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
3297         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
3298         function correctly.
3300         * tst-tsd2.c: Add casts to avoid warnings.
3302 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
3304         * descr.h (struct pthread): Move most often used elements to the front.
3306 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
3308         * Makefile (libpthread-routines): Add pthread_atfork.
3309         (libpthread-static-only-routines): Add pthread_atfork.
3311 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3313         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
3314         of TLS_DTV_AT_TP.
3315         (INSTALL_DTV): Add parens.
3316         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
3317         Use passed descr instead of THREAD_SELF.
3318         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
3319         (__lll_mutex_timedlock_wait): Correct expected value after
3320         spurious wakeup.
3321         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
3322         Release lock before waking up the waiters.
3323         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
3324         criteria.  Reorderstruct passed to cleanup handler.  Fix
3325         handling of cancellation and failung pthread_mutex_unlock call.
3326         Use __pthread_enable_asynccancel_2 instead of
3327         __pthread_enable_asynccancel.
3328         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3329         Return result of lock re-get if it fails.
3330         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
3331         for __pthread_cleanup_push.
3332         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
3333         completely broken rwlock implementation.
3334         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3335         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3336         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3337         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3338         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3339         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
3340         versioned_symbol macro.
3341         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
3342         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3344 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
3346         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
3347         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
3348         and __helper_tid.
3349         (struct timer): Remove th and bar field.
3350         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
3351         debugging code.  Create only one helper thread.
3352         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
3353         helper thread.
3354         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3355         Renamed.  Define statically.  Use thread info from siginfo.
3356         (__helper_once): New variable.
3357         (__helper_tid): New variable.
3358         (__reset_helper_control): New function.
3359         (__start_helper_thread): New function.
3361         * pthread_create.c (start_thread): Don't use setjmp inside
3362         __builtin_expect to work around gcc bug.
3364         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
3365         timer_delete syscall fails, but not with ENOSYS, set
3366         __no_posix_timers.
3368         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
3369         (timer_settime): Fix typo.
3370         * sysdeps/unix/sysv/linux/timer_getoverr.c
3371         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
3373 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3375         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
3376         offset of cleanupbuf.__prev.
3378 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
3380         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
3381         of included file.
3383 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
3385         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
3386         NULL provide default definition to syscall.
3388 2003-03-25  Roland McGrath  <roland@redhat.com>
3390         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
3391         (timer_id2ptr): Fix typo.
3393 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
3395         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
3396         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
3397         * sysdeps/ia64/pthreaddef.h: Likewise.
3398         * sysdeps/powerpc/pthreaddef.h: Likewise.
3399         * sysdeps/s390/pthreaddef.h: Likewise.
3400         * sysdeps/sh/pthreaddef.h: Likewise.
3401         * sysdeps/x86_64/pthreaddef.h: Likewise.
3402         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
3403         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
3404         being changed.
3405         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3406         SIGTIMER is not unblocked.
3407         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
3408         RT signal taken.
3409         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
3410         be send.
3411         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
3412         pass pointer through as ID.
3413         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
3414         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
3415         * sysdeps/unix/sysv/linux/timer_create.c: New file.
3416         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
3417         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
3418         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
3419         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
3420         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
3421         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
3422         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
3423         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
3424         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
3425         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
3426         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
3427         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
3428         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
3429         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
3430         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
3431         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
3432         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
3433         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
3434         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
3435         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
3436         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
3437         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
3438         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
3439         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
3440         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
3441         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
3442         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
3443         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
3444         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
3445         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
3447         * pthreadP.h: Remove FRAME_LEFT definition.
3448         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
3449         already left frame.  Programs which have this problem are not POSIX
3450         compliant.
3451         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
3453 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
3455         * sysdeps/pthread/tst-timer.c: Check return values of the
3456         functions we test.
3458 2003-03-23  Roland McGrath  <roland@redhat.com>
3460         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
3461         * tst-tls3mod.c: Likewise.
3462         * tst-tls1.c: Likewise.
3463         * tst-tls2.c: Likewise.
3465         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
3466         undefined behavior.
3468         * tst-join5.c (tf1, tf2): Add a cast.
3470         * Makeconfig (includes): Append -I$(..)nptl to this variable.
3472         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
3473         Don't test anything.
3474         * tst-cond4.c: Likewise.
3475         * tst-cond6.c: Likewise.
3476         * tst-flock2.c: Likewise.
3477         * tst-mutex4.c: Likewise.
3478         * tst-rwlock4.c: Likewise.
3479         * tst-signal1.c: Likewise.
3480         * tst-spin2.c: Likewise.
3481         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
3483         * tst-mutex4.c: Use test-skeleton.c.
3484         * tst-spin2.c: Likewise.
3485         * tst-sysconf.c: Likewise.
3486         * tst-barrier2.c: Likewise.
3487         * tst-cond4.c: Likewise.
3488         * tst-cond6.c: Likewise.
3489         * tst-rwlock4.c: Likewise.
3490         * tst-unload.c: Likewise.
3491         * tst-flock2.c (do_test): Use return instead of exit.
3493 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
3495         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
3497 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
3499         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3500         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
3501         instead of __lll_compare_and_swap.
3502         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3503         Likewise.
3504         Removed definition if __lll_compare_and_swap.
3506         * cancellation.c: Adjust for new form of compare&exchange macros.
3507         * cleanup_defer.c: Likewise.
3508         * init.c: Likewise.
3509         * libc-cancellation.c: Likewise.
3510         * old_pthread_cond_broadcast.c: Likewise.
3511         * old_pthread_cond_signal.c: Likewise.
3512         * old_pthread_cond_timedwait.c: Likewise.
3513         * old_pthread_cond_wait.c: Likewise.
3514         * pthread_cancel.c: Likewise.
3515         * pthread_create.c: Likewise.
3516         * pthread_detach.c: Likewise.
3517         * pthread_join.c: Likewise.
3518         * pthread_key_delete.c: Likewise.
3519         * pthread_setcancelstate.c: Likewise.
3520         * pthread_setcanceltype.c: Likewise.
3521         * pthread_timedjoin.c: Likewise.
3522         * pthread_tryjoin.c: Likewise.
3523         * sysdeps/pthread/createthread.c: Likewise.
3525 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
3527         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
3528         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
3529         definitions.  Replace uses with calls to atomic_* functions.
3530         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3531         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
3532         __lll_test_and_set calls with atomic_exchange_and_add and
3533         atomic_exchange calls respectively.
3534         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
3535         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
3536         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
3537         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3538         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
3539         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
3540         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
3542         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
3543         returns the old value.
3545 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
3547         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
3548         int for variable OLDVAL and correct inline assembler contraint.
3549         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
3550         type int for variable OLD.
3552         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
3553         only for s390-32.
3554         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3555         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
3556         instead of multiple_threads field in the TCB.
3558 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
3560         * sysdeps/i386/i686/bits/atomic.h: Removed.
3561         * sysdeps/i386/i586/bits/atomic.h: Removed.
3562         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
3563         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
3564         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
3565         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
3566         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
3567         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
3568         * atomic.h: Removed.  Moved to glibc.
3570         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
3571         support for clock selection.
3573         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
3574         signalling waiters.
3576 2003-03-18  Roland McGrath  <roland@redhat.com>
3578         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3579         Add __lll_rel_instr first.  Add memory clobber.
3580         (lll_mutex_unlock): Use __lll_test_and_set.
3581         From Paul Mackerras <paulus@samba.org>.
3583         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
3584         unconditionally.
3585         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3586         (SINGLE_THREAD_P):  Add `header.' prefix.
3587         From Paul Mackerras <paulus@samba.org>.
3589         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
3590         pthread_timedjoin_np to ...
3591         (libpthread: GLIBC_2.3.3): ... here.
3592         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
3594         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3595         Avoid shadowing VAL variable.
3597         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3598         New macro.
3600 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
3602         * Makefile (tests): Add tst-cond11.
3603         * tst-cond11.c: New file.
3605         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
3606         struct passed to cleanup handler to eliminate one more
3607         instruction.
3608         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3610         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3611         (pthrad_cond_t): Replace __unused field with __clock.
3613         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
3614         waken all waiters in cleanup handler.
3615         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3616         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3618         * pthread_condattr_getclock.c: New file.
3619         * pthread_condattr_setclock.c: New file.
3620         * sysdeps/pthread/pthread.h: Declare these new functions.
3621         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
3622         * Makefile (libpthread-routines): Add the new functions.
3623         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
3624         Renamed field to value.  Document use of the bits.
3625         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
3626         change.
3627         * pthread_condattr_setpshared.c: Likewise.
3628         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
3629         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
3630         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3631         Add __clock field.
3632         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3633         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3634         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3635         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3636         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3637         Implement clock selection.
3638         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3639         * pthread-errnos.sym: Add ENOSYS.
3640         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3641         _POSIX_CLOCK_SELECTION.
3642         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3644         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
3645         invalid .size directive.
3647 2003-03-17  Roland McGrath  <roland@redhat.com>
3649         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3650         Formatting tweaks.
3652 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3654         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
3655         Use __lll_add instead of spelling it out.  Use protected symbol names.
3656         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
3657         Use __lll_add.
3658         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
3659         Renamed from lll_compare_and_swap.  Use new name where necessary.
3660         (__lll_add): Defined.
3661         (__lll_dec_if_positive): Defined.
3662         (__lll_test_and_set): Defined.
3663         * sysdeps/ia64/pthread_spin_init.c: Removed.
3664         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
3665         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
3666         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
3667         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
3668         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
3669         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
3670         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
3671         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
3672         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
3673         __sync_lock_release_si.
3674         Patch by Jakub Jelinek.
3676         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3677         Fix timeout handling.
3678         (__lll_timedwait_tid): Likewise.
3679         (lll_unlock_wake_cb): Wake up other waiters if necessary.
3680         Patch by Jakub Jelinek.
3682         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
3684 2003-03-17  Roland McGrath  <roland@redhat.com>
3686         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
3687         * sysdeps/pthread/pthread_spin_init.c: New file.
3688         * sysdeps/pthread/pthread_spin_unlock.c: New file.
3689         * sysdeps/powerpc/Makefile: New file.
3690         * sysdeps/powerpc/pthread_spin_lock.c: New file.
3691         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
3692         * sysdeps/powerpc/pthreaddef.h: New file.
3693         * sysdeps/powerpc/tcb-offsets.sym: New file.
3694         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
3695         * sysdeps/powerpc/tls.h: New file.
3696         * sysdeps/powerpc/bits/atomic.h: New file.
3697         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
3698         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
3699         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
3701         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
3702         * sysdeps/unix/sysv/linux/sem_post.c: New file.
3703         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
3704         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
3705         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
3706         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
3707         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
3708         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
3709         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
3710         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
3711         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
3712         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
3713         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
3714         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
3715         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
3717         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
3718         not gettimeofday.
3719         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
3720         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
3721         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
3722         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
3723         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
3725 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3727         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
3728         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3729         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3730         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3731         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
3733 2003-03-16  Roland McGrath  <roland@redhat.com>
3735         * tst-fork4.c: Include <string.h>.
3736         * tst-signal2.c: Likewise.
3737         * tst-mutex5.c (do_test): exit -> return.
3738         * tst-mutex2.c: Include <stdlib.h>.
3740 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
3742         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3743         (__lll_mutex_timedlock_wait): Correct expected value after
3744         spurious wakeup.  Otherwise we would never wait again.
3746         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
3747         zone versus inline asm stupidity.  Use correct instructions.
3749         * tst-rwlock6.c: Add some more status output.
3751 2003-03-15  Roland McGrath  <roland@redhat.com>
3753         * sysdeps/pthread/configure.in: New file.
3754         * sysdeps/pthread/configure: New file (generated).
3756 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3758         * allocatestack.c (allocate_stack): Store the exact stack size of
3759         user allocated stacks.
3761 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
3763         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
3764         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
3765         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3766         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
3767         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
3768         Use `header.' prefix.
3769         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3771 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3773         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
3774         __builtin_frame_address, use stack pointer.
3776         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
3777         instead of __builtin_frame_pointer.
3779 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3781         * tst-basic1.c (do_test): Add cast to avoid warning.
3782         * tst-basic2.c (do_test): Likewise.
3784         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
3785         amount of stack correction.
3787         * tst-fork4.c: Use test-skeleton.c.
3789 2003-03-14  Roland McGrath  <roland@redhat.com>
3791         * init.c: Fix typo "#eli" for "#else".
3793 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
3795         * allocatestack.c (__stack_user): Use hidden_data_def.
3796         * pthread_create.c (__pthread_keys): Likewise.
3798         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
3800 2003-03-14  Roland McGrath  <roland@redhat.com>
3802         * tst-fork4.c: New file.
3803         * Makefile (tests): Add it.
3805         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
3806         we always define the padding space.
3807         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
3808         stopped supporting its own extensions fully.
3809         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
3810         struct also called `header', so `header.multiple_threads' is the field
3811         name to use on all machines.
3812         * allocatestack.c (allocate_stack): Use `header.' prefix.
3813         * sysdeps/pthread/createthread.c (create_thread): Likewise.
3814         * pthread_create.c (__pthread_create_2_1): Likewise.
3815         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
3816         (THREAD_SELF): Likewise.
3817         * sysdeps/x86_64/tls.h: Likewise.
3818         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
3819         (SINGLE_THREAD_P): Likewise.
3820         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
3821         (SINGLE_THREAD_P): Likewise.
3822         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3823         (SINGLE_THREAD_P): Likewise.
3825         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
3826         value directly.
3828 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3830         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
3831         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
3833         * pthread_create.c (start_thread): setjmp is expected to return 0.
3835         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
3836         (THREAD_GETMEM_NC): Likewise.
3838 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
3840         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
3841         and the size of the stack which must be allocated is a multiple,
3842         allocate one more page.
3843         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
3844         MULTI_PAGE_ALIASING.
3846 2003-03-13  Roland McGrath  <roland@redhat.com>
3848         * pthread_create.c (start_thread): Set EXITING_BIT after the
3849         event-reporting (and destructors), not before.
3851 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
3853         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
3854         lll_futex_wake): Declare register variables as long int instead of
3855         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
3856         Make syscall arguments clobbered by the syscall.
3857         (lll_futex_wait): Define using lll_futex_timed_wait.
3859         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
3860         to void *.
3862         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
3863         PPID if [! NDEBUG].
3865         * allocatestack.c (nptl_ncreated): Only declare if
3866         COLORING_INCREMENT != 0.
3868         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
3869         (__libc_enable_asynccancel_2): Remove prototype.
3871         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
3872         ctid to match kernel.
3874 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
3876         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
3877         libc_multiple_threads.
3878         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
3879         __libc_multiple_threads to...
3880         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
3882         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
3883         versioning.
3884         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3885         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3887         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
3888         (__pthread_once_internal): Define.
3890         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
3891         macros instead of .symver directly.
3892         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3893         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3895         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
3896         * sysdeps/x86_64/tcb-offsets.sym: New file.
3897         * sysdeps/x86_64/Makefile: New file.
3899         * sysdeps/i386/tcb-offsets.sym: Add SELF.
3900         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
3901         to access own pthread_t in TCB.
3902         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3903         Likewise.
3904         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3905         Likewise.
3906         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3908 2003-03-12  Roland McGrath  <roland@redhat.com>
3910         * pthread-errnos.sym: New file.
3911         * Makefile (gen-as-const-headers): New variable, list that file.
3912         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
3913         header <pthread-errnos.h> instead of defining errno values here.
3914         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3915         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3916         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
3917         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3918         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3919         Likewise.
3920         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3921         Likewise.
3922         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3923         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3924         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
3925         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3926         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3927         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3928         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3929         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3930         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3931         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
3932         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3933         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
3934         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3935         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
3936         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3937         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3938         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3939         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3940         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3941         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
3942         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
3943         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
3944         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
3945         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
3946         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
3947         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3948         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3950         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
3951         CLONE_CHILD_SETTID worked.
3953 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
3955         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
3956         file.
3957         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
3958         file.
3960         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3961         (pthread_cond_t): Add padding.
3963         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
3964         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
3965         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
3967         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
3968         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
3969         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
3970         (__pthread_rwlock_timedrdlock): Likewise.
3971         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
3972         (__pthread_rwlock_wrlock): Likewise.
3973         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
3974         (__pthread_rwlock_rdlock): Likewise.
3976         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
3978         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
3979         result of lock re-get if it fails.
3981 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
3983         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
3984         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3985         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
3986         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3987         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3988         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3989         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3990         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3991         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3992         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3994         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
3995         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
3997         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
3998         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
3999         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
4000         (create_thread): Likewise.
4001         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
4002         * init.c (__pthread_initialize_minimal_internal): Initialize
4003         __libc_multiple_threads_ptr if necessary.
4004         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
4005         __pthread_multiple_threads and __libc_multiple_threads_ptr.
4006         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
4007         __libc_multiple_threads.
4008         (__libc_pthread_init): Return pointer to __libc_pthread_init if
4009         necessary.
4011         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
4012         (THREAD_SETMEM_NC): Likewise.
4014         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
4015         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
4016         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
4017         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
4019         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
4020         Eliminate one entire instruction.
4022         * cancellation.c (__pthread_enable_asynccancel_2): New function.
4023         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
4024         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4025         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
4026         instead of __pthread_enable_asynccancel.
4027         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4028         (__pthread_cond_wait): Likewise.
4029         * sysdeps/pthread/pthread_cond_timedwait.c
4030         (__pthread_cond_timedwait): Likewise.
4031         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4033         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4034         (__condvar_cleanup): Wake up all waiters in case we got signaled
4035         after being woken up but before disabling asynchronous
4036         cancellation.
4037         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4038         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4039         (__condvar_cleanup): Likewise.
4041         * init.c (__NR_set_tid_address): If already defined, don't redefine.
4042         Make it an error if architecture has no #if case.  Add x86-64.
4044         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
4045         pt-initfini.s generation.
4047         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
4048         (TLS_INIT_TP): Fix typo.
4050 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4052         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
4053         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
4055         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
4056         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4057         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
4058         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
4059         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
4060         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4061         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4062         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4064 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4066         * sysdeps/pthread/pthread_cond_timedwait.c
4067         (__pthread_cond_timedwait): Return the result of the final
4068         locking.  If it succeeds, the regular function return value.
4070         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
4071         Return result of the final locking.
4072         * version.c (__nptl_main): Work around problems with the strange
4073         INTERNAL_SYSCALL macro on ppc32.
4074         * init.c (__pthread_initialize_minimal_internal): Unblock
4075         SIGCANCEL in case the parent blocked it.
4076         Reported by Paul Mackerras <paulus@samba.org>.
4078         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
4079         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
4080         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
4082 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4084         * sysdeps/pthread/pthread_cond_timedwait.c
4085         (__pthread_cond_timedwait): Unlock and fail if
4086         __pthread_mutex_unlock_internal failed.
4088         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
4089         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
4090         Use ARCH_CLONE.
4091         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
4092         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
4093         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
4094         ALLOCATE_STACK): New macros.
4095         (TLS_TPADJ): New macro.
4096         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
4097         (allocate_stack): Handle TLS_DTV_AT_TP and
4098         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
4099         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
4100         Don't set PD->self.
4101         * init.c [__ia64__] (__NR_set_tid_address): Define.
4103         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
4104         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
4105         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
4106         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
4107         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
4108         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
4109         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
4110         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
4111         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
4112         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
4113         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
4114         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
4115         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
4116         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
4117         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
4118         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
4119         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
4120         * sysdeps/ia64/bits/atomic.h: New file.
4121         * sysdeps/ia64/Makefile: New file.
4122         * sysdeps/ia64/pthread_spin_init.c: New file.
4123         * sysdeps/ia64/pthread_spin_lock.c: New file.
4124         * sysdeps/ia64/pthread_spin_trylock.c: New file.
4125         * sysdeps/ia64/pthread_spin_unlock.c: New file.
4126         * sysdeps/ia64/pthreaddef.h: New file.
4127         * sysdeps/ia64/tcb-offsets.sym: New file.
4128         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
4129         * sysdeps/ia64/tls.h: New file.
4131         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
4132         to syscall instead of no arguments.
4134 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
4136         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
4137         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
4138         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
4139         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
4141         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
4142         unused code.
4144         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
4146         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4147         lowlevelbarrier.sym.
4148         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
4149         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
4150         Include lowlevelbarrier.h and don't define offsets locally.
4151         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
4153         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4154         (__lll_mutex_lock_wait): Reverse order of first two parameters.
4155         (__lll_mutex_timedlock_wait): Likewise.
4156         (lll_mutex_lock): Adjust asm for that.
4157         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
4158         (lll_lock): Adjust asm for operand order change.
4159         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
4160         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
4162         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
4163         Reverse order of parameters.
4164         (__lll_timedwait_tid): Remove regparms attribute.
4165         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
4166         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
4168         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4169         (__lll_timedwait_tid): Remove one unnecessary instruction.
4171         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
4172         __lll_mutex_timedlock_wait only for NOT_IN_libc.
4173         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
4174         lowlevelmutex.S.
4176         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
4177         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
4178         for NOT_IN_libc.
4179         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
4180         lowlevellock.S.
4182         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
4183         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
4184         for libc.so.
4185         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
4186         define LOCK here (if UP is not defined).  The actual code is in
4187         lowlevelmutex.S.
4189         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
4190         LOCK is already defined.  Don't define lll_unlock_wake_cb and
4191         __lll_timedwait_tid for libc.so.
4192         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
4193         define LOCK here (if UP is not defined).  The actual code is in
4194         lowlevellock.S.
4196         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
4197         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
4198         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
4199         instead of lowlevelsem.h.
4200         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4201         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4202         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4204         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4205         lowlevelrwlock.sym.
4206         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
4207         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
4208         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
4210         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
4211         register loading.
4212         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
4213         last changed.  D'oh.
4215         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
4217         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
4218         of __libc_locking_needed.
4219         (lll_trylock): Initialize %eax to zero.
4221         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
4222         pthread_cond_t definition.
4224 2003-03-10  Roland McGrath  <roland@redhat.com>
4226         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
4227         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
4228         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
4229         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
4230         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
4232         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
4233         Instead of setting PD->multiple_threads, set globals
4234         __pthread_multiple_threads and __libc_multiple_threads.
4235         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4236         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
4237         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
4239         * descr.h (struct pthread): Conditionalize first member on
4240         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
4241         containing an anonymous tcbhead_t.  Move `list' member out.
4242         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
4243         * allocatestack.c: Remove use of `header.data.' prefix.
4244         * pthread_create.c: Likewise.
4245         * init.c (__pthread_initialize_minimal_internal): Likewise.
4246         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4247         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
4248         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
4249         * sysdeps/x86_64/tls.h: Likewise.
4250         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4251         (SINGLE_THREAD_P): Likewise.
4252         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4253         (SINGLE_THREAD_P): Likewise.
4254         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
4255         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
4257 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
4259         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
4261         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
4262         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4264         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
4265         leftovers from the ia32 code.
4267         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
4268         memory load.
4269         (clear_once_control): Don't load %esi.
4271         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
4272         handling.
4274         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4276         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
4277         * sysdeps/unix/sysv/linux/createthread.c: ...here.
4279         * Makefile (tests): Add tst-cond10.
4280         * tst-cond10.c: New file.
4282 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
4284         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
4285         * tst-signal3.c (do_test): Likewise.
4286         * tst-sem5.c (do_test): Likewise.
4287         * tst-kill6.c (do_test): Likewise.
4288         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
4290         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
4291         of inc/dec.
4292         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
4293         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
4294         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4295         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4296         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4297         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4298         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4299         Likewise.
4300         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4301         Likewise.
4302         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4304         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4305         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4306         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4307         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
4308         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4309         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4311         * allocatestack.c (allocate_stack): If mprotect() fails free the
4312         TLS memory.
4314 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
4316         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
4318         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
4319         lll_wake_tid.  This was used only to work around kernel limits in
4320         the early days.
4321         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
4322         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
4323         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4324         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
4326         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
4327         (__pthread_initialize_minimal_internal): Change initialization of
4328         __static_tls_align_m1 appropriately.
4329         * pthreadP.h (__static_tls_align_m1): Renamed from
4330         __static_tls_align.
4331         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
4332         instead of __static_tls_align-1.
4334 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
4336         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
4338         * pthread_create.c: Define __pthread_keys using nocommon
4339         attribute, not by placing it explicitly in bss.
4340         Remove DEFINE_DEALLOC definition.  Not needed anymore.
4342         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
4343         Use it in mmap call to allocate stacks.
4345         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
4347         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
4348         result of the thread function.
4350 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
4352         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
4353         version is just fine.
4355         * sysdeps/unix/sysv/linux/libc_pthread_init.c
4356         (__pthread_child_handler): Renamed from pthread_child_handler,
4357         exported, and marked hidden.  Change all users.
4358         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
4359         free __pthread_child_handler from child list.
4361 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4363         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
4365         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4366         Fix handling of cancellation and failing pthread_mutex_unlock call.
4367         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4368         (__pthread_cond_wait): Likewise.
4370         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4371         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
4372         lll_futex_timed_wait call.
4373         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4374         (pthread_rwlock_timedwrlock): Likewise.
4376         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4377         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
4378         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
4380         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
4381         check of lll_futex_wake return value.
4383 2003-03-03  Roland McGrath  <roland@redhat.com>
4385         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
4387         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4388         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
4389         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
4391 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
4393         * sysdeps/pthread/timer_create.c (timer_create): Return correct
4394         error for CPU clocks.
4396         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4397         _POSIX_MONOTONIC_CLOCK.
4398         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4400         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
4401         recent kernels.
4403 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4405         * descr.h (struct pthread): Move cleanup field to the front.
4407 2003-03-01  Roland McGrath  <roland@redhat.com>
4409         * sem_open.c (sem_open): Braino fix.
4411 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4413         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
4414         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
4415         __pthread_cleanup_pop functionality.
4416         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4418         * descr.h (struct pthread): Move tid field to the front now that
4419         it is often used.
4421         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
4422         (__lll_mutex_timedlock_wait): Remove.
4423         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4424         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4425         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4426         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4427         (lll_unlock_wake_cb): Don't save and restore %esi.
4428         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4429         %esi.
4430         (__lll_timedwait_tid): Add alignment.
4431         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
4432         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4433         %esi.
4434         (__lll_timedwait_tid): Removed.
4435         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
4436         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
4437         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4438         (pthread_barrier_wait): Don't save, load, and restore %esi for
4439         last thread.
4440         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4441         (__pthread_cond_signal): Don't save, load, and restore %esi.
4442         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
4443         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
4444         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4445         Don't save, load, and restore %esi.
4447 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
4449         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
4450         Release lock before waking up the waiters.
4452         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
4454         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
4455         (reader_thread): Likewise.
4457         * sysdeps/pthread/pthread_rwlock_unlock.c
4458         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
4459         to wake up readers if there are none.
4461         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
4462         Release internal lock before wake threads.
4464 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
4466         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
4467         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
4468         predefined.
4469         * tst-rwlock9.c: Likewise.
4470         * tst-rwlock10.c: New file.
4471         * tst-rwlock11.c: New file.
4473         * Makefile (tests): Add tst-dlsym1.
4474         * tst-dlsym1.c: New file.
4476         * init.c (__pthread_initialize_minimal_internal): Set
4477         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
4478         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
4480 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
4482         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
4484         * tst-cond2.c: Fix sychronization with child.
4486         * tst-rwlock8.c (reader_thread): Remove unused variable.
4488         * Makefile: Add rules to build and run tst-tls3.
4489         * tst-tls3.c: New file.
4490         * tst-tls3mod.c: New file.
4492         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
4493         * tst-rwlock8.c: New file.
4494         * tst-rwlock9.c: New file.
4495         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
4496         complete broken rwlock implementation.
4497         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4498         Likewise.
4499         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4500         Likewise.
4501         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4502         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4503         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
4504         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4505         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4506         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
4507         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4509 2003-02-23  Roland McGrath  <roland@redhat.com>
4511         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
4513 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
4515         * Makefile (tests): Add tst-context1.
4516         * tst-context1.c: New file.
4518         * Makefile (tests): Add tst-tls1 and tst-tls2.
4519         * tst-tls1.c: New file.
4520         * tst-tls2.c: New file.
4522         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
4523         for failed cmpxchg.
4525         * pthread_create.c (start_thread): Set EXITING_BIT early.
4527         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
4528         (THREAD_GETMEM_NC): Likewise.
4530 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
4532         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
4533         off 3 more bytes by using offset-less instructions when possible.
4535         * Makefile: Add dependency for $(objpfx)version.d.
4537         * eintr.c (eintr_source): Add unnecessary return but the compiler
4538         insists.
4540         * tst-kill3.c: Include <unistd.h>.
4542 2003-02-21  Roland McGrath  <roland@redhat.com>
4544         * pthread_create.c (start_thread): Call __libc_thread_freeres.
4546 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4548         * Makefile (tests): Add tst-eintr1.
4549         (distribute): Add eintr.c.
4550         * tst-eintr1.c: New file.
4551         * eintr.c: New file.
4553         * pthread_cancel.c (pthread_cancel): Use tkill directly.
4555         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
4556         Disallow sending SIGCANCEL.
4558         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
4559         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
4560         * tst-kill1.c: New file.
4561         * tst-kill2.c: New file.
4562         * tst-kill3.c: New file.
4563         * tst-kill5.c: New file.
4564         * tst-kill6.c: New file.
4565         * tst-basic7.c: Renamed to...
4566         * tst-kill4.c: ...this.
4568 2003-02-21  Roland McGrath  <roland@redhat.com>
4570         * Makefile (install-lib-ldscripts): New variable.
4572 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4574         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
4575         * pthread_cancel.c: Use INVALID_TD_P.
4576         * pthread_detach.c: Likewise.
4577         * pthread_getschedparam.c: Likewise.
4578         * pthread_setschedparam.c: Likewise.
4579         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
4580         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4581         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
4582         * pthread_timedjoin.c: Likewise.
4584         * tst-basic7.c: Include <signal.h>.
4586         * pthread_join.c (pthread_join): Limited checking for invalid
4587         descriptors.
4588         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
4590 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
4592         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
4593         beginning of the loop.  Clear the entire first block of TSD.
4594         * Makefile (tests): Add tst-key4.
4595         * tst-key4.c: New file.
4597 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
4599         * Makefile (tests): Add tst-basic7.
4600         * tst-basic7.c: New file.
4602         * pthread_create.c (deallocate_tsd): Mark as internal_function.
4603         Add some more __builtin_expect.
4605         * pthreadP.h: Define dummy version of DEBUGGING_P.
4607 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
4609         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
4610         _POSIX_THREAD_PRIORITY_SCHEDULING.
4611         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
4612         _XOPEN_REALTIME_THREADS.
4613         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4615         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
4616         kernel returns EINVAL for PID <= 0, work around it.
4618         * Makefile (tests): Add tst-signal5.
4619         * tst-signal5.c: New file.
4621         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
4622         and LOGIN_NAME_MAX.
4624         * tst-cancel1.c (tf): Block all signals.
4626         * Makefile (tests): Add tst-basic6.
4627         * tst-basic6.c: New file.
4629         * tst-basic1.c: Add test for process ID.
4631         * Makefile (tests): Add tst-cancel10.
4632         * tst-cancel10.c: New file.
4634         * Makefile (tests): Add tst-signal4.
4635         * tst-signal4.c: New file.
4637         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
4638         __sigismember instead of sigismember.  Add __builtin_expect.
4640 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
4642         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
4643         pthread_setcancelstate, and pthread_rwlock_setpshared.
4645         * tst-cancel7.c (do_test): Make sure the pid file exists before
4646         canceling the thread.
4648         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
4649         pthread_rwlock_timedrdlock tests.
4650         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
4651         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4652         Check for invalid tv_nsec field.
4653         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4654         Likewise.
4656         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
4657         recursive mutex of overflow.
4659         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
4661         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
4662         going into an endless loop.
4663         * Makefile (tests): Add tst-cancel9.
4664         * tst-cancel9.c: New file.
4666         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
4668 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
4670         * tst-mutex5.c (do_test): Add more timedlock tests.
4672         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
4673         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
4675         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4676         use INLINE_SYSCALL.  Error number is returned, not -1.
4678         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
4679         and __deallocate_stack with internal_function.
4680         * pthread_create.c: Adjust definitions appropriately.
4681         * allocatestack.c: Likewise.
4683         * pthread_join.c: Add one more __builtin_expect.
4684         * pthread_timedjoin.c: Likewise.
4686         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
4687         not data of sequence number does not match.
4688         Add one __builtin_expect.
4690         * Makefile (tests): Add tst-clock1.
4691         * tst-clock1.c: New file.
4693         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
4694         negative arguments.
4695         * Makefile (tests): Add tst-basic5.
4696         * tst-basic5.c: New file.
4698 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
4700         * Makefile (tests): Add tst-basic4.
4701         * tst-basic4.c: New file.
4703         * pthreadP.h: Add declaraction for __nptl_nthreads.
4704         * pthread_create.c: Define __nptl_nthreads
4705         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
4706         after thread is done.  If then zero, call exit(0).
4707         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4708         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
4709         * init.c (pthread_functions): Initialize ptr_nthreads.
4710         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
4711         (__reclaim_stacks): Decrement __nptl_nthreads.
4712         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
4713         Define.
4714         * Makefile (tests): Add tst-basic3.
4715         * tst-basic3.c: New file.
4717         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
4718         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
4719         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
4720         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
4721         if asynchronous canceling is enabled.
4722         * pthread_join.c (pthread_join): When recognizing circular joins,
4723         take into account the other thread might be already canceled.
4724         * Makefile (tests): Add tst-join5.
4725         * tst-join5.c: New file.
4727         * Makefile (tests): Add tst-join4.
4728         * tst-join4.c: New file.
4730 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
4732         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
4734 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4736         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
4737         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
4738         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
4739         warning.
4740         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
4741         to avoid warning.
4742         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
4743         error if lll_futex_wake failed.
4745 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
4747         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
4748         handling of cancellation and failung pthread_mutex_unlock call.
4749         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4750         * Makefile (tests): Add tst-cond8 and tst-cond9.
4751         * tst-cond8.c: New file.
4752         * tst-cond9.c: New file.
4754         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
4756         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
4757         non-standard initializers with __USE_GNU.
4759         * Makefile (tests): Add tst-cleanup3.
4760         * tst-cleanup3.c: New file.
4762 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
4764         * Makefile (tests): Add tst-attr1 and tst-attr2.
4765         * tst-attr1.c: New file.
4766         * tst-attr2.c: New file.
4768         * Makefile: Add rules to build and run tst-atfork2 test.
4769         * tst-atfork2.c: New file.
4770         * tst-atfork2mod.c: New file.
4772         * sysdeps/unix/sysv/linux/unregister-atfork.c
4773         (__unregister_atfork): Free the memory allocated for the handlers
4774         after removing them from the lists.
4776         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
4777         cleanup function.
4779         * tst-atfork1.c (do_test): Wait for the child we forked.
4780         Report error in child.
4782         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
4784         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
4786 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
4788         * Makefile (tests): Add tst-cancel8.
4789         * tst-cancel8.c: New file.
4791         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
4792         clearing of control variable.
4793         * Makefile (tests): Add tst-once3 and tst-once4.
4794         * tst-once3.c: New file.
4795         * tst-once4.c: New file.
4797 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
4799         * sysdeps/sh/Makefile: New file.
4800         * sysdeps/sh/bits/atomic.h: New file.
4801         * sysdeps/sh/pthread_spin_init.c: New file.
4802         * sysdeps/sh/pthread_spin_lock.c: New file.
4803         * sysdeps/sh/pthread_spin_trylock.S: New file.
4804         * sysdeps/sh/pthread_spin_unlock.S: New file.
4805         * sysdeps/sh/pthreaddef.h: New file.
4806         * sysdeps/sh/tcb-offsets.sym: New file.
4807         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
4808         * sysdeps/sh/tls.h: New file.
4809         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
4810         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
4811         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
4812         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
4813         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
4814         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
4815         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
4816         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
4817         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
4818         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
4819         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
4820         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
4821         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
4822         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
4823         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
4824         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
4825         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
4826         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
4827         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
4828         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
4829         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
4830         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
4831         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
4832         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
4833         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
4834         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
4835         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
4836         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
4837         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
4838         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
4840 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
4842         * tst-cond2.c: Rearrange code to not rely on behavior undefined
4843         according to POSIX.
4845         * tst-basic2.c (do_test): Lock mutex before creating the thread.
4847 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
4849         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
4850         (TLS_GET_FS): New #define.
4851         (TLS_SET_FS): New #define.
4852         Correct value of __NR_set_thread_area.
4854         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
4856 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
4858         * Makefile (tests): Add tst-popen1.
4859         * tst-popen1.c: New file.
4861         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
4862         but inactive generalization.
4863         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4864         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4865         Minor optimization, remove one instruction.
4866         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4868 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4870         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
4872 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4874         * init.c (__NR_set_tid_address): Add #ifdef for s390.
4875         * sysdeps/pthread/pthread_barrier_wait.c: New file.
4876         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
4877         * sysdeps/pthread/pthread_cond_signal.c: New file.
4878         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
4879         * sysdeps/pthread/pthread_cond_wait.c: New file.
4880         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
4881         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
4882         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
4883         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
4884         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
4885         * sysdeps/s390/Makefile: New file.
4886         * sysdeps/s390/bits/atomic.h: New file.
4887         * sysdeps/s390/pthread_spin_init.c: New file.
4888         * sysdeps/s390/pthread_spin_lock.c: New file.
4889         * sysdeps/s390/pthread_spin_trylock.c: New file.
4890         * sysdeps/s390/pthread_spin_unlock.c: New file.
4891         * sysdeps/s390/pthreaddef.h: New file.
4892         * sysdeps/s390/tcb-offsets.sym: New file.
4893         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
4894         * sysdeps/s390/tls.h: New file.
4895         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
4896         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
4897         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
4898         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
4899         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
4900         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
4901         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
4902         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
4903         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
4904         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
4905         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
4906         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
4907         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
4908         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
4909         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
4910         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
4911         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
4912         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
4913         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
4914         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
4915         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
4916         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
4917         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
4919 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
4921         * atomic.h: Add a couple more default implementations.
4922         (atomic_compare_and_exchange_acq): Use
4923         __arch_compare_and_exchange_32_acq in return value definition.  It
4924         always exists.
4925         (atomic_bit_set): Renamed from atomic_set_bit.
4926         Add missing atomic_ prefixes.
4928         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
4929         thread library is available, use correct value to mark initialized
4930         once variable.
4932 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
4934         * allocatestack.c (allocate_stack): Use __getpagesize instead of
4935         __sysconf to determine pagesize.
4937         * pthread_create.c: Include <atomic.h>.
4938         * allocatestack.c (allocate_stack): Implement coloring of the
4939         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
4940         size minus one.  Adjust users.
4941         * sysdeps/i386/i686/Makefile: New file.
4943 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
4945         * allocatestack.c: Improve comment throughout the file.
4947         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4948         (__lll_lock_wait): Add branch prediction.
4949         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
4950         (__lll_lock_wait): Likewise.
4951         (lll_unlock_wake_cb): Removed.
4953 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
4955         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
4956         _POSIX_THREAD_PRIORITY_SCHEDULING.
4958 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
4960         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4961         Fix return type of ptr___pthread_getspecific.
4963 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
4965         * Makefile (tests): Add tst-umask1.
4966         (tst-umask1-ARGS): Define.
4967         * tst-umask1.c: New file.
4969 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
4971         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
4972         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
4973         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
4974         pthread_rwlock_unlock.
4975         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
4976         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
4977         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
4978         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
4979         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4980         New file.
4981         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
4982         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4983         New file.
4984         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
4985         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
4986         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
4987         New file.
4988         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
4989         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
4990         New file.
4991         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
4992         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
4993         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
4994         New file.
4995         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
4996         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
4997         New file.
4998         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
5000         * Makefile (libpthread-routines): Remove lowlevelcond and
5001         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
5002         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
5003         and pthread_cond_broadcast.
5004         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
5005         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
5006         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
5007         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
5008         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
5009         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
5010         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
5011         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
5012         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
5013         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
5014         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
5015         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
5016         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
5017         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
5018         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
5019         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
5020         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
5021         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
5022         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
5023         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
5024         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
5025         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
5026         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
5027         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
5028         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
5029         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
5030         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
5031         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
5032         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
5033         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
5034         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
5036         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
5037         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
5038         of the code is moved to ...
5039         * sysdeps/pthread/createthread.c: ...here.  New file.
5041 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
5043         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
5044         (__new_sem_post): Clear %eax before returning.
5045         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
5047         * Makefile (tests): Add tst-cleanup2.
5048         * tst-cleanup2.c: New file.
5050         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
5051         Interpret first parameter correctly.
5053 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
5055         * Makefile (headers): Add bits/semaphore.h.
5057 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
5059         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
5060         if not SHARED.
5062 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
5064         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
5065         must be used and mapping failed.
5066         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
5068         * Makefile (CFLAGS-pthread_self.os): Define this, not
5069         CFLAGS-pthread_self.c.
5071 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5073         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
5074         lll_unlock_wake_cb.
5076         * Makefile (libpthread-routines): Add version.  Add rules to build
5077         version.os and banner.h.
5078         * version.c: New file.
5080 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
5082         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
5083         the alias unconditional.
5084         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
5086 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5088         * Makefile (CFLAGS-pthread_self.c): New definition.
5090 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5092         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
5093         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
5094         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
5095         * init.c (__pthread_initialize_minimal_internal): Likewise.
5097 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
5099         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
5101         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
5102         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5103         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5104         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
5105         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5106         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5108 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5110         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
5111         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
5112         * tst-cancel-wrappers.sh: Remove all exceptions.
5114 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
5116         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
5117         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
5119         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
5120         Use __libc_pthread_functions array if SHARED.
5122         * pthreadP.h: Move pthread_cond_2_0_t definition to...
5123         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
5125         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
5126         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
5127         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
5128         __libc_ptf_call instead of __libc_maybe_call.
5129         (PTF): New #define.
5130         (__libc_cleanup_region_start): Wrap function name with PTF call.
5131         (__libc_cleanup_region_end): Likewise.
5132         (__libc_cleanup_end): Likewise.
5134         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
5135         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
5136         * pthread_key_create.c: Add __pthread_key_create_internal alias.
5137         * pthreadP.h: Add prototypes.
5139         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
5140         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
5141         __pthread_rwlock_unlock aliases.
5142         * pthreadP.h: Add prototypes for new aliases.
5144         * pthreadP.h (struct pthead_functions): Moved to...
5145         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
5146         * init.c (pthread_functions): Add initializers for new elements.
5148         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
5149         __pthread_cleanup_pop_restore aliases.
5150         * pthreadP.h: Add prototypes.
5152         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
5153         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
5154         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
5155         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
5156         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5157         * pthreadP.h: Adjust prototypes and callers.
5159 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
5161         * Makefile (tests): Add tst-cancel7.
5162         (tst-cancel7-ARGS): New variable.
5163         * tst-cancel7.c: New file.
5165         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
5166         around gcc defficiencies.
5167         * old_pthread_cond_signal.c: Likewise.
5168         * old_pthread_cond_timedwait.c: Likewise.
5169         * old_pthread_cond_wait.c: Likewise.
5171         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
5173 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5175         * Makefile (tests): Add tst-cond7.
5176         * tst-cond7.c: New file.
5178         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5179         (condvar_cleanup): Get condvar address from the right place.
5181         * atomic.h: Correct definitions of atomic_full_barrier,
5182         atomic_read_barrier, atomic_write_barrier.
5184         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
5185         race-free.
5186         * old_pthread_cond_signal.c: Likewise.
5187         * old_pthread_cond_timedwait.c: Likewise.
5188         * old_pthread_cond_wait.c: Likewise.
5190 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
5192         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
5194 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5196         * pthreadP.h (pthread_cond_2_0_t): New type.
5197         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
5198         Use new type for the 2.0 condvar function prototypes.
5199         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
5200         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
5201         parameter.
5202         * old_pthread_cond_destroy.c: Likewise.
5203         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
5204         * old_pthread_cond_signal.c: Likewise.
5205         * old_pthread_cond_timedwait.c: Likewise.
5206         * old_pthread_cond_wait.c: Likewise.
5208         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5209         (__pthread_cond_wait): Don't save cancellation mode and seq value
5210         in same location.
5212         * herrno.c (__h_errno_location): Don't define as weak.
5214 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5216         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
5217         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
5218         and pthread_cond_wait.
5219         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
5220         Renamed to...
5221         (__pthread_cond_broadcast_2_0): ... this.
5222         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
5223         Renamed to...
5224         (__pthread_cond_destroy_2_0): ... this.
5225         * old_pthread_cond_init.c (__old_pthread_cond_init):
5226         Renamed to...
5227         (__pthread_cond_init_2_0): ... this.
5228         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
5229         Renamed to...
5230         (__pthread_cond_signal_2_0): ... this.
5231         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
5232         Renamed to...
5233         (__pthread_cond_wait_2_0): ... this.
5234         * pthread_cond_destroy.c: Include shlib-compat.h.
5235         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
5236         * pthread_cond_init.c: Include shlib-compat.h.
5237         (pthread_cond_init): Change strong_alias into versioned_symbol.
5238         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
5239         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
5240         fields.
5241         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
5242         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
5243         __pthread_cond_wait_2_0): New prototypes.
5244         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
5245         __old_pthread_cond_init, __old_pthread_cond_signal,
5246         __old_pthread_cond_wait): Removed.
5247         * init.c: Include shlib-compat.h.
5248         (pthread_functions): Guard ptr___pthread_attr_init_2_0
5249         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
5250         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
5251         ptr___pthread_cond_*_2_0 fields.
5252         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
5253         pthread_cond_*@GLIBC_2.0 compatibility symbols.
5255         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
5256         LIBC_SIGACTION was not yet defined.
5257         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
5258         [!defined LIBC_SIGACTION] (__sigaction): New function and
5259         libc_hidden_weak.
5260         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
5261         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
5263 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5265         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
5267 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
5269         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5270         New, larger type definition.
5271         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
5272         implementation.
5273         * Versions [libpthread]: Add definitions for new pthread_cond_*
5274         interfaces for version GLIBC_2.3.2.
5275         * pthread_cond_init.c: Update initialization for new type definition.
5276         * Makefile (libpthread-routines): Remove pthread_cond_wait,
5277         pthread_cond_timedwait, pthread_cond_signal, and
5278         pthread_cond_broadcast.  Add old_pthread_cond_init,
5279         old_pthread_cond_destroy, old_pthread_cond_wait,
5280         old_pthread_cond_timedwait, old_pthread_cond_signal, and
5281         old_pthread_cond_broadcast.
5282         * old_pthread_cond_broadcast.c: New file.
5283         * old_pthread_cond_destroy.c: New file.
5284         * old_pthread_cond_init.c: New file.
5285         * old_pthread_cond_signal.c: New file.
5286         * old_pthread_cond_timedwait.c: New file.
5287         * old_pthread_cond_wait.c: New file.
5288         * pthreadP.h: Add prototypes for the compatibility interfaces.
5290         * pthread_cond_destroy.c: Don't include <errno.h>.
5292 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
5294         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
5295         unnecessary zero offset when addressing MUTEX.
5297 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5299         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
5300         __register_atfork.
5301         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
5302         for __register_atfork.
5304 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5306         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
5307         instead of ASSEMBLER test macro.
5309         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
5310         __libc_current_sigrtmax): Add libc_hidden_def.
5312         * sysdeps/pthread/list.h: Remove assert.h include.
5314 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5316         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
5317         __pthread_initialize_minimal_internal not
5318         __pthread_initialize_minimal.
5320 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
5322         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
5323         __pthread_initialize_minimal as hidden.
5325         * init.c (__pthread_initialize_minimal_internal): Don't mark as
5326         constructor.
5328 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5330         * Makefile ($(inst_libdir)/libpthread.so): Depend on
5331         $(common-objpfx)format.lds, include that into the output script.
5332         Fix comment.
5333         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
5335 2002-12-28  Andreas Jaeger  <aj@suse.de>
5337         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
5338         nsec resolution changes.
5339         (xstat64_conv): Likewise.
5340         (xstat32_conv): Likewise.
5341         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
5342         struct kernel_stat.
5343         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
5344         structs stat and stat64.
5345         * time/time.h (__timespec_defined): Define for __USE_MISC.
5346         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
5348 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
5350         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
5351         argument.
5352         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
5353         (pthread_exit): Use strong_alias to avoid warnings.
5354         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
5355         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
5356         ptr___pthread_attr_init_2_*.
5357         * init.c (pthread_functions): Adjust.
5359 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
5361         * forward.c: Make all functions available by default again.  It
5362         caused too much trouble.
5364         * pt-siglongjmp.c: Removed.
5366 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
5368         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
5369         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
5370         * sysdeps/i386/Makefile: New file.
5371         * sysdeps/i386/tcb-offsets.sym: New file.
5372         * sysdeps/pthread/tcb-offsets.h: New file.
5373         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5374         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
5376         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
5377         __register_atfork...
5378         (GLIBC_2.3.2): ...here.
5380 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5382         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
5383         pthread_attr_setstackaddr with __attribute_deprecated__.
5385 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5387         * pt-system.c (system): Remove cancellation handling.
5388         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
5389         cancellation routines.
5391 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5393         * descr.h: Include <dl-sysdep.h>.
5394         (struct pthread): Move header.data.list to the back of the struct.
5395         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
5396         (MULTIPLE_THREADS_OFFSET): Adjust offset.
5397         (SYSINFO_OFFSEET): Likewise.
5399 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5401         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
5402         Define.
5403         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
5404         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
5405         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
5406         (USE_DL_SYSINFO): Undef.
5408 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
5410         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
5411         $(common-objpfx)libc.so.
5412         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
5413         it is bigger than pipe buffer size even on arches with bigger
5414         page size.
5415         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
5417 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
5419         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
5420         correct errno access for case that USE___THREAD is not defined.
5422 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
5424         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
5425         Patch by Marijn Ros <marijn@mad.scientist.com>.
5427 2002-12-22  Roland McGrath  <roland@redhat.com>
5429         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
5431 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
5433         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
5435 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
5437         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
5438         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
5439         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
5441         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
5442         of int $0x80.
5443         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
5444         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
5445         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
5446         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5447         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5448         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
5449         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
5450         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5452         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
5453         sysenter.
5454         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5456         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
5458         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
5459         in new TCB.
5460         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
5461         that sysinfo is properly initialized.
5462         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
5463         to 1 only for ld.so.
5465         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
5466         RTLD_CORRECT_DYNAMIC_WEAK.
5468 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
5470         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
5471         Use return 0 as 6th argument to FORWARD4.
5472         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
5474 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5476         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
5477         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
5478         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
5479         (INIT_SYSINFO): New #define.
5480         (TLS_TP_INIT): Use INIT_SYSINFO.
5481         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5482         At test to make sure SYSINFO_OFFSET value is correct.
5483         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
5485 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
5487         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
5488         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
5489         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
5490         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
5491         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
5492         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
5493         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
5495 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5497         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
5498         macro instead of using int $0x80 directly.
5500         * sysdeps/pthread/bits/stdio-lock.h: New file.
5501         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
5502         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
5503         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
5504         * Makefile (routines): Add libc-lowlevelmutex.
5506         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
5507         __i686.get_pc_thunk.dx.
5509 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5511         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
5512         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
5513         ($(objpfx)tst-cancel-wrappers.out): New rule.
5514         * tst-cancel-wrappers.sh: New test.
5515         * tst-locale1.c: Include signal.h.
5516         (uselocale): Test static linking of __libc_current_sigrt*.
5518 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
5520         * Makefile (tests): Add tst-cancel6.
5521         * tst-cancel6.c: New file
5523 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5525         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
5526         Define meaningfully for assembler as well.
5527         * pthreadP.h (struct pthread_functions): Remove
5528         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
5529         and ptr_pthread_attr_init_2_1 fields.
5530         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
5531         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
5532         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
5533         (FORWARD3): Define using FORWARD4.
5534         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
5535         versions.
5536         * pt-system.c: Remove duplicate stdlib.h include.
5538 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
5540         * sem_init.c: Define sem_init@GLIBC_2.0.
5541         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
5542         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
5544         * flockfile.c: Moved to...
5545         * sysdeps/pthread/flockfile.c: ...here.  New file.
5546         * funlockfile.c: Moved to...
5547         * sysdeps/pthread/funlockfile.c: ...here.  New file.
5548         * ftrylockfile.c: Moved to...
5549         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
5551 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
5553         * libc-cancellation.c: Guard both function with
5554         #if !defined NOT_IN_libc.
5555         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
5556         automatically provided pthread wrappers.
5557         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
5558         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
5559         nor in libpthread.
5560         * pt-open.c: Removed.
5561         * pt-fcntl.c: Removed.
5562         * pt-fsync.c: Removed.
5563         * pt-lseek.c: Removed.
5564         * pt-msgrcv.c: Removed.
5565         * pt-msgsnd.c: Removed.
5566         * pt-msync.c: Removed.
5567         * pt-nanosleep.c: Removed.
5568         * pt-open64.c: Removed.
5569         * pt-pause.c: Removed.
5570         * pt-pread.c: Removed.
5571         * pt-pread64.c: Removed.
5572         * pt-pwrite.c: Removed.
5573         * pt-pwrite64.c: Removed.
5574         * pt-read.c: Removed.
5575         * pt-recv.c: Removed.
5576         * pt-recvfrom.c: Removed.
5577         * pt-recvmsg.c: Removed.
5578         * pt-send.c: Removed.
5579         * pt-sendto.c: Removed.
5580         * pt-sigtimedwait.c: Removed.
5581         * pt-sigwait.c: Removed.
5582         * pt-wait.c: Removed.
5583         * pt-waitpid.c: Removed.
5584         * pt-write.c: Removed.
5585         * pt-accept.c: Removed.
5586         * pt-close.c: Removed.
5587         * pt-connect.c: Removed.
5588         * pt-lseek64.c: Removed.
5589         * pt-sendmsg.c: Removed.
5590         * pt-tcdrain.c: Removed.
5592 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
5594         * init.c (__pthread_initialize_minimal_internal): Renamed from
5595         __pthread_initialize_minimal.  Make old name an alias.  This
5596         converts a normal relocation into a relative relocation.
5598         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
5600         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
5601         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
5602         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
5603         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
5604         pt-sigwaitinfo, pt-waitid, and pt-writev.
5605         * pt-creat.c: Removed.
5606         * pt-poll.c: Removed.
5607         * pt-pselect.c: Removed.
5608         * pt-readv.c: Removed.
5609         * pt-select.c: Removed.
5610         * pt-sigpause.c: Removed.
5611         * pt-sigsuspend.c: Removed.
5612         * pt-sigwaitinfo.c: Removed.
5613         * pt-waitid.c: Removed.
5614         * pt-writev.c: Removed.
5616         * init.c (pthread_functions): New variable.
5617         (__pthread_initialize_minimal): Pass pointer to pthread_functions
5618         (or NULL) to __libc_pthread_init.
5619         * forward.c: Rewrite to use __libc:pthread_functions array to get
5620         function addresses.
5621         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
5622         prototype.
5623         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5624         Take new parameter.  Copy content of variable pointed to by it
5625         to __libc_pthread_init.
5627         * pthreadP.h (struct pthread_functions): New type.
5628         (__libc_pthread_init): Declare.
5630         * pthread_attr_destroy.c: Add namespace protected alias.
5631         * pthread_attr_getdetachstate.c: Likewise.
5632         * pthread_attr_getinheritsched.c: Likewise.
5633         * pthread_attr_getschedparam.c: Likewise.
5634         * pthread_attr_getschedpolicy.c: Likewise.
5635         * pthread_attr_getscope.c: Likewise.
5636         * pthread_attr_setdetachstate.c: Likewise.
5637         * pthread_attr_setinheritsched.c: Likewise.
5638         * pthread_attr_setschedparam.c: Likewise.
5639         * pthread_attr_setschedpolicy.c: Likewise.
5640         * pthread_attr_setscope.c: Likewise.
5641         * pthread_cond_broadcast.c: Likewise.
5642         * pthread_cond_destroy.c: Likewise.
5643         * pthread_cond_init.c: Likewise.
5644         * pthread_cond_signal.c: Likewise.
5645         * pthread_cond_wait.c: Likewise.
5646         * pthread_condattr_destroy.c: Likewise.
5647         * pthread_condattr_init.c: Likewise.
5648         * pthread_equal.c: Likewise.
5649         * pthread_exit.c: Likewise.
5650         * pthread_getschedparam.c: Likewise.
5651         * pthread_self.c: Likewise.
5652         * pthread_setcancelstate.c: Likewise.
5653         * pthread_setschedparam.c: Likewise.
5654         * pthread_mutex_destroy.c: Likewise.
5655         * pthread_mutex_init.c: Likewise.
5656         * pthreadP.h: Add prototypes for the aliases.
5658         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
5659         multiple_threads member in correct TCB to 1.
5661         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
5662         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
5663         member of thread decriptor, otherwise return unconditionally 1.
5665 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
5667         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
5668         regular Linux version.  Remove file.
5669         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
5670         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
5671         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
5672         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
5673         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
5674         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
5675         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
5676         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
5677         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
5678         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
5679         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
5680         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
5681         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
5682         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
5683         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
5684         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
5685         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
5686         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
5687         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
5688         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
5689         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
5690         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
5691         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
5692         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
5693         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
5694         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
5695         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
5696         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
5697         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
5698         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
5700 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
5702         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
5703         * sysdeps/unix/sysv/linux/open.c: Removed.
5704         * sysdeps/unix/sysv/linux/fsync.c: Removed.
5705         * sysdeps/unix/sysv/linux/lseek.c: Removed.
5706         * sysdeps/unix/sysv/linux/msync.c: Removed.
5707         * sysdeps/unix/sysv/linux/read.c: Removed.
5708         * sysdeps/unix/sysv/linux/close.c: Removed.
5709         * sysdeps/unix/sysv/linux/creat.c: Removed.
5710         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
5711         * sysdeps/unix/sysv/linux/pause.c: Removed.
5712         * sysdeps/unix/sysv/linux/select.c: Removed.
5713         * sysdeps/unix/sysv/linux/write.c: Removed.
5715 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
5717         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
5718         element in TCB to see whether locking is needed.
5720         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
5721         MULTIPLE_THREADS_OFFSET value is correct.
5723         * sysdeps/unix/sysv/linux/close.c: New file.
5724         * sysdeps/unix/sysv/linux/connect.S: New file.
5725         * sysdeps/unix/sysv/linux/creat.c: New file.
5726         * sysdeps/unix/sysv/linux/fsync.c: New file.
5727         * sysdeps/unix/sysv/linux/llseek.c: New file.
5728         * sysdeps/unix/sysv/linux/lseek.c: New file.
5729         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
5730         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
5731         * sysdeps/unix/sysv/linux/msync.c: New file.
5732         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
5733         * sysdeps/unix/sysv/linux/open.c: New file.
5734         * sysdeps/unix/sysv/linux/open64.c: New file.
5735         * sysdeps/unix/sysv/linux/pause.c: New file.
5736         * sysdeps/unix/sysv/linux/poll.c: New file.
5737         * sysdeps/unix/sysv/linux/pread.c: New file.
5738         * sysdeps/unix/sysv/linux/pread64.c: New file.
5739         * sysdeps/unix/sysv/linux/pselect.c: New file.
5740         * sysdeps/unix/sysv/linux/pwrite.c: New file.
5741         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
5742         * sysdeps/unix/sysv/linux/readv.c: New file.
5743         * sysdeps/unix/sysv/linux/recv.S: New file.
5744         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
5745         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
5746         * sysdeps/unix/sysv/linux/select.c: New file.
5747         * sysdeps/unix/sysv/linux/send.S: New file.
5748         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
5749         * sysdeps/unix/sysv/linux/sendto.S: New file.
5750         * sysdeps/unix/sysv/linux/sigpause.c: New file.
5751         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
5752         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
5753         * sysdeps/unix/sysv/linux/sigwait.c: New file.
5754         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
5755         * sysdeps/unix/sysv/linux/system.c: New file.
5756         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
5757         * sysdeps/unix/sysv/linux/wait.c: New file.
5758         * sysdeps/unix/sysv/linux/waitid.c: New file.
5759         * sysdeps/unix/sysv/linux/waitpid.c: New file.
5760         * sysdeps/unix/sysv/linux/writev.c: New file.
5761         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
5763         * pt-readv.c: Fix comment.
5765 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
5767         * tst-cleanup1.c: Include stdlib.h.
5769         * tst-cancel5.c: New test.
5770         * Makefile (tests): Add tst-cancel5.
5771         (tst-cancel5): Link against libc.so libpthread.so in that order.
5773 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
5775         * forward.c (test_loaded): Prevent recursive calls.
5777         * Makefile (routines): Add libc-cancellation.
5778         * libc-cancellation.c: New file.
5779         * descr.h (struct pthread): Add multiple_threads field.
5780         * allocatestack.c (allocate_stack): Initialize multiple_header field of
5781         new thread descriptor to 1.
5782         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
5783         Initialize multiple_thread field after successful thread creation.
5784         * cancellation.c (__do_cancel): Move to pthreadP.h.
5785         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
5786         (__pthread_disable_asynccancel): Add internal_function attribute.
5787         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
5788         * pthread_setcancelstate.c: Likewise.
5789         * pthread_setcanceltype.c: Likewise.
5790         * pthread_exit.c: Likewise.
5791         * pthreadP.h (CANCELLATION_P): Likewise.
5792         (__do_cancel): Define as static inline.
5793         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
5794         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
5795         declarations.
5796         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
5797         fields.  Define MULTIPLE_THREADS_OFFSET.
5798         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
5799         declaration.
5800         * sysdeps/unix/sysv/linux/accept.S: New file.
5801         * sysdeps/unix/sysv/linux/read.c: New file.
5802         * sysdeps/unix/sysv/linux/write.c: New file.
5803         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
5804         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
5805         initialization of __libc_locking_needed.
5806         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
5807         __libc_locking_needed, use multiple_threads field in TCB.
5808         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
5810 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
5812         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
5813         version.
5814         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
5816         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
5817         access to __libc_locking_needed for PIC.
5819 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
5821         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
5822         declare for libc.so.
5823         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
5824         expression.
5825         (__libc_lock_lock): Put into statement expression.
5826         (__libc_lock_unlock): Remove trailing semicolon.
5827         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
5829 2002-12-12  Roland McGrath  <roland@redhat.com>
5831         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
5832         "m" constraint to refer to __libc_locking_needed.  Declare it here.
5834 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
5836         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
5837         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
5838         Initialize __libc_locking_needed.
5839         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
5840         instead of __register_pthread_fork_handler.
5841         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
5842         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
5843         fork-gen with libc_pthread_init.
5844         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
5845         of __register_pthread_fork_handler.
5846         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
5847         of __register_pthread_fork_handler.
5848         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
5849         __libc_locking_needed to determine whether lock prefix can be avoided.
5850         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
5852 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
5854         * Makefile (tests): Add tst-cleanup1.
5855         * tst-cleanup1.c: New file.
5856         * cancellation.c (__cleanup_thread): Removed.
5857         (__do_cancel): Remove call to __cleanup_thread.
5858         * pthreadP.h: Remove __cleanup_thread prorotype.
5860         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
5861         Remember function and argument even if cancellation handler
5862         function is not available.
5863         (__libc_cleanup_region_end): Execute registered function directly if
5864         pthread functions are not available.
5865         (__libc_cleanup_end): Likewise.
5867         * init.c (__pthread_initialize_minimal): Fix initialization in
5868         static lib by preventing gcc from being too clever.
5870 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
5872         * init.c (__pthread_initialize_minimal): Remove unneccesary
5873         sigaddset call.
5875         * Makefile (tests): We can run tst-locale2 now.
5877 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
5879         * Versions: Remove duplicated sigwait entry.
5881 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
5883         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
5884         inside libpthread.
5886         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
5888         * pthreadP.h: Declare __pthread_enable_asynccancel and
5889         __pthread_disable_asynccancel.
5890         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
5891         (CANCEL_RESET): Use __pthread_disable_asynccancel.
5892         * cancellation.c (__pthread_enable_asynccancel): New function.
5893         (__pthread_disable_asynccancel): New function.
5894         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
5895         * pt-close.c: Likewise.
5896         * pt-connect.c: Likewise.
5897         * pt-creat.c: Likewise.
5898         * pt-fcntl.c: Likewise.
5899         * pt-fsync.c: Likewise.
5900         * pt-lseek.c: Likewise.
5901         * pt-lseek64.c: Likewise.
5902         * pt-msgrcv.c: Likewise.
5903         * pt-msgsnd.c: Likewise.
5904         * pt-msync.c: Likewise.
5905         * pt-nanosleep.c: Likewise.
5906         * pt-open.c: Likewise.
5907         * pt-open64.c: Likewise.
5908         * pt-pause.c: Likewise.
5909         * pt-poll.c: Likewise.
5910         * pt-pread.c: Likewise.
5911         * pt-pread64.c: Likewise.
5912         * pt-pselect.c: Likewise.
5913         * pt-pwrite.c: Likewise.
5914         * pt-pwrite64.c: Likewise.
5915         * pt-read.c: Likewise.
5916         * pt-readv.c: Likewise.
5917         * pt-recv.c: Likewise.
5918         * pt-recvfrom.c: Likewise.
5919         * pt-recvmsg.c: Likewise.
5920         * pt-select.c: Likewise.
5921         * pt-send.c: Likewise.
5922         * pt-sendmsg.c: Likewise.
5923         * pt-sendto.c: Likewise.
5924         * pt-sigpause.c: Likewise.
5925         * pt-sigsuspend.c: Likewise.
5926         * pt-sigtimedwait.c: Likewise.
5927         * pt-sigwait.c: Likewise.
5928         * pt-sigwaitinfo.c: Likewise.
5929         * pt-system.c: Likewise.
5930         * pt-tcdrain.c: Likewise.
5931         * pt-wait.c: Likewise.
5932         * pt-waitid.c: Likewise.
5933         * pt-waitpid.c: Likewise.
5934         * pt-write.c: Likewise.
5935         * pt-writev.c: Likewise.
5936         * pthread_join.c: Likewise.
5937         * pthread_timedjoin.c: Likewise.
5939         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
5940         (__xpg_sigpause): New function.
5941         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
5943 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
5945         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
5947         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
5948         _GI_pthread_cleanup_pop to pthreadP.h.
5950         * ftrylockfile.c: Use _IO_lock_trylock instead of
5951         pthread_mutex_trylock.
5953         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
5954         (CANCEL_RESET): Likewise.
5955         (__pthread_setcanceltype_): Declare.
5956         (__pthread_mutex_lock_internal): Declare.
5957         (__pthread_mutex_unlock_internal): Declare.
5958         (__pthread_once_internal): Declare.
5959         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
5960         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
5962         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
5963         and pthread_mutex_unlock.
5964         * pthread_cond_wait.c: Likewise.
5965         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
5966         * pthread_mutex_unlock.c: Likewise.
5968         * pthread_setcanceltype.c: Add additional alias
5969         __pthread_setcanceltype.
5971         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
5972         * sem_open.c (sem_open): Likewise.
5973         Use __libc_open, __libc_write, and __libc_close instead of
5974         open, write, and close respectively.
5976         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
5977         Rewrite as statement expression since it must return a value.
5979         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
5980         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
5981         __pthread_kill.
5983         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
5984         alias __pthread_once_internal.
5986         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
5988 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
5990         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
5991         * tst-stdio1.c: New file.
5992         * tst-stdio2.c: New file.
5994         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
5996         * Makefile (tests): Comment out tst-locale2 for now.
5997         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
5999         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
6000         -D_IO_MTSAFE_IO.
6001         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
6002         Use _IO_lock_init instead of explicit assignment.
6004         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
6005         Define __libc_lock_* and __libc_lock_recursive macros with
6006         lowlevellock macros, not pthread mutexes.
6008         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
6009         of pthread_mutex_lock.
6010         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
6011         instead of pthread_mutex_unlock.
6013 2002-12-06  Roland McGrath  <roland@redhat.com>
6015         * allocatestack.c (__stack_user): Use uninitialized defn.
6016         * init.c (__pthread_initialize_minimal): Initialize it here.
6018 2002-12-05  Roland McGrath  <roland@redhat.com>
6020         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
6021         string.
6022         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
6024         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
6025         missing & here too.
6027 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
6029         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6030         lowlevellock.
6031         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
6032         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
6033         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
6034         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
6035         for __libc_lock_* macros.
6036         * Makefile (routines): Add libc-lowlevellock.
6038 2002-10-09  Roland McGrath  <roland@redhat.com>
6040         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
6041         Under [__PIC__], call the function via the pointer fetched for
6042         comparison rather than a call by name that uses the PLT.
6043         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
6044         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
6045         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
6046         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
6047         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
6049 2002-12-04  Roland McGrath  <roland@redhat.com>
6051         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
6053         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
6054         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
6056         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
6058 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6060         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
6061         a completely opaque, non-integer type.
6062         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6064 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
6066         * sysdeps/i386/tls.h: Include stdlib.h.
6067         * sysdeps/x86_64/tls.h: Likewise.
6069 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6071         * Makefile (tests): Add tst-locale2.
6072         (tests-static): Likewise.
6073         * tst-locale2.c: New file.
6075         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
6076         volatile and add memory clobbers to lock operations.
6078 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
6080         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
6081         * sysdeps/i386/i486/bits/atomic.h: New file.
6082         * sysdeps/i386/i586/bits/atomic.h: New file.
6083         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
6084         include i486 version.
6085         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
6086         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
6087         Patch by Marijn Ros <marijn@mad.scientist.com>.
6089         * allocatestack.c (get_cached_stack): Don't crash if we first
6090         found a stack with a larger size then needed.
6091         Reported by Hui Huang <hui.huang@sun.com>.
6093         * Makefile (tests): Add tst-sysconf.
6094         * tst-sysconf.c: New file.
6096         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
6097         PTHREAD_THREADS_MAX.
6099 2002-12-02  Roland McGrath  <roland@redhat.com>
6101         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
6102         Declare using hidden_proto instead of attribute_hidden, so there are
6103         non-.hidden static symbols for gdb to find.
6104         (__pthread_keys): Likewise.
6105         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
6106         * allocatestack.c (__stack_user): Likewise.
6107         * pthread_create.c (__pthread_keys): Likewise.
6108         (__nptl_threads_events, __nptl_last_event): Make these static instead
6109         of hidden.
6110         * pthread_key_create.c (__pthread_pthread_keys_max,
6111         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
6113 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
6115         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
6116         statically.
6117         * tst-locale1.c: New file.
6119         * pthread_cond_timedwait.c: Include <stdlib.h>.
6121         * Makefile (tests): Add tst-fork2 and tst-fork3.
6122         * tst-fork2.c: New file.
6123         * tst-fork3.c: New file.
6125 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
6127         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
6129         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
6130         require it to 200112L.
6132         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
6133         instruction only if HAVE_CMOV is defined.
6134         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
6136         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
6138         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
6140         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
6142         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
6144 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
6146         * sysdeps/x86_64/bits/atomic.h: New file.
6148         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
6149         16-bit operations.
6151         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
6152         possible since gettid cannot fail.
6154         * sysdeps/x86_64/pthreaddef.h: New file.
6156         * sysdeps/i386/pthreaddef.h (gettid): Removed.
6158         * sysdeps/x86_64/pthread_spin_init.c: New file.
6159         * sysdeps/x86_64/pthread_spin_lock.c: New file.
6160         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
6161         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
6163         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
6164         Add missing lock prefix.  Minute optimization.
6166         * tst-spin2.c (main): Also check successful trylock call.
6168         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
6169         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
6171         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
6172         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
6174         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
6175         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
6176         value in case of an error.  Add support for INTERNAL_SYSCALL.
6178         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
6179         value in case of an error.
6181         * sysdeps/x86_64/tls.h: New file.
6183 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6185         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
6186         takes the array member name and the index as parameters.
6187         (THREAD_SETMEM_NC): Likewise.
6188         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
6189         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
6190         interfaces.
6192         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
6193         to decide which code to use.
6194         (THREAD_SETMEM_NC): Likewise.
6196         * allocatestack.c (queue_stack): Don't remove stack from list here.
6197         Do it in the caller.  Correct condition to prematurely terminate
6198         loop to free stacks.
6199         (__deallocate_stack): Remove stack from list here.
6201 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6203         * Makefile (tests): Add tst-stack1.
6204         * tst-stack1.c: New file.
6206         * allocatestack.c (allocate_stack): Initialize the TCB on a user
6207         provided stack.
6209         * pthread_attr_getstack.c: Return bottom of the thread area.
6211 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
6213         * Makefile (libpthread-routines): Add pt-allocrtsig and
6214         pthread_kill_other_threads.
6215         * pt-allocrtsig.c: New file.
6216         * pthread_kill_other_threads.c: New file.
6217         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
6218         all three functions.
6219         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6220         allocrtsig.
6221         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
6222         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
6223         and __libc_allocate_rtsig_private.
6224         * Versions (libpthread): Export pthread_kill_other_threads_np,
6225         __libc_current_sigrtmin, and __libc_current_sigrtmax.
6227 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
6229         * allocatestack.c (allocate_stack): stackaddr in attribute points to
6230         the end of the stack.  Adjust computations.
6231         When mprotect call fails dequeue stack and free it.
6232         * pthread_attr_setstack.c: Store top of the stack in stackaddr
6233         attribute.
6234         * pthread_getattr_np.c: Likewise.
6236         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
6237         surprises.
6239 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
6241         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
6242         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6244 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
6246         * pthread_getspecific.c: Optimize access to first 2nd-level array.
6247         * pthread_setspecific.c: Likewise.
6249 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
6251         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
6252         definitions.  Get them from the official place.
6253         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
6255         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
6256         Use new CLONE_ flags in clone() calls.
6258         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
6259         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
6261         * Versions: Add pthread_* functions for libc.
6262         * forward.c: New file.
6264         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
6265         errno-loc.
6266         * herrno.c: New file.
6267         * res.c: New file.
6269         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
6270         sem_trywait, and sem_timedwait.  Add herrno and res.
6271         * sem_init.c: Don't initialize lock and waiters members.
6272         * sem_open.c: Likewise.
6273         * sem_post.c: Removed.
6274         * sem_wait.c: Removed.
6275         * sem_trywait.c: Removed.
6276         * sem_timedwait.c: Removed.
6277         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
6278         Includes full implementations of sem_post, sem_wait, sem_trywait,
6279         and sem_timedwait.
6280         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
6281         for new implementation.
6282         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
6283         and waiters fields.
6285         * tst-sem3.c: Improve error message.
6286         * tst-signal3.c: Likewise.
6288         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
6289         to tell the kernel about the termination futex and to initialize tid
6290         member.  Don't initialize main_thread.
6291         * descr.h (struct pthread): Remove main_thread member.
6292         * cancelllation.c (__do_cancel): Remove code handling main thread.
6293         The main thread is not special anymore.
6295         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
6296         size of the stacks to stack_cache_actsize.
6298         * pt-readv.c: Add missing "defined".
6299         * pt-sigwait.c: Likewise.
6300         * pt-writev.c: Likewise.
6302 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
6304         * Versions: Export __connect from libpthread.
6305         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6307         * Makefile (libpthread-routines): Add pt-raise.
6308         * sysdeps/unix/sysv/linux/raise.c: New file.
6309         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
6310         * sysdeps/generic/pt-raise.c: New file.
6312         * pthread_cond_init.c: Initialize all data elements of the condvar
6313         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6315         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
6316         * pthread_create.c: Likewise.
6318         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
6319         * tst-key1.c: New file.
6320         * tst-key2.c: New file.
6321         * tst-key3.c: New file.
6323         * Versions: Export pthread_detach for version GLIBC_2.0.
6324         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
6326 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
6328         * pthread_key_create.c: Terminate search after an unused key was found.
6329         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6331         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
6332         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6334 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
6336         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
6337         dynamic lookup for errno in PIC.
6339         * allocatestack.c (get_cached_stack): Rearrange code slightly to
6340         release the stack lock as soon as possible.
6341         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
6342         the static TLS block.
6343         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
6345         * cancellation.c: Renamed from cancelation.c.
6346         * Makefile: Adjust accordingly.
6347         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
6348         * cleanup_defer.c: Use CANCELLATION_P.
6349         * pthread_testcancel.c: Likewise.
6350         * descr.h: Fix spelling in comments.
6351         * init.c: Likewise.
6352         * pthread_getattr_np.c: Likewise.
6353         * pthread_getschedparam.c: Likewise.
6354         * pthread_setschedparam.c: Likewise.
6355         * Versions: Likewise.
6357         * pt-pselect.c: New file.
6358         * Makefile (libpthread-routines): Add pt-pselect.
6359         * Versions: Add pselect.
6361         * tst-cancel4.c: New file.
6362         * Makefile (tests): Add tst-cancel4.
6364 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
6366         * pthread_mutex_lock.c: Always record lock ownership.
6367         * pthread_mutex_timedlock.c: Likewise.
6368         * pthread_mutex_trylock.c: Likewise.
6370         * pt-readv.c: New file.
6371         * pt-writev.c: New file.
6372         * pt-creat.c: New file.
6373         * pt-msgrcv.c: New file.
6374         * pt-msgsnd.c: New file.
6375         * pt-poll.c: New file.
6376         * pt-select.c: New file.
6377         * pt-sigpause.c: New file.
6378         * pt-sigsuspend.c: New file.
6379         * pt-sigwait.c: New file.
6380         * pt-sigwaitinfo.c: New file.
6381         * pt-waitid.c: New file.
6382         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
6383         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
6384         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
6385         * Versions: Add all the new functions.
6387         * tst-exit1.c: New file.
6388         * Makefile (tests): Add tst-exit1.
6390         * sem_timedwait.c: Minor optimization for more optimal fastpath.
6392 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
6394         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
6396         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
6397         call.  pthread_join is an official cancellation point.
6398         * pthread_timedjoin.c: Likewise.
6400         * pthread_cond_wait.c: Revert order in which internal lock are dropped
6401         and the condvar's mutex are retrieved.
6402         * pthread_cond_timedwait.c: Likewise.
6403         Reported by dice@saros.East.Sun.COM.
6405 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
6407         * pthreadP.h: Cut out all type definitions and move them...
6408         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
6409         * pthreadP.h: Include <internaltypes.h>.
6411         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
6412         performance tweaks.
6414         * sem_trywait.c: Shuffle #includes around to get right order.
6415         * sem_timedwait.c: Likewise.
6416         * sem_post.c: Likewise.
6417         * sem_wait.c: Likewise.
6419         * nptl 0.3 released.
6421         * Makefile (tests): Add tst-signal3.
6422         * tst-signal3.c: New file.
6424 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
6426         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
6427         the asms modify the sem object.
6428         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
6430         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
6431         the actual members.
6432         * pthreadP.h (struct sem): New type.  Actual semaphore type.
6433         * semaphoreP.h: Include pthreadP.h.
6434         * sem_getvalue.c: Adjust to sem_t change.
6435         * sem_init.c: Likewise.
6436         * sem_open.c: Likewise.
6437         * sem_post.c: Likewise.
6438         * sem_timedwait.c: Likewise.
6439         * sem_trywait.c: Likewise.
6440         * sem_wait.c: Likewise.
6442 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
6444         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
6445         * tst-basic2.c: New file.
6446         * tst-exec1.c: New file.
6447         * tst-exec2.c: New file.
6448         * tst-exec3.c: New file.
6450         * tst-fork1.c: Remove extra */.
6452         * nptl 0.2 released.  The API for IA-32 is complete.