* configure.in (--with-headers): Let argument contain a : separated
[glibc.git] / nptl / ChangeLog
blob6cd9b0dbd8bde0bec728edce5d4feebef7c671b3
1 2004-09-10  Roland McGrath  <roland@redhat.com>
3         [BZ #379]
4         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
5         code, since we don't try to use the broken CLONE_STOPPED any more.
6         * pthread_create.c (start_thread): Likewise.
8 2004-09-15  Richard Henderson  <rth@redhat.com>
10         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
12 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
14         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
15         (__libc_unwind_longjmp): Delete macro and declare as function.
16         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
17         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
18         nptl directory.
19         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
20         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
21         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
23 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
25         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
26         for __USE_XOPEN2K.
27         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
28         types also for __USE_XOPEN2K.
29         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
30         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
31         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
32         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
33         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
34         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
35         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
36         [BZ #320]
38 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
40         * sysdeps/pthread/pthread.h
41         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
42         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
43         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
44         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
45         [BZ #375]
47 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
49         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
50         PSEUDO to be used with . prefix.
52         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
53         Use atomic_increment instead of atomic_exchange_and_add.
54         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
55         Likewise.
56         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
57         Likewise.
58         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
59         Likewise.
61         * allocatestack.c (allocate_stack): Use atomic_increment_val
62         instead of atomic_exchange_and_add.
63         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
64         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
65         Likewise.
66         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
67         Likewise.
69         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
70         the initialization function might throw.
72 2005-09-05  Richard Henderson  <rth@redhat.com>
74         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
75         Move definition inside libpthread, libc, librt check.  Provide
76         definition for rtld.
78 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
80         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
81         * sysdeps/i386/jmpbuf-unwind.h: Likewise
82         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
83         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
84         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
85         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
86         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
87         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
88         * unwind.c: Use it.
90         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
91         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
92         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
93         Likewise.
94         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
95         Decrement __nwaiters.  If pthread_cond_destroy has been called and
96         this is the last waiter, signal pthread_cond_destroy caller and
97         avoid using the pthread_cond_t structure after unlock.
98         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
99         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
100         Read clock type from the least significant bits of __nwaiters instead
101         of __clock.
102         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
103         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
105 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
107         [BZ #342]
108         * Makefile (tests): Add tst-cond20 and tst-cond21.
109         * tst-cond20.c: New test.
110         * tst-cond21.c: New test.
111         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
112         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
113         it unsigned int.
114         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
115         Likewise.
116         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
117         (pthread_cond_t): Likewise.
118         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
119         Likewise.
120         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
121         Likewise.
122         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
123         Likewise.
124         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
125         (cond_nwaiters): New.
126         (clock_bits): New.
127         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
128         if there are waiters not signalled yet.
129         Wait until all already signalled waiters wake up.
130         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
131         __nwaiters.  If pthread_cond_destroy has been called and this is the
132         last waiter, signal pthread_cond_destroy caller and avoid using
133         the pthread_cond_t structure after unlock.
134         (__pthread_cond_wait): Increment __nwaiters in the beginning,
135         decrement it when leaving.  If pthread_cond_destroy has been called
136         and this is the last waiter, signal pthread_cond_destroy caller.
137         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
138         Likewise.  Read clock type from the least significant bits of
139         __nwaiters instead of __clock.
140         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
141         whether clock ID can be encoded in COND_CLOCK_BITS bits.
142         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
143         clock type just from the last COND_CLOCK_BITS bits of value.
144         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
145         instead of __clock, just from second bit of condattr's value.
147 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
149         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
150         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
151         != 64.
152         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
154 2004-08-15  Roland McGrath  <roland@frob.com>
156         * pthread_atfork.c: Update copyright terms including special exception
157         for these trivial files, which are statically linked into executables
158         that use dynamic linking for the significant library code.
160 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
162         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
163         pthread_rwlock_rdlock.
164         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
165         Decrease __nr_readers_queued after reacquiring lock.
166         * sysdeps/pthread/pthread_rwlock_timedrdlock
167         (pthread_rwlock_timedrdlock): Likewise.
168         Reported by Bob Cook <bobcook47@hotmail.com>.
170 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
172         * tst-rwlock14.c (tf): Read main thread handle from *ARG
173         before pthread_barrier_wait.
175 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
177         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
178         Remove unnecessary exception handling data.
180 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
182         [BZ #284]
183         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
184         instead of clockid_t.
186 2004-07-21  Roland McGrath  <roland@redhat.com>
188         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
190 2004-07-19  Roland McGrath  <roland@redhat.com>
192         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
194 2004-07-02  Roland McGrath  <roland@redhat.com>
196         * configure: Don't exit.
198 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
200         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
201         (__pthread_cond_timedwait): Check for invalid nanosecond in
202         timeout value.
204 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
206         * Makefile: Add rules to build and run tst-fini1.
207         * tst-fini1.c: New file.
208         * tst-fini1mod.c: New file.
210 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
212         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
213         if no cancellation support is needed.
214         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
215         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
216         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
217         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
218         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
219         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
220         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
221         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
222         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
224         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
225         only if not already defined.
227 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
229         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
230         constraint "m" instead of "0" for futex.
232         * shlib-versions: Add powerpc64-.*-linux.*.
234 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
236         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
237         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
238         for valid tv_nsec.
239         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
240         1 billion and 64-bit tv_nsec which is valid when truncated to 32
241         bits.
243 2004-06-29  Roland McGrath  <roland@redhat.com>
245         * Banner: NPTL no longer has its own version number.
246         * Makefile (nptl-version): Variable removed.
247         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
248         using $(version), the glibc version number.
250 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
252         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
253         Fix branch offset for a PLT entry.
254         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
255         Likewise.
256         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
257         Likewise.
258         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
259         Likewise.
260         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
261         Likewise.
263 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
265         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
266         unconditionally.
268 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
270         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
271         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
272         instead of tv_sec.
273         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
274         (pthread_rwlock_timedrdlock): Likewise.
276 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
278         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
279         Set __r7 to val, not mutex.
281 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
283         * Makefile: Add rules to build tst-rwlock14.
284         * tst-rwlock14.c: New file.
286 2004-06-24  Boris Hu  <boris.hu@intel.com>
288         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
289         check.
290         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
292 2004-06-19  Andreas Jaeger  <aj@suse.de>
294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
295         assembler in last patch.
297 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
299         * sysdeps/pthread/pthread_cond_timedwait.c
300         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
301         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
302         (__pthread_cond_timedwait): Check for invalid nanosecond in
303         timeout value.
304         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
305         * tst-cond19.c: New file.
306         * Makefile: Add rules to build and run tst-cond19.
308 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
310         * tst-context1.c (GUARD_PATTERN): Defined.
311         (tst_context_t): Define struct containing ucontext_t & guard words.
312         (ctx): Declare as an array of tst_context_t.
313         (fct): Verify uc_link & guard words are still valid.
314         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
316 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
318         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
319         Add __data.__futex field, reshuffle __data.__clock.
320         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
321         (__pthread_cond_signal): Increment __futex at the same time as
322         __wakeup_seq or __total_seq.  Pass address of __futex instead of
323         address of low 32-bits of __wakeup_seq to futex syscall.
324         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
325         (__pthread_cond_wait): Likewise.  Pass __futex value from before
326         releasing internal lock to FUTEX_WAIT.
327         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
328         (__pthread_cond_timedwait): Likewise.
329         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
330         (FUTEX_CMP_REQUEUE): Define.
331         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
332         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
333         Pass __futex value from before the unlock and __futex address instead
334         of address of low 32-bits of __wakeup_seq to futex syscall.
335         Fallback to FUTEX_WAKE all on any errors.
337 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
339         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
340         comment typo.
341         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
342         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
343         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
344         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
345         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
347 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
349         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
350         Add memory clobber to inline assembly.
351         (__lll_mutex_trylock): Likewise.
352         (__lll_mutex_cond_trylock): Likewise.
354 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
356         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
357         Pass val argument as 6th system call argument in %r7.
359 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
361         * Makefile (tests): Add tst-cond16.
362         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
363         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
364         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
365         Add __data.__futex field, reshuffle __data.__clock.
366         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
367         (__pthread_cond_signal): Increment __futex at the same time as
368         __wakeup_seq or __total_seq.  Pass address of __futex instead of
369         address of low 32-bits of __wakeup_seq to futex syscall.
370         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
371         (__pthread_cond_wait): Likewise.  Pass __futex value from before
372         releasing internal lock to FUTEX_WAIT.
373         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
374         (__pthread_cond_timedwait): Likewise.
375         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
376         (FUTEX_CMP_REQUEUE): Define.
377         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
378         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
379         Pass __futex value from before the unlock and __futex address instead
380         of address of low 32-bits of __wakeup_seq to futex syscall.
381         Fallback to FUTEX_WAKE all on any errors.
382         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
383         Define.
384         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
385         internally.  Return non-zero if error, zero if success.
386         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
387         Add __data.__futex field, reshuffle __data.__clock.
388         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
389         Define.
390         (lll_futex_requeue): Add val argument, return 1 unconditionally
391         for the time being.
392         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
393         Add __data.__futex field, reshuffle __data.__clock.
394         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
395         Define.
396         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
397         internally.  Return non-zero if error, zero if success.
398         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
399         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
400         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
401         Define.
402         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
403         internally.  Return non-zero if error, zero if success.
404         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
405         Add __data.__futex field, reshuffle __data.__clock.
406         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
407         Define.
408         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
409         internally.  Return non-zero if error, zero if success.
410         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
411         Add __data.__futex field, reshuffle __data.__clock.
412         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
413         Add __data.__futex field, reshuffle __data.__clock.
414         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
415         Increment __futex at the same time as __wakeup_seq or __total_seq.
416         Pass address of __futex instead of address of low 32-bits of
417         __wakeup_seq to futex syscall.
418         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
419         Pass __futex value from before releasing internal lock
420         to FUTEX_WAIT.
421         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
422         Likewise.  Avoid unnecessary shadowing of variables.
423         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
424         Set __futex to 2 * __total_seq.  Pass __futex value from before the
425         unlock and __futex address instead of address of low 32-bits of
426         __wakeup_seq to futex_requeue macro, adjust for new return value
427         meaning.
428         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
429         (__pthread_cond_signal): Increment __futex at the same time as
430         __wakeup_seq or __total_seq.  Pass address of __futex instead of
431         address of low 32-bits of __wakeup_seq to futex syscall.
432         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
433         (__pthread_cond_wait): Likewise.  Pass __futex value from before
434         releasing internal lock to FUTEX_WAIT.
435         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
436         (__pthread_cond_timedwait): Likewise.
437         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
438         (FUTEX_CMP_REQUEUE): Define.
439         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
440         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
441         Pass __futex value from before the unlock and __futex address instead
442         of address of low 32-bits of __wakeup_seq to futex syscall.
443         Fallback to FUTEX_WAKE all on any errors.
445 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
447         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
448         Add nop to align the end of critical section.
449         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
451 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
453         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
454         Add __broadcast_seq field.
455         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
456         all waiters as woken with woken_seq and bump broadcast counter.
457         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
458         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
459         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
460         Comment typo fixes.  Avoid returning -ETIMEDOUT.
462 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
464         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
465         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
466         Reported by Kaz Kojima.
468 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
470         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
472 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
474         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
475         __broadcast_seq with bc_seq after acquiring internal lock instead of
476         before it.
478 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
480         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
481         compilation.
482         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
483         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
484         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
485         (pthread_cond_t): Add __data.__broadcast_seq field.
486         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
487         (FRAME_SIZE): Define.
488         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
489         Comment typo fixes.
490         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
491         Define.
492         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
493         typo fixes.
494         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
495         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
496         fixes.
498 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
500         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
501         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
502         Add __broadcast_seq field.
503         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
504         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
505         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
506         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
507         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
509         all waiters as woken with woken_seq and bump broadcast counter.
510         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
512         __broadcast_seq field.
513         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
514         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
515         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
516         * pthread_cond_init.c: Initialize __broadcast_seq field.
517         * Makefile (tests): Add tst-cond17 and tst-cond18.
518         Add .NOTPARALLEL goal.
519         * tst-cond16.c: New file.  From Jakub.
520         * tst-cond17.c: New file.  From Jakub.
521         * tst-cond18.c: New file.  From Jakub.
523 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
525         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
526         unwind info.
528         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
529         Parametrize frame size.  Correct some unwind info.
530         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
532 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
534         * tst-stack3.c: Note testing functionality beyond POSIX.
536 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
538         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
539         Change conditional from ifdef to if.
541 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
543         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
544         SYSDEP_CANCEL_ERROR): Define.
545         (PSEUDO): Use it.
547 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
549         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
551 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
553         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
555 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
557         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
558         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
559         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
560         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
562 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
564         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
565         thread has all signals blocked.
567 2004-04-18  Andreas Jaeger  <aj@suse.de>
569         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
570         (SEM_VALUE_MAX): Add missing brace.
572 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
574         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
575         in rt subdir.
576         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
577         * sysdeps/pthread/tst-mqueue8x.c: New test.
578         * tst-cancel4.c: Update comment about message queues.
580         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
581         return it_value { 0, 0 }.
582         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
583         like SIGEV_SIGNAL.
584         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
585         assertion for SIGEV_NONE.
586         (thread_attr_compare): Compare all attributes, not just a partial
587         subset.
589 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
591         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
593 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
595         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
596         Just use a plain number.
597         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
598         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
599         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
600         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
601         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
602         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
603         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
605 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
607         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
608         frame info.
609         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
611 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
613         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
614         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
615         of calling sigwaitinfo.
617 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
619         * allocatestack.c (allocate_stack): Set reported_guardsize
620         unconditionally.
621         * pthread_getattr_np.c (pthread_getattr_np): Use
622         reported_guardsize instead of guardsize.
623         * descr.h (struct pthread): Add reported_guardsize field.
625 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
627         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
629 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
631         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
633 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
635         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
636         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
637         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
638         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
639         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
640         Define.
641         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
642         (_POSIX_MESSAGE_PASSING): Define.
643         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
644         (_POSIX_MESSAGE_PASSING): Define.
645         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
646         (_POSIX_MESSAGE_PASSING): Define.
648 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
650         * tst-context1.c (fct): Check whether correct stack is used.
652 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
654         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
655         matching constraints for asm mem parameters.
657         * tst-clock2.c (tf): Don't define unless needed.
659 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
661         * Makefile (link-libc-static): Use $(static-gnulib) instead of
662         $(gnulib).
664 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
666         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
667         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
668         * pthreadP.h: Declare __nptl_deallocate_tsd.
669         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
670         Adjust caller.
672         * Makefile (tests): Add tst-tsd5.
673         * tst-tsd5.c: New file.
675 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
677         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
678         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
679         is SHLIB_COMPAT check.
680         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
681         (__pthread_attr_getaffinity_old): Likewise.
682         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
683         (__pthread_getaffinity_old): Likewise.
684         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
685         (__pthread_setaffinity_old): Likewise.
687 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
689         * allocatestack.c (_make_stacks_executable): Call
690         _dl_make_stack_executable first.
692 2004-03-24  Roland McGrath  <roland@redhat.com>
694         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
695         constraint instead of "0".
697 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
699         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
700         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
702         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
703         code to avoid warning.
705 2004-03-24  Andreas Jaeger  <aj@suse.de>
707         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
708         (__pthread_attr_setaffinity_old): Remove const.
710 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
712         * sysdeps/unix/sysv/linux/smp.h: New file.
713         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
714         * init.c: Define __is_smp.
715         (__pthread_initialize_minimal_internal): Call is_smp_system to
716         initialize __is_smp.
717         * pthreadP.h: Declare __is_smp.
718         Define MAX_ADAPTIVE_COUNT is necessary.
719         * pthread_mutex_init.c: Add comment regarding __spins field.
720         * pthread_mutex_lock.c: Implement adaptive mutex type.
721         * pthread_mutex_timedlock.c: Likewise.
722         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
723         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
724         Add __spins field.
725         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
726         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
727         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
728         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
729         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
730         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
731         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
732         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
733         lll_mutex_cond_trylock.
734         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
735         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
736         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
737         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
738         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
739         Define BUSY_WAIT_NOP.
740         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
741         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
743         * tst-mutex5.c: Add support for testing adaptive mutexes.
744         * tst-mutex7.c: Likewise.
745         * tst-mutex5a.c: New file.
746         * tst-mutex7a.c: New file.
747         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
749         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
750         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
751         vgettimeofday call might destroy the content.
753         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
754         @pause in the loop.
756         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
757         No need to restrict type of ret.  Make it int.  Add comment.
759         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
760         Remove unnecessary setne instruction.
762 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
764         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
765         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
766         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
767         If realloc fails, break out of the loop.
769 2004-03-20  Andreas Jaeger  <aj@suse.de>
771         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
772         (__pthread_setaffinity_old): Fix interface.
773         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
774         (__pthread_getaffinity_old): Likewise.
776         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
777         (__pthread_setaffinity_new): Remove duplicate declaration.
779 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
781         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
782         the return value to a safe register.
783         (CDISABLE): Set the function argument correctly.
785 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
787         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
788         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
789         Rewrite so that only one locked memory operation per round is needed.
790         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
791         (pthread_barrier_wait): After wakeup, release lock only when the
792         last thread stopped using the barrier object.
793         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
794         (__pthread_cond_wait): Don't store mutex address if the current
795         value is ~0l.  Add correct cleanup support and unwind info.
796         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
797         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
798         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
799         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
800         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
801         Add correct cleanup support and unwind info.
802         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
803         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
804         information for syscall wrappers.
806 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
808         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
809         cpusetsize field, remove next.
810         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
811         parameter for size of the CPU set.
812         (pthread_setaffinity_np): Likewise.
813         (pthread_attr_getaffinity_np): Likewise.
814         (pthread_attr_setaffinity_np): Likewise.
815         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
816         interface change, keep compatibility code.
817         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
818         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
819         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
820         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
821         __pthread_getaffinity_np.
822         * Versions: Add version for changed interfaces.
823         * tst-attr3.c: Adjust test for interface change.
824         * pthread_getattr_np.c: Query the kernel about the affinity mask with
825         increasing buffer sizes.
826         * pthread_attr_destroy.c: Remove unused list handling.
827         * pthread_attr_init.c: Likewise.
829 2004-03-17  Roland McGrath  <roland@redhat.com>
831         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
832         first argument to clock_getres so we ever enable kernel timers.
834 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
836         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
838 2004-03-12  Richard Henderson  <rth@redhat.com>
840         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
841         oldvalue from CENABLE to CDISABLE.
843 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
845         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
846         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
847         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
848         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
850 2004-03-11  Richard Henderson  <rth@redhat.com>
852         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
853         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
854         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
856 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
858         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
859         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
860         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
862 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
864         * forward.c (__pthread_cond_broadcast_2_0,
865         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
866         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
867         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
869 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
871         * sysdeps/sh/tcb-offsets.sym: Add PID.
872         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
873         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
875 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
877         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
878         include <sysdep-cancel.h>, vfork is no cancellation point.
879         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
880         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
881         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
883 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
885         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
886         libc_hidden_def.
887         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
888         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
889         Likewise.
890         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
891         Likewise.
892         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
893         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
894         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
895         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
896         of DO_CALL_VIA_BREAK.  Work around a gas problem.
898         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
899         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
900         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
901         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
902         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
903         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
905         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
906         a local register for saving old PID.  Negate PID in parent upon exit.
908         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
909         tcb-offsets.h.
910         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
911         before syscall, set to the old value in the parent afterwards.
912         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
913         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
914         tcb-offsets.h.
915         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
916         before syscall, set to the old value in the parent afterwards.
917         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
918         * sysdeps/s390/tcb-offsets.sym: Add PID.
920         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
921         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
922         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
923         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
924         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
925         * sysdeps/sparc/tcb-offsets.sym: Add PID.
927 2004-03-10  Andreas Schwab  <schwab@suse.de>
929         * sysdeps/ia64/tcb-offsets.sym: Add PID.
930         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
931         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
933 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
935         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
936         * tst-cancel21.c (do_one_test): Likewise.
937         Reported by Gordon Jin <gordon.jin@intel.com>.
939 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
941         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
942         if non-zero and set to INT_MIN if zero.
943         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
944         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
945         (SAVE_PID, RESTORE_PID): Define.
946         (__vfork): Use it.
947         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
948         Use relative path to avoid including NPTL i386/vfork.S.
949         (SAVE_PID, RESTORE_PID): Define.
950         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
951         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
952         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
953         tst-vfork2x.
954         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
955         * tst-vfork1.c: New test.
956         * tst-vfork2.c: New test.
957         * tst-vfork1x.c: New test.
958         * tst-vfork2x.c: New test.
960 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
962         * sysdeps/i386/tcb-offsets.sym: Add PID.
963         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
964         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
965         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
967 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
969         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
971 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
973         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
974         _rtld_global_ro.
976 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
978         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
979         _rtld_global_ro.
981         * tst-once4.c: Remove unnecessary macro definition.
983         * tst-mutex7.c (do_test): Limit thread stack size.
984         * tst-once2.c (do_test): Likewise.
985         * tst-tls3.c (do_test): Likewise.
986         * tst-tls1.c (do_test): Likewise.
987         * tst-signal3.c (do_test): Likewise.
988         * tst-kill6.c (do_test): Likewise.
989         * tst-key4.c (do_test): Likewise.
990         * tst-join4.c (do_test): Likewise.
991         * tst-fork1.c (do_test): Likewise.
992         * tst-context1.c (do_test): Likewise.
993         * tst-cond2.c (do_test): Likewise.
994         * tst-cond10.c (do_test): Likewise.
995         * tst-clock2.c (do_test): Likewise.
996         * tst-cancel10.c (do_test): Likewise.
997         * tst-basic2.c (do_test): Likewise.
998         * tst-barrier4.c (do_test): Likewise.
1000 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
1002         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
1004 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
1006         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1007         (__pthread_cond_timedwait): Optimize wakeup test.
1008         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1009         (__pthread_cond_wait): Likewise.
1010         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1011         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1012         Likewise.
1014 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
1016         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1017         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
1018         the atomic instruction needed.
1019         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1020         (__lll_mutex_lock_wait): Likewise.
1022 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
1024         * Makefile (tests): Add tst-cond14 and tst-cond15.
1025         * tst-cond14.c: New file.
1026         * tst-cond15.c: New file.
1028 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
1030         * sysdeps/pthread/createthread.c (create_thread): Remove use of
1031         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
1032         needs to be implemented differently to be useful.
1034 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
1036         * pthread_attr_setschedparam.c: Don't test priority against limits
1037         here.  Set ATTR_FLAG_SCHED_SET flag.
1038         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
1039         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
1040         from parent thread to child.  If attribute is used and scheduling
1041         parameters are not inherited, copy parameters from attribute or
1042         compute them.  Check priority value.
1043         * pthread_getschedparam.c: If the parameters aren't known yet get
1044         them from the kernel.
1045         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
1046         ATTR_FLAG_POLICY_SET flag for thread.
1047         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
1048         and ATTR_FLAG_POLICY_SET.
1050         * sysdeps/pthread/createthread.c: Use tgkill if possible.
1052         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
1053         fail if stack address hasn't been set.  Just return 0.
1055 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
1057         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
1058         libpthread for the files in this list.
1059         (CFLAGS-tst-unload): Removed.
1060         * tst-unload.c (do_test): Don't use complete path for
1061         LIBPHREAD_SO.
1063         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
1064         tst-_res1mod2.
1066 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
1068         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1069         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
1070         operation per round is needed.
1071         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1072         (__lll_mutex_lock_wait): Likewise.
1074 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
1076         * tst-cancel9.c (cleanup): Don't print to stderr.
1078 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1080         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
1082 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1084         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1085         (__syscall_error_handler2): Call CDISABLE.
1086         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1087         (__syscall_error_handler2): Call CDISABLE.
1089         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1090         Release lock before the loop, don't reacquire it.
1092         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
1094 2004-02-19  Andreas Schwab  <schwab@suse.de>
1096         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1097         Fix last change.
1099 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
1101         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1102         (pthread_barrier_wait): After wakeup, release lock only when the
1103         last thread stopped using the barrier object.
1104         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
1105         (pthread_barrier_wait): Likewise.
1106         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1107         Likewise.
1108         * Makefile (tests): Add tst-barrier4.
1109         * tst-barrier4.c: New file.
1111         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1112         (__pthread_cond_timedwait): Perform timeout test while holding
1113         internal lock to prevent wakeup race.
1114         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1115         * sysdeps/pthread/pthread_cond_timedwait.c
1116         (__pthread_cond_timedwait): Likewise.
1117         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1118         (__pthread_cond_timedwait): Likewise.
1120 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
1122         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
1123         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
1124         * Makefile (tests): Add tst-rwlock13.
1125         * tst-rwlock13.c: New test.
1127 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
1129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1130         (__condvar_tw_cleanup): Little optimization.
1131         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1133 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
1135         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
1136         libpthread as "lib" parameter to SHLIB_COMPAT.
1137         (__novmx_siglongjmp): Fix typo in function name.
1138         (__novmx_longjmp): Fix typo in function name.
1140 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1142         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
1143         __builtin_expect.
1145         * sysdeps/generic/pt-longjmp.c: Moved to...
1146         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
1148 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
1150         * Makefile (libpthread-routines): Add pt-cleanup.
1151         * pt-longjmp.c: Removed.
1152         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1153         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1154         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1155         Version longjmp, siglongjmp for GLIBC_2.3.4.
1156         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1158 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1160         * sysdeps/pthread/pthread_cond_timedwait.c
1161         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1162         Reuse code.  Add __builtin_expects.
1164         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1165         (__pthread_cond_timedwait): Get internal lock in case timeout has
1166         passed before the futex syscall.
1167         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1169 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1171         * allocatestack.c: Pretty printing.
1173         * sysdeps/pthread/createthread.c (create_thread): Don't add
1174         CLONE_DETACHED bit if it is not necessary.
1176 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1178         * pthread_getattr_np.c: Include ldsodefs.h.
1180 2004-01-16  Richard Henderson  <rth@redhat.com>
1182         * allocatestack.c: Don't declare __libc_stack_end.
1183         * init.c (__pthread_initialize_minimal_internal): Likewise.
1184         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1186 2004-01-15  Richard Henderson  <rth@redhat.com>
1188         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1189         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1190         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1191         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1192         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1193         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1194         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1195         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1197 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1199         * init.c (pthread_functions): Make array const.
1201 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1203         * allocatestack.c (__make_stacks_executable): Change interface.
1204         Check parameters.  Pass parameter on to libc counterpart.
1205         * pthreadP.h: Change declaration.
1207 2004-01-13  Richard Henderson  <rth@redhat.com>
1209         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1210         prototype form.
1211         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1212         Likewise.
1214         * sysdeps/alpha/Makefile: New file.
1215         * sysdeps/alpha/tcb-offsets.sym: New file.
1216         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1217         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
1219         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
1220         on powerpc version.
1222 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
1224         * Makefile (tests): Add tst-backtrace1.
1225         * tst-backtrace1.c: New test.
1227 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
1229         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
1230         register as second parameter to the REGISTER macro.
1231         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
1232         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
1233         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
1234         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
1235         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
1236         of thread register as second parameter to REGISTER macro in 64 case.
1238 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
1240         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
1241         (CFLAGS-getpid.o): Defined.
1242         (CFLAGS-getpid.os): Defined.
1244 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
1246         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
1247         returned for main thread does not overlap with any other VMA.
1248         Patch by Jakub Jelinek.
1250 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
1252         * tst-raise1.c: Include stdio.h.
1254 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
1256         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
1257         setting with __ASSUME_TGKILL || defined __NR_tgkill.
1258         If pid is 0, set it to selftid.
1259         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
1260         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
1261         != 0, return self->tid without doing a syscall.
1262         * descr.h (struct pthread): Move pid field after tid.
1264         * Makefile (tests): Add tst-raise1.
1265         * tst-raise1.c: New file.
1267 2003-12-23  Roland McGrath  <roland@redhat.com>
1269         * tst-oddstacklimit.c: New file.
1270         * Makefile (tests): Add it.
1271         (tst-oddstacklimit-ENV): New variable.
1273         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
1274         value up to page size for __default_stacksize.
1276 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
1278         * Makefile (tests): Add tst-eintr5.
1279         * tst-eintr5.c: New file.
1281         * eintr.c (eintr_source): Prevent sending signal to self.
1283         * tst-eintr2.c (tf1): Improve error message.
1285 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
1287         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
1288         * sysdeps/unix/sysv/linux/getpid.c: New file.
1289         * pthread_cancel.c: Add comment explaining use of PID field.
1290         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1291         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
1292         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
1293         temporarily to signal the field must not be relied on and updated
1294         by getpid().
1295         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
1296         temporarily negative.
1297         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1299 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
1301         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
1302         (eintr_source): If ARG != NULL, use pthread_kill.
1303         * tst-eintr1.c: Adjust for this change.
1304         * tst-eintr2.c: Likewise.
1305         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
1306         * tst-eintr3.c: New file.
1307         * tst-eintr4.c: New file.
1309 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
1311         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
1312         if CANCELSTATE_BITMASK is set.
1313         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
1314         Likewise.
1316         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
1317         (tests-reverse): Add tst-cancel23.
1318         * tst-cancel22.c: New test.
1319         * tst-cancel23.c: New test.
1321 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
1323         * tst-eintr1.c: Better error messages.
1325         * Makefile (tests): Add tst-eintr2.
1326         * tst-eintr2.c: New file.
1328 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
1330         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
1331         (CFLAGS-tst-cancelx21.c): Set.
1332         * tst-cancel21.c: New test.
1333         * tst-cancelx21.c: New test.
1335         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
1336         comparison operand.
1337         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
1338         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
1339         * pt-longjmp.c: Include jmpbuf-unwind.h.
1340         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
1341         _JMPBUF_UNWINDS.  Adjust compared pointers.
1342         * init.c (__pthread_initialize_minimal_internal): Initialize
1343         pd->stackblock_size.
1344         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
1345         * sysdeps/alpha/jmpbuf-unwind.h: New file.
1346         * sysdeps/i386/jmpbuf-unwind.h: New file.
1347         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
1348         * sysdeps/s390/jmpbuf-unwind.h: New file.
1349         * sysdeps/sh/jmpbuf-unwind.h: New file.
1350         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
1351         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
1352         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
1353         (_JMPBUF_CFA_UNWINDS): Remove.
1354         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
1356 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
1358         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
1359         (CFLAGS-tst-cancelx20.c): Set.
1360         * tst-cancel20.c: New test.
1361         * tst-cancelx20.c: New test.
1363 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
1365         * init.c (__pthread_initialize_minimal_internal): Don't treat
1366         architectures with separate register stack special here when
1367         computing default stack size.
1369 2003-12-17  Roland McGrath  <roland@redhat.com>
1371         * Makefile (tst-cancelx7-ARGS): New variable.
1372         Reportd by Greg Schafer <gschafer@zip.com.au>.
1374 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
1376         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
1377         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
1378         (tst-stack3-ENV): Set.
1379         ($(objpfx)tst-stack3-mem): New.
1380         * tst-stack3.c: New test.
1382 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
1384         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
1385         Add unwind directives.  Drop unused .regstk directive.
1386         (_fini_EPILOG_BEGINS): Add unwind directives.
1388 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
1390         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1391         Assume parameter is a pointer.
1392         (lll_futex_wake): Likewise.
1393         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
1394         Likewise.
1395         (lll_futex_wake): Likewise.
1396         Reported by Boris Hu.
1397         * sysdeps/unix/sysv/linux/unregister-atfork.c
1398         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
1400         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
1402 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
1404         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
1405         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
1406         __rtld_lock_initialize for ld.so lock.
1407         Patch in part by Adam Li <adam.li@intel.com>.
1409 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
1411         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
1412         in $(gnulib).  Also, remove stale comment.
1414 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
1416         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
1417         advantage of new syscall stub and optimize accordingly.
1419         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
1420         from SYS_futex, to match expectations of
1421         sysdep.h:DO_INLINE_SYSCALL.
1422         (lll_futex_clobbers): Remove.
1423         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
1424         (lll_futex_wake): Likewise.
1425         (lll_futex_requeue): Likewise.
1426         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
1427         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
1428         Jelinek).
1429         (__lll_mutex_lock): Likewise.
1430         (__lll_mutex_cond_lock): Likewise.
1431         (__lll_mutex_timed_lock): Likewise.
1432         (__lll_mutex_unlock): Likewise.
1433         (__lll_mutex_unlock_force): Likewise.
1435         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
1436         comes before the include of <sysdep.h>.
1437         (THREAD_SELF_SYSINFO): New macro.
1438         (THREAD_SYSINFO): Likewise.
1439         (INIT_SYSINFO): New macro.
1440         (TLS_INIT_TP): Call INIT_SYSINFO.
1442         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
1444         * sysdeps/pthread/createthread.c (create_thread): Use
1445         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
1446         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
1447         THREAD_SELF_SYSINFO instead of open code.
1448         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
1449         (THREAD_SYSINFO): Likewise.
1451         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
1453         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
1455 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
1457         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
1458         instead of .init.  Patch by David Mosberger.
1460 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
1462         * sysdeps/pthread/configure.in: Remove broken declaration in C
1463         cleanup handling check.
1465 2003-11-30  Andreas Jaeger  <aj@suse.de>
1467         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
1468         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
1469         Likewise.
1471 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
1473         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
1474         * pthread_attr_destroy.c: Include shlib-compat.h.
1475         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
1476         is set in iattr->flags.
1477         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
1479 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
1481         * Makefile (distribute): Add tst-cleanup4aux.c.
1483         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
1484         include.
1486 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
1488         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
1489         pthread_cond_signal.
1491         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
1492         store mutex address if the current value is ~0l.
1493         * sysdeps/pthread/pthread_cond_timedwait.c
1494         (__pthread_cond_timedwait): Likewise.
1495         * sysdeps/pthread/pthread_cond_broadcast.c
1496         (__pthread_cond_broadcast): Don't use requeue for pshared
1497         condvars.
1499         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1500         (__pthread_cond_wait): Don't store mutex address if the current
1501         value is ~0l.
1502         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1503         (__pthread_cond_timedwait): Likewise.
1504         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1505         (__pthread_cond_broadcast): Don't use requeue for pshared
1506         condvars.
1508         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
1509         element with ~0l for pshared condvars, with NULL otherwise.
1511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1512         (__pthread_cond_wait): Don't store mutex address if the current
1513         value is ~0l.
1514         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1515         (__pthread_cond_timedwait): Likewise.
1516         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1517         (__pthread_cond_broadcast): Don't use requeue for pshared
1518         condvars.
1520         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
1521         * tst-cond12.c: New file.
1522         * tst-cond13.c: New file.
1524 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
1526         * sysdeps/pthread/configure.in: Make missing forced unwind support
1527         fatal.
1529 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
1531         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
1533 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
1535         * Makefile: Add magic to clean up correctly.
1537 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
1539         * unwind.c (FRAME_LEFT): Define.
1540         (unwind_stop): Handle old style cleanups here.
1541         (__pthread_unwind): Handle old style cleanups only if
1542         !HAVE_FORCED_UNWIND.
1543         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
1544         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
1545         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
1546         ($(objpfx)tst-cleanupx4): Likewise.
1547         * tst-cleanup4.c: New test.
1548         * tst-cleanup4aux.c: New.
1549         * tst-cleanupx4.c: New test.
1551 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
1553         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
1554         lll_mutex_*lock macros to skip atomic operations on some archs.
1556 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
1558         * sysdeps/pthread/tst-timer.c (main): Initialize
1559         sigev2.sigev_value as well.
1561 2003-10-15  Roland McGrath  <roland@redhat.com>
1563         * sysdeps/pthread/configure.in: Barf if visibility attribute support
1564         is missing.
1565         * sysdeps/pthread/configure: Regenerated.
1567 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1569         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
1570         locking macros.  No distinction between normal and mutex locking
1571         anymore.
1572         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
1573         Merge bits from lowlevelmutex.S we still need.
1574         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
1575         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
1576         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
1577         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
1578         new mutex implementation.
1579         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
1580         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
1581         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1582         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1583         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1584         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1585         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1586         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1587         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1588         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
1589         symbol for entry point to avoid cancellation.
1591 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
1593         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
1594         changes.
1595         (SAVE_OLDTYPE_0): Fix a typo.
1597 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
1599         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1600         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
1602 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1604         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
1605         correct offset.
1607 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
1609         * Makefile (tests): Add tst-cancel19.
1610         * tst-cancel19.c: New test.
1612 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1614         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
1615         restoring of the old cancellation type.
1617 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
1619         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
1621 2003-09-27  Wolfram Gloger  <wg@malloc.de>
1623         * sysdeps/pthread/malloc-machine.h: New file
1625 2003-09-24  Roland McGrath  <roland@redhat.com>
1627         * allocatestack.c (__make_stacks_executable): Don't ignore return
1628         value from _dl_make_stack_executable.
1630 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
1632         * allocatestack.c (__make_stacks_executable): Also change
1633         permission of the currently unused stacks.
1635         * allocatestack.c (change_stack_perm): Split out from
1636         __make_stacks_executable.
1637         (allocate_stack): If the required permission changed between the time
1638         we started preparing the stack and queueing it, change the permission.
1639         (__make_stacks_executable): Call change_stack_perm.
1641         * Makefile: Build tst-execstack-mod locally.
1642         * tst-execstack-mod.c: New file.
1644 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
1646         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
1648 2003-09-23  Roland McGrath  <roland@redhat.com>
1650         * tst-execstack.c: New file.
1651         * Makefile (tests): Add it.
1652         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
1653         (LDFLAGS-tst-execstack): New variable.
1655         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
1656         whether to use PROT_EXEC for stack mmap.
1657         (__make_stacks_executable): New function.
1658         * pthreadP.h: Declare it.
1659         * init.c (__pthread_initialize_minimal_internal): Set
1660         GL(dl_make_stack_executable_hook) to that.
1662 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1664         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
1665         recommendation from AMD re avoidance of lock prefix.
1667 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
1669         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
1670         lll_futex_timed_wait instead of lll_futex_wait.
1671         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
1672         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
1673         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
1674         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
1675         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
1676         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
1677         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
1678         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
1679         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
1680         Completely revamp the locking macros.  No distinction between
1681         normal and mutex locking anymore.
1682         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1683         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
1684         __lll_lock_timedwait): Fix prototypes.
1685         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
1686         __lll_lock_timedwait): Likewise.
1687         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
1688         macros, add __builtin_expect.
1689         (lll_mutex_timedlock): Likewise.  Fix return value.
1690         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
1691         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
1692         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
1693         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
1694         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
1695         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
1696         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
1697         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
1699 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1701         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1702         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
1703         operation if possible.
1705         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
1706         like jumping over the lock prefix.
1708 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
1710         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
1711         locking macros.  No distinction between normal and mutex locking
1712         anymore.
1713         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1714         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1715         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1716         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
1717         locking.  Merge bits from lowlevelmutex.S we still need.
1718         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1719         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1720         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
1721         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
1722         * Makefile (routines): Remove libc-lowlevelmutex.
1723         (libpthread-rountines): Remove lowlevelmutex.
1724         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
1725         for new mutex implementation.
1726         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1727         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1728         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1729         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1730         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1731         Likewise.
1732         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1733         Likewise.
1734         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1735         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1736         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
1737         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1738         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1739         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1740         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1741         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1742         Likewise.
1743         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1744         Likewise.
1745         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1746         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1747         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1748         Don't use requeue.
1749         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1750         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
1752 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
1754         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
1755         in parameters of asm with output parameters.
1757         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
1758         type of DECR parameter to int.
1759         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
1761 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
1763         * tst-attr3.c (tf, do_test): Print stack start/end/size and
1764         guardsize for each thread.
1766 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1768         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
1769         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1770         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
1772         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1773         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
1774         NULL.
1775         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
1776         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
1777         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1778         (pthread_getaffinity_np): Add hidden_def.
1780         * Makefile (tests): Add tst-attr3.
1781         * tst-attr3.c: New test.
1783         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
1785 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1787         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
1788         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
1790 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1792         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
1793         * tst-align.c: Include tst-stack-align.h.
1794         (tf, do_test): Use TEST_STACK_ALIGN macro.
1796 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
1798         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
1799         variable.
1801 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
1803         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
1804         stack-related values for the initial thread.
1806 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1808         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
1810 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
1812         * pthread_mutex_lock.c: Minor code rearrangements.
1814 2003-09-05  Roland McGrath  <roland@redhat.com>
1816         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
1817         Instead, include ../nptl_db/db_info.c to do its magic.
1818         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
1819         (__pthread_pthread_key_2ndlevel_size): Likewise.
1820         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
1821         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
1822         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
1823         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
1824         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
1825         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
1826         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
1827         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
1828         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
1829         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
1830         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
1831         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
1832         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
1833         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
1834         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
1835         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
1836         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
1838 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
1840         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
1841         of pthread_t to be compatible with LT.
1842         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1843         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1844         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1845         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1846         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1847         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1848         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1850 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
1852         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
1854 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
1856         * unwind-forcedunwind.c: Move to...
1857         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
1858         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
1859         * sysdeps/pthread/jmpbuf-unwind.h: New file.
1860         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
1861         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
1862         * unwind.c: Include jmpbuf-unwind.h.
1863         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
1865 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
1867         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
1868         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
1869         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
1870         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
1871         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1872         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
1873         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
1874         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
1875         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
1876         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
1877         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
1878         function.
1879         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
1880         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
1881         * Makefile (tests): Add tst-stack2.
1882         * tst-stack2.c: New test.
1883         * tst-stack1.c: Include limits.h and sys/param.h.
1884         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
1886         * pthread_condattr_setpshared.c: Include errno.h.
1887         (pthread_condattr_setpshared): Return EINVAL if pshared
1888         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
1890         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
1891         defined symbol for entry point to avoid cancellation.
1892         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
1893         Likewise.
1894         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1895         Likewise.
1896         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
1897         Likewise.
1898         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
1899         Likewise.
1900         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
1901         Likewise.
1902         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
1903         __close_nocancel, __read_nocancel, __write_nocancel,
1904         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
1905         libpthread.so or librt.so, define to corresponding function
1906         without _nocancel suffix.
1907         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
1908         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
1909         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
1911         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
1913 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
1915         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
1916         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
1918         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
1919         in subsections has a symbol associated with it.
1921         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
1922         defined symbol for entry point to avoid cancellation.
1923         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
1925 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1927         * Makefile (tests): Add tst-tls5.
1928         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
1929         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
1930         ($(objpfx)tst-tls5): New.
1931         ($(objpfx)tst-tls6.out): Likewise.
1932         (tests): Depend on $(objpfx)tst-tls6.out.
1933         * tst-tls3.c: Include stdint.h and pthreaddef.h.
1934         (do_test): Check pthread_self () return value alignment.
1935         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
1936         (tf): Check pthread_self () return value alignment.
1937         * tst-tls5.c: New test.
1938         * tst-tls5.h: New.
1939         * tst-tls5mod.c: New.
1940         * tst-tls5moda.c: New.
1941         * tst-tls5modb.c: New.
1942         * tst-tls5modc.c: New.
1943         * tst-tls5modd.c: New.
1944         * tst-tls5mode.c: New.
1945         * tst-tls5modf.c: New.
1946         * tst-tls6.sh: New test.
1948         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
1949         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
1950         * init.c (pthread_functions): Initialize them.
1951         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
1952         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
1953         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
1954         pthread_cond_timedwait@@GLIBC_2.3.2.
1956 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1958         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
1959         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
1960         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
1961         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
1962         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
1963         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1965         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
1967         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
1968         _POSIX_THREAD_PRIORITY_SCHEDULING.
1969         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
1971 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
1973         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
1974         nested function, use static inline function from libio.h.
1975         Code by Richard Henderson.
1977         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
1978         weak.
1980 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
1982         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
1983         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
1984         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
1985         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
1986         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
1987         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
1988         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
1989         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
1990         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
1991         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
1992         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
1993         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
1994         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
1995         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
1996         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
1997         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
1998         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
1999         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
2000         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
2001         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
2002         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
2003         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
2004         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
2005         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
2006         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
2007         * sysdeps/sparc/tls.h: New file.
2008         * sysdeps/sparc/tcb-offsets.sym: New file.
2009         * sysdeps/sparc/Makefile: New file.
2010         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
2011         * init.c [__sparc__] (__NR_set_tid_address): Define.
2013 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
2015         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
2016         _IO_release_lock): Define.
2018 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
2020         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
2021         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
2023 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
2025         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
2026         (__pthread_cleanup_class): Add missing return types of member
2027         functions.
2029 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
2031         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2032         (lll_mutex_unlock_force): Add memory barrier between store and futex
2033         syscall.
2035 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
2037         * tst-cancel4.c (do_test): Also unlink tempfname and remove
2038         tempmsg in first loop.
2040 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
2042         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2043         _POSIX_THREAD_PRIORITY_SCHEDULING.
2044         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2046 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2048         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
2049         (__rtld_lock_default_lock_recursive,
2050         __rtld_lock_default_unlock_recursive): Define.
2051         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
2052         __rtld_lock_unlock_recursive): Define using
2053         GL(_dl_rtld_*lock_recursive).
2054         * init.c (__pthread_initialize_minimal_internal): Initialize
2055         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
2056         Lock GL(_dl_load_lock) the same number of times as
2057         GL(_dl_load_lock) using non-mt implementation was nested.
2059         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
2060         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2062 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
2064         * tst-cancel17.c (do_test): Make len2 maximum of page size and
2065         PIPE_BUF.
2067 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2069         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2071 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
2073         * sysdeps/pthread/createthread.c (do_clone): Move error handling
2074         to first syscall error check.  Move syscall error check for tkill
2075         into __ASSUME_CLONE_STOPPED #ifdef.
2077 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
2079         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
2080         is not defined, do explicit synchronization.
2081         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
2082         is not defined also unlock pd->lock for non-debugging case in case
2083         it is necessary.
2084         * pthread_create.c (start_thread): Always get and release pd->lock
2085         if __ASSUME_CLONE_STOPPED is not defined.
2086         (start_thread_debug): Removed.  Adjust users.
2087         * allocatestack.c (allocate_stack): Always initialize lock if
2088         __ASSUME_CLONE_STOPPED is not defined.
2089         * Makefile (tests): Add tst-sched1.
2090         * tst-sched1.c: New file.
2092         * sysdeps/pthread/createthread.c (do_clone): Only use
2093         sched_setschduler and pass correct parameters.
2095 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2097         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
2098         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
2099         PTHREAD_STACK_MIN in comments.
2101 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2103         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2104         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
2105         argument.
2106         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
2107         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
2108         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
2109         (__pthread_cleanup_upto): Fix prototype.
2110         (_longjmp_unwind): Adjust caller.
2111         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
2112         Change second argument to const struct pointer.
2113         * tst-sem8.c (main): Remove unused s2 and s3 variables.
2114         * tst-sem9.c (main): Likewise.
2115         * unwind.c: Include string.h for strlen prototype.
2117 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
2119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2120         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
2121         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
2122         Define HAVE_CMOV.
2123         Patch by Nicholas Miell <nmiell@attbi.com>.
2125 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
2127         * init.c (__pthread_initialize_minimal_internal): Initialize
2128         GL(dl_init_static_tls).
2129         * pthreadP.h (__pthread_init_static_tls): New prototype.
2130         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
2131         New functions.
2132         * Makefile (tests): Add tst-tls4.
2133         (modules-names): Add tst-tls4moda and tst-tls4modb.
2134         ($(objpfx)tst-tls4): Link against libdl and libpthread.
2135         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
2136         tst-tls4modb.so.
2137         * tst-tls4.c: New file.
2138         * tst-tls4moda.c: New file.
2139         * tst-tls4modb.c: New file.
2141 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
2143         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
2144         before __timer_dealloc.
2145         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
2146         Don't call list_unlink.
2148 2003-07-29  Roland McGrath  <roland@redhat.com>
2150         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2152 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2154         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2155         Don't reuse struct aiocb A if it failed.
2156         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2157         not just one byte, as that does not block.
2159 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2161         * sysdeps/pthread/unwind-resume.c: New file.
2162         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2163         unwind-resume in csu subdir.
2164         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2165         exceptions.
2166         (librt-sysdep_routines, librt-shared-only-routines): Add
2167         rt-unwind-resume.
2168         * sysdeps/pthread/rt-unwind-resume.c: New file.
2169         * unwind-forcedunwind.c: New file.
2170         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2171         (libpthread-shared-only-routines): Likewise.
2172         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2173         * pthreadP.h (pthread_cancel_init): New prototype.
2174         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2176         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2177         attr argument const struct pthread_attr *.
2179         * res.c (__res_state): Return __resp.
2180         * descr.h: Include resolv.h.
2181         (struct pthread): Add res field.
2182         * pthread_create.c: Include resolv.h.
2183         (start_thread): Initialize __resp.
2184         * Makefile (tests): Add tst-_res1.
2185         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2186         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2187         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2188         libpthread.
2189         * tst-_res1.c: New file.
2190         * tst-_res1mod1.c: New file.
2191         * tst-_res1mod2.c: New file.
2193 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2195         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2197         * Makefile: Define various *-no-z-defs variables for test DSOs
2198         which has undefined symbols.
2200 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2202         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2203         Retry if the stwcx fails to store once_control.
2205 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2207         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2208         pthread_attr_setaffinity.
2209         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2210         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2211         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2212         * pthread_attr_destroy.c: Free cpuset element if allocated.
2213         * pthread_create.c: Pass iattr as additional parameter to
2214         create_thread.
2215         * sysdeps/pthread/createthread.c: If attribute is provided and
2216         a new thread is created with affinity set or scheduling parameters,
2217         start thread with CLONE_STOPPED.
2218         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
2219         pthread_attr_setaffinity.
2220         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2221         cpuset element.
2223 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
2225         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2227 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
2229         * sysdeps/pthread/configure.in: Require CFI directives also for
2230         ppc and s390.
2232 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
2234         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2235         Add cfi directives.
2237 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2239         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
2240         CLEANUP_JMP_BUF.
2241         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
2242         registers as variables.  Call __pthread_mutex_unlock_usercnt.
2243         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2244         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
2245         not self pointer in __writer.  Compare with TID to determine
2246         deadlocks.
2247         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2248         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2249         Likewise.
2250         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2251         Likewise.
2252         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
2253         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2254         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
2255         macros also when compiling librt.
2257 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
2259         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
2260         -fasynchronous-unwind-tables.
2261         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2262         (PSEUDO): Add cfi directives.
2263         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
2264         Likewise.
2265         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2266         Likewise.
2268 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
2270         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
2271         __pthread_unregister_cancel): Add prototypes and hidden_proto.
2272         * unwind.c (__pthread_unwind_next): Add hidden_def.
2273         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
2274         Likewise.
2275         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2276         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2277         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2278         Likewise.
2279         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
2280         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2281         Likewise.
2282         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
2283         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
2284         __pthread_unregister_cancel and __pthread_unwind_next.
2286 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
2288         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
2289         different symbol for the cancellation syscall wrapper and
2290         non-cancellation syscall wrapper.
2291         (PSEUDO_END): Define.
2293 2003-07-05  Richard Henderson  <rth@redhat.com>
2295         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
2296         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
2297         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2298         return actual return value from the syscall, not 0.
2300 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
2302         * descr.h (struct pthread): Add pid field.
2303         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
2304         (__reclaim_stacks): Likewise.
2305         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
2306         also check for PID of the signal source.
2307         (__pthread_initialize_minimal_internal): Also initialize pid field
2308         of initial thread's descriptor.
2309         * pthread_cancel.c: Use tgkill instead of tkill if possible.
2310         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2311         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
2312         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2313         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2315 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
2317         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
2318         Fix use of parameter.
2319         (__libc_cleanup_pop): Likewise.
2321 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
2323         * init.c (sigcancel_handler): Change parameters to match handler
2324         for SA_SIGACTION.  Check signal number and code to recognize
2325         invalid invocations.
2327 2003-07-03  Roland McGrath  <roland@redhat.com>
2329         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
2330         Apply sizeof (struct pthread) bias to r13 value.
2332 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
2334         * sysdeps/pthread/configure.in: Require CFI directives.
2336         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
2337         definition.
2338         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
2339         libpthread compilation.
2340         * unwind.c (__pthread_unwind): Add hidden_def.
2341         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2343 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2345         * libc-cancellation.c (__libc_cleanup_routine): Define.
2346         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
2347         (__pthread_cleanup_pop): Define.
2349 2003-07-01  Richard Henderson  <rth@redhat.com>
2351         * sysdeps/alpha/elf/pt-initfini.c: New file.
2352         * sysdeps/alpha/pthread_spin_lock.S: New file.
2353         * sysdeps/alpha/pthread_spin_trylock.S: New file.
2354         * sysdeps/alpha/pthreaddef.h: New file.
2355         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
2356         * sysdeps/alpha/tls.h: New file.
2357         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
2358         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
2359         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
2360         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
2361         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
2362         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
2363         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
2364         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
2365         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
2366         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2368 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2370         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
2371         cleanup support and unwind info.
2373 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
2375         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2376         Use correct cleanup handler registration.  Add unwind info.
2377         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
2378         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
2379         * tst-once3.c: Add cleanup handler and check it is called.
2380         * tst-once4.c: Likewise.
2381         * tst-oncex3.c: New file.
2382         * tst-oncex4.c: New file.
2383         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2385 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
2387         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2389 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
2391         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
2392         (tf_msgsnd): Likewise.
2394         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
2395         premature returns a bit more.
2397 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
2399         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
2400         definition to the front.
2402         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
2403         the cleanup functions to make the names unique.  Fix dwarf opcode
2404         un unwind table.
2405         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
2406         functions to make the names unique.  Fix CFA offset for two blocks.
2408 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
2410         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
2411         missing closing braces.
2412         Patch by Christophe Saout <christophe@saout.de>.
2414 2003-06-24  Roland McGrath  <roland@redhat.com>
2416         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2418 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
2420         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
2421         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
2423         * pthreadP.h: Declare __find_thread_by_id.
2424         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
2425         * pthread_clock_gettime.c: Allow using other thread's clock.
2426         * pthread_clock_settime.c: Likewise.
2427         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2428         * Makefile: Add rules to build and run tst-clock2.
2429         * tst-clock2.c: New file.
2431 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
2433         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
2434         to use exception-based cleanup handler.
2435         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2437         * tst-cond8.c (ch): Announce that we are done.
2439         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
2441         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
2442         Also test aio_suspend with timeout value.
2444 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
2446         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
2447         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
2448         attribute_hidden.
2450         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
2451         (__pthread_mutex_lock_internal): Likewise.
2452         (__pthread_mutex_unlock_internal): Likewise.
2453         (__pthread_mutex_unlock_usercnt): Declare.
2454         * pthread_mutex_destroy.c: Always fail if used in any way.
2455         * pthread_mutex_init.c: Update comment.
2456         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
2457         * pthread_mutex_timedlock.c: Adjust __nusers.
2458         * pthread_mutex_trylock.c: Adjust __nusers.
2459         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
2460         and public interfaces are wrapper with pass additional parameter.
2461         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
2462         parameter zero.
2463         * tst-mutex8.c: New file.
2464         * Makefile (tests): Add tst-mutex8.
2465         * sysdeps/pthread/pthread_cond_timedwait.c: Call
2466         __pthread_mutex_unlock_usercnt.
2467         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2468         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2469         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2470         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2471         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2472         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
2473         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2474         Add __nusers.
2475         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2476         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2477         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2478         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2479         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2481         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
2482         * pthread_mutex_timedlock.c: Likewise.
2483         * pthread_mutex_trylock.c: Adjust __nusers.
2484         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
2485         * tst-mutex9.c: New file.
2486         * Makefile (tests): Add tst-mutex9.
2487         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
2488         * sysdeps/ia64/tls.h: Likewise.
2489         * sysdeps/powerpc/tls.h: Likewise.
2490         * sysdeps/s390/tls.h: Likewise.
2491         * sysdeps/sh/tls.h: Likewise.
2492         * sysdeps/x86_64/tls.h: Likewise.
2493         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2494         Change type of __owner.
2495         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2496         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2497         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2498         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2499         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2501 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
2503         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
2504         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
2506         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
2507         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
2508         instead of nr to lll_futex_wake.  Only set errno and return -1
2509         if err < 0.
2511         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
2512         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2513         return actual return value from the syscall, not 0.
2515 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
2517         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
2518         find a random value.
2519         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
2520         errno==EIDRM.
2522         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
2523         compat_timer_settime.
2524         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
2525         compat_timer_gettime.
2526         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
2527         compat_timer_getoverrun.
2528         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
2529         compat_timer_delete.
2531         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
2532         error-checking mutex detect busy mutexes.
2534 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2536         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
2537         Add ax to clobber list.
2538         (lll_mutex_cond_lock): Likewise.
2539         (lll_mutex_unlock): Likewise.
2540         (lll_lock): Likewise.
2541         (lll_unlock): Likewise.
2543         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
2544         * tst-cancel18.c: New file.
2545         * tst-cancelx18.c: New file.
2547         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
2548         and tcdrain.
2550         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
2551         * tst-cancel17.c: New file.
2552         * tst-cancelx17.c: New file.
2554         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
2555         * sysdeps/unix/sysv/linux/sigwait.c: New file.
2556         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
2558         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
2560 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
2562         * sysdeps/pthread/createthread.c (create_thread): Set
2563         header.multiple_threads unconditionally.
2564         * allocatestack.c (allocate_stack): Likewise.
2565         * descr.h (struct pthread): Add header.multiple_threads
2566         unconditionally.
2567         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
2568         Define for librt.  #error if neither libpthread, libc nor librt.
2569         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
2570         Likewise.
2571         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
2572         CDISABLE): Likewise.
2573         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
2574         CDISABLE): Likewise.
2575         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
2576         CDISABLE): Likewise.
2577         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
2578         CDISABLE): Likewise.  Access header.multiple_threads outside of
2579         libc and libpthread.
2580         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
2581         Likewise.
2582         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
2583         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
2585 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2587         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
2588         Also test early cancellation before the thread reaches the cancellation
2589         point.
2591         * Makefile: Compile forward.c with exceptions.
2593         * sysdeps/unix/sysv/linux/sleep.c: New file.
2595 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
2597         * Makefile: Add CFLAGS definition to compile function wrappers
2598         duplicated from libc with exceptions.
2599         * tst-cancel4.c: Also check cancellation handlers.
2601         * Makefile: Add rules to build and run tst-cancel16 and
2602         tst-cancelx16.  Add missing CFLAGS definitions.
2603         * tst-cancel16.c: New file.
2604         * tst-cancelx16.c: New file.
2606 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
2608         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2609         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
2610         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2611         (DL_SYSINFO_IMPLEMENTATION): Likewise.
2613         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
2614         (LIBC_CANCEL_RESET): Likewise.
2615         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
2616         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
2617         librt-cancellation.
2618         (CFLAGS-libcrt-cancellation.c): Define.
2619         * sysdeps/pthread/librt-cancellation.c: New file.
2620         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
2621         macros also when compiling librt.
2622         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2623         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2624         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2625         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2626         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2627         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2628         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2630         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
2631         compat_timer_create.
2633 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
2635         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
2637         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2638         __register_atfork.
2639         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
2640         Add libc_hidden_def.
2642 2003-06-13  Roland McGrath  <roland@redhat.com>
2644         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
2645         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
2647 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
2649         * allocatestack.c (queue_stack): Always inline.
2650         * ptreadhP.h (__do_cancel): Likewise.
2652 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
2654         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
2655         a typo.
2657 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
2659         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2660         (__pthread_cond_signal): Remove incorrect second addition for
2661         cond_lock!=0.
2663 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
2665         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2666         (__pthread_cond_signal): Use correct futex pointer in
2667         __lll_mutex_lock_wait call.
2669         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2670         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
2672 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
2674         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
2675         cancelable.
2676         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2677         Likewise.
2679         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
2680         hand-written CFI generation code.  Since ENTRY/END also initiated
2681         CFI frames this caused two CFI sets to be generated.
2683 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
2685         * cleanup_routine.c: New file.
2686         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
2687         * sysdeps/pthread/pthread.h: Add support for fully exception-based
2688         cleanup handling.
2689         * Makefile (libpthread-routines): Add cleanup_routine.
2690         Add more CFLAGS variables to compile with exceptions.  Add comments
2691         why which file needs unwind tables.
2692         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
2693         tests.
2694         * tst-cancelx1.c: New file.
2695         * tst-cancelx2.c: New file.
2696         * tst-cancelx3.c: New file.
2697         * tst-cancelx4.c: New file.
2698         * tst-cancelx5.c: New file.
2699         * tst-cancelx6.c: New file.
2700         * tst-cancelx7.c: New file.
2701         * tst-cancelx8.c: New file.
2702         * tst-cancelx9.c: New file.
2703         * tst-cancelx10.c: New file.
2704         * tst-cancelx11.c: New file.
2705         * tst-cancelx12.c: New file.
2706         * tst-cancelx13.c: New file.
2707         * tst-cancelx14.c: New file.
2708         * tst-cancelx15.c: New file.
2709         * tst-cleanupx0.c: New file.
2710         * tst-cleanupx0.expect: New file.
2711         * tst-cleanupx1.c: New file.
2712         * tst-cleanupx2.c: New file.
2713         * tst-cleanupx3.c: New file.
2715         * tst-cleanup0.c: Make standard compliant.
2716         * tst-cleanup1.c: Likewise.
2718         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
2719         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2720         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2721         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2722         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2723         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2724         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
2725         CLEANUP_JMP_BUF.
2726         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2727         * tst-cancel12.c: New file.
2728         * tst-cancel13.c: New file.
2729         * tst-cancel14.c: New file.
2730         * tst-cancel15.c: New file.
2731         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
2732         and tst-cancel15.
2734         * tst-cancel1.c: Add some comments.
2736         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
2737         timeout correctly.
2739 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
2741         * Makefile (CFLAGS-pthread_cancel.c): Define.
2743 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
2745         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
2746         Change type of __writer element to int.
2747         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2748         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2749         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2750         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2751         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2752         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
2753         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2754         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
2755         Compare with TID to determine deadlocks.
2756         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2757         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2758         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
2759         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2760         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2761         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2762         Likewise.
2763         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2764         Likewise.
2765         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2766         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2767         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2768         Likewise.
2769         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2770         Likewise.
2771         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2772         * Makefile (tests): Add tst-rwlock12.
2773         * tst-rwlock12.c: New file.
2775 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
2777         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
2778         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
2779         Remove bogus hidden_proto.
2780         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2781         Likewise.
2782         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
2783         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
2784         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
2785         ___lll_mutex_timedlock): Likewise.
2787 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
2789         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2790         (__pthread_cond_signal): Add some code to eventually handle
2791         cond_lock!=0.
2793 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
2795         * Makefile (tests): Add tst-exec4.
2796         (tst-exec4-ARGS): Define.
2797         * tst-exec4.c: New file.
2799 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
2801         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2802         Also fail if tv_nsec < 0.
2803         (__lll_timedwait_tid): Likewise.
2804         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
2805         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
2806         Likewise.
2807         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
2808         Likewise.
2809         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
2810         Likewise.
2811         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2812         Likewise.
2813         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
2814         Likewise.
2815         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
2816         Likewise.
2818         * Makefile (tests): Add tst-sem8 and tst-sem9.
2819         * tst-sem8.c: New file.
2820         * tst-sem9.c: New file.
2821         * sem_open.c: Fix creation of in_use record if the file exists but
2822         no internal record.
2824         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
2825         definitions.
2827         * sysdeps/pthread/timer_create.c (timer_create): In case
2828         evp==NULL, assign timer ID to sival_ptr.
2830         * descr.h (struct pthread_unwind_buf): Change type of prev element to
2831         struct pthread_unwind_buf *.
2832         (struct pthread): Likewise for cleanup_jmp_buf element.
2834         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
2835         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
2836         * unwind.c (__pthread_unwind_next): Likewise.
2838 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2840         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2841         (lll_futex_timed_wait): Use int for futex value parameter.
2842         (lll_futex_wake): Likewise.
2843         (lll_futex_requeue): Likewise.
2845         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2846         Replace one memory operation with one register operation.
2848         * tst-join4.c (do_test): Fix error message.
2850         * tst-rwlock6.c (do_test): Use correct format specifier.
2852         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2853         (__lll_mutex_lock_wait): Replace one memory operation with one
2854         register operation.
2855         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
2856         (__lll_mutex_lock_wait): Likewise.
2858         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2859         (__lll_mutex_cond_lock): Add one to value parameter of
2860         __lll_lock_wait to reflect reality in the futex syscall.
2861         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2862         (lll_mutex_cond_lock): Likewise.
2864 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2866         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
2867         New function.
2868         (lll_mutex_cond_lock): Define.
2870 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
2872         * Makefile (tests): Add tst-signal6.
2873         * tst-signal6.c: New file.
2875         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
2876         (__lll_mutex_unlock_force): New function
2877         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2879         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2880         (__lll_mutex_unlock_force): New function.
2881         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2883         * tst-rwlock7.c (do_test): Use correct format specifier.
2885         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
2886         Find break parameter in correct asm argument.
2888 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
2890         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
2891         Remove out4.
2892         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
2893         error occured.
2894         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2895         Add __mutex.
2896         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
2897         lll_futex_requeue, lll_mutex_unlock_force): Define.
2899 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2901         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2902         (pthread_cond_t): Add __mutex.
2903         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
2904         lll_futex_requeue, lll_mutex_unlock_force): Define.
2906 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2908         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
2909         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2910         Add __mutex field.
2911         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
2912         Define.
2913         (lll_futex_wait, lll_futex_wake): Define.
2914         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
2915         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
2916         FUTEX_REQUEUE instead of FUTEX_WAIT.
2917         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2918         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
2919         mutex which was used in condvar structure.  Call
2920         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
2921         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2923         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
2924         include tcb-offsets.h.  Read wakeup value in locked region.
2925         Use the value of gbr register as THREAD_ID.
2926         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2927         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2928         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2930         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
2931         macros.
2933 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
2935         * sysdeps/pthread/pthread_cond_broadcast.c
2936         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
2938 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
2940         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
2941         typo in register name.
2942         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
2943         correctly.  Actually use requeue.  Little optimization.
2944         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
2945         mutex address early.  Handle cancellation state as 32-bit value.
2946         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2947         Remove unnecessary label.
2949 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
2951         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
2952         instead of FUTEX_WAIT.
2953         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
2954         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2955         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2956         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2957         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2958         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
2959         used in condvar structure.  Call __pthread_mutex_cond_lock instead
2960         of __pthread_mutex_lock_internal.
2961         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2962         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2963         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2964         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
2965         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2966         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2967         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
2968         Add pthread_mutex_cond_lock.
2969         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
2970         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
2971         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
2972         lll_mutex_cond_lock.
2973         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2974         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2975         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2976         Add __mutex field.
2977         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2978         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2980         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
2981         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2983         * pthreadP.h: Declare __pthread_mutex_cond_lock.
2984         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
2985         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
2986         macro don't define aliases.
2988         * cancellation.c: Remove __pthread_enable_asynccancel_2.
2989         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
2990         * sysdeps/pthread/pthread_cond_timedwait.c: Use
2991         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
2992         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2993         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2994         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2995         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2996         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2998 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
3000         * sem_open.c: Fix one endless loop.  Implement correct semantics
3001         wrt opening the same semaphore more then once.
3002         * sem_close.c: Adjust for sem_open change.
3003         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
3004         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
3005         * Makefile (tests): Add tst-sem7.
3006         * tst-sem7.c: New file.
3008 2003-05-16  Roland McGrath  <roland@redhat.com>
3010         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
3011         uninitialized variable braino.
3013 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
3015         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
3016         test for syscall availability.
3018         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
3019         __no_posix_timers to -1 if the syscalls don't exist.
3021         * pthread_join.c (pthread_join): Set tid field of the joined
3022         thread to -1.  This isn't necessary but helps to recognize some
3023         error conditions with almost no cost.
3025         * allocatestack.c (FREE_P): Also negative values indicate an
3026         unused stack.
3028         * unwind.c: Include <unistd.h>.
3030 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
3032         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
3034 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
3036         * Makefile (crti-objs, crtn-objs): New variables.
3037         (omit-deps, extra-objs): Add crtn.
3038         ($(objpfx)libpthread.so): Depend on both crti and crtn
3039         and links to them in multidir.
3040         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
3042 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
3044         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3045         (lll_mutex_unlock): Use atomic_exchange_rel.
3047 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
3049         * cond-perf.c (cons): Add missing locking around setting of alldone.
3051 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
3053         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
3054         related macros.
3055         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3057 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
3059         * tst-sem6.c: New file.
3060         * Makefile (tests): Add tst-sem6.
3062         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
3063         Use atomic_exchange_rel instead of atomic_exchange.
3064         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
3065         Likewise.
3067         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
3068         code for lll_futex_wait and lll_futex_wake in static apps.  Use
3069         vsyscall is possible.
3071         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
3072         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
3073         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
3074         pthread_setaffinity_np.
3075         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
3076         and pthread_setaffinity_np.
3077         * Makefile (libpthread-routines): Add pthread_getaffinity and
3078         pthread_setaffinity.
3080         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
3081         use it in case mmap to allocate the stack fails.
3082         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
3083         ARCH_MAP_FLAGS here.
3084         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
3085         ARCH_RETRY_MMAP.
3087 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
3089         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
3090         handler implementation.  It is now lockless in fork().
3091         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3092         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3093         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
3094         declare the __fork_*_lists.
3095         (struct fork_handler): Include pointers to all three functions.
3096         Add next, refcntr and need_signal elements.
3097         (__fork_handlers): New declaration.
3098         (__register_atfork_malloc): Remove declaration.
3099         (HAVE_register_atfork_malloc): Remove definition.
3100         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
3101         __pthread_child_handler variable.
3102         (__libc_pthread_init): Use __register_atfork instead of explicitly
3103         adding to the list.
3104         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
3105         and lll_futex_wake.
3106         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3108         * unwind.c (unwind_cleanup): Print error message and then abort.  This
3109         function must never be reached.
3111         * cond-perf.c: New file.
3113 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
3115         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
3117 2003-05-04  Roland McGrath  <roland@redhat.com>
3119         * Makefile ($(objpfx)../libc.so): New target.
3121 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
3123         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3124         (pthread_condattr_t): Size is only an int, don't use long for
3125         alignment.
3126         (pthread_mutexattr_t): Likewise.
3127         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3128         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3129         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3131 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
3133         * sysdeps/i386/tls.h: Define THREAD_ID.
3134         * sysdeps/ia64/tls.h: Likewise.
3135         * sysdeps/powerpc/tls.h: Likewise.
3136         * sysdeps/s390/tls.h: Likewise.
3137         * sysdeps/sh/tls.h: Likewise.
3138         * sysdeps/x86_64/tls.h: Likewise.
3139         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
3140         record ownership.
3141         * pthread_mutex_timedlock.c: Likewise.
3142         * pthread_mutex_trylock.c: Likewise.
3143         * pthread_mutex_unlock.c: Likewise.
3144         * pthread_rwlock_trywrlock.c: Likewise.
3145         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
3146         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3147         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3148         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3150         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
3151         flag.
3153 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3155         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3156         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3157         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3158         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3159         Make __align long long instead of long.
3160         (pthread_rwlock_t): Formatting.
3161         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3162         (pthread_rwlock_t): Formatting.
3163         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3164         (pthread_cond_t): Make __align long long instead of long.
3165         (pthread_rwlock_t): Move __flags field to the same position as in
3166         linuxthreads.
3168 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3170         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3171         * tst-rwlock7.c (do_test): Likewise.
3173 2003-04-26  Roland McGrath  <roland@redhat.com>
3175         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3177 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3179         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3180         sizeof (struct pthread).
3181         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3182         1 struct pthread.
3183         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3184         to 0.
3185         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3186         struct pthread.
3187         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3188         to 32-bit bytes.
3189         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3190         tcbp.
3191         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3192         unneccessarily.
3193         (NO_TLS_OFFSET): Define.
3194         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3195         add TLS_TCB_SIZE unnecessarily.
3197 2003-04-22  Roland McGrath  <roland@redhat.com>
3199         * Makeconfig (shared-thread-library): Reverse link order to work
3200         around linker bug.
3202 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3204         * semaphore.h: Fix typo in comment.
3206 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3208         * sysdeps/pthread/sigfillset.c: New file.
3210         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3211         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3212         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3213         * sysdeps/pthread/sigaction.c: Likewise.
3214         * sysdeps/pthread/sigprocmask.c: New file.
3215         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3216         __SIGRTMIN+1.
3217         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3218         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
3219         in this case.
3221 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
3223         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3224         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
3226         * sysdeps/unix/sysv/linux/unregister-atfork.c
3227         (__unregister_atfork): Don't free memory not allocated dynamically.
3229         * semaphore.h: Remove __THROW marker from cancellation points.
3230         * nptl/sysdeps/pthread/pthread.h: Likewise.
3232 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
3234         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
3235         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
3236         __THROW.
3238 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3240         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
3242 2003-04-15  Roland McGrath  <roland@redhat.com>
3244         * forward.c (__pthread_unwind): Tweak to avoid warning.
3246 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
3248         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
3250 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
3252         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
3253         overflow CFA advance instructions.
3254         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3256 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
3258         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
3259         * sysdeps/i386/pthread_spin_lock.c: Likewise.
3260         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
3261         defined.
3263         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
3264         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
3265         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
3266         DW_CFA_advance_loc for .Laddl-.Lsubl.
3268 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
3270         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
3271         position-independent unwind data for static libraries.
3272         Add missing unwind info.  Add comments.
3274         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
3275         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3276         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3279 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
3281         * Makefile: Make sure all cancellation points are compiled with
3282         exception and asynchronous unwind tables.
3284         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
3285         which mishandles loading of global object addresses in PIC.
3286         (THREAD_SETMEM_NC): Likewise.
3288 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3290         * pthread.h: Define new data structure for cleanup buffer.  Declare
3291         new cleanup handler interfaces.
3292         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
3293         (struct pthread): Add cleanup_jmp_buf pointer.  Define
3294         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
3295         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
3296         it.  Declare old cleanup handler installation functions.
3297         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
3298         handling.
3299         * cleanup_defer.c: Likewise.
3300         * cleanup_compat.c: New file.  Old cleanup code.
3301         * cleanup_def_compat.c: New file.  Old cleanup code.
3302         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
3303         if own thread descriptor.
3304         * unwind.c: New file.
3305         * forward.c: Add __pthread_unwind.
3306         * init.c (pthread_functions): Add __pthread_unwind.
3307         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
3308         Add ptr___pthread_unwind.
3309         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
3310         and unwind function.
3311         * Makefile (libpthread-routines): Add cleanup_compat,
3312         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
3313         table generation if necessary.
3314         * version.c: Record whether unwind support is compiled in.
3315         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
3316         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
3317         handler interfaces.
3318         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
3319         complication to generate unwind information for syscall wrappers.
3320         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3321         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3322         __cleanup_fct_attribute.
3324         * Makefile: Add rules to build and run tst-cleanup0.
3325         * tst-cleanup0.c: New file.
3326         * tst-cleanup0.expect: New file.
3328         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
3329         caller.  Optimize to avoid often unecessary local variable.
3331 2003-04-11  Roland McGrath  <roland@redhat.com>
3333         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
3334         sets variable `multidir'; include that.
3335         (generated): Add it.
3336         ($(objpfx)$(multidir)/crti.o): New target.
3337         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
3339 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3341         * tst-attr2.c (do_test): Add cast to avoid warning.
3342         * tst-mutex4.c (do_test): Likewise.
3344 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
3346         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
3347         in child.
3349 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
3351         * Makefile (tests): Add tst-detach1.
3352         * tst-detach1.c: New file.
3354 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
3356         * sysdeps/pthread/pthread.h: Remove duplicate
3357         pthread_cleanup_{push,pop} definitions.
3359         * tst-barrier2.c: Eliminate warnings.
3360         * tst-cancel4.c: Likewise.
3361         * tst-cond4.c: Likewise.
3362         * tst-cond6.c: Likewise.
3363         * tst-detach1.c: Likewise.
3364         * tst-rwlock4.c: Likewise.
3365         * tst-rwlock6.c: Likewise.
3366         * tst-rwlock7.c: Likewise.
3367         * tst-sem3.c: Likewise.
3368         * tst-spin2.c: Likewise.
3369         * tst-umask1.c: Likewise.
3371 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
3373         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
3375 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
3377         * descr.h (struct pthread): Move cancelhandling member to the front.
3379 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
3381         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
3382         malloc_parent, and malloc_child statically.
3383         (__register_atfork_malloc): New function.
3384         (free_mem): Don't free any of the malloc_* variables on the list.
3385         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
3386         Define HAVE_register_atfork_malloc.
3388 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
3390         * sysdeps/pthread/createthread.c (create_thread): Add some more
3391         comments explaining when to set multiple_threads and when not.
3393         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3394         THREAD_ATOMIC_BIT_SET if not already defined.
3395         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3396         THREAD_ATOMIC_BIT_SET:
3397         * sysdeps/x86_64/tls.h: Likewise.
3398         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
3399         THREAD_ATOMIC_CMPXCHG_VAL.
3400         (_pthread_cleanup_pop_restore): Likewise.
3401         * cancellation.c (__pthread_enable_asynccancel): Likewise.
3402         (__pthread_enable_asynccancel_2): Likewise.
3403         (__pthread_disable_asynccancel): Likewise.
3404         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3405         (__libc_disable_asynccancel): Likewise.
3406         * init.c (sigcancel_handler): Likewise.
3407         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
3408         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
3410 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
3412         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
3413         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3414         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
3415         * Makefile (tests): Add tst-cancel11.
3416         * tst-cancel11.c: New file.
3418 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
3420         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
3421         round, not the first.  Use specific_used flag instead of local
3422         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
3423         (__free_tcb): Don't call deallocate_tsd here.
3424         (start_thread): Call deallocate_tsd here.
3425         * pthread_setspecific.c: Set specific_used flag really only when
3426         needed.
3427         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
3428         * tst-tsd3.c: New file.
3429         * tst-tsd4.c: New file.
3431 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3433         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
3434         Use atomic_exchange_and_add instead of __lll_add.
3435         (__lll_mutex_timedlock): Likewise.
3436         Patch by Ian Wienand.
3438 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
3440         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3441         (SINGLE_THREAD_P): Fix typo.
3442         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
3444 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3446         * Makefile (tests): Add tst-align.
3447         * tst-align.c: New file.
3448         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
3450         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
3451         function correctly.
3453         * tst-tsd2.c: Add casts to avoid warnings.
3455 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
3457         * descr.h (struct pthread): Move most often used elements to the front.
3459 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
3461         * Makefile (libpthread-routines): Add pthread_atfork.
3462         (libpthread-static-only-routines): Add pthread_atfork.
3464 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3466         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
3467         of TLS_DTV_AT_TP.
3468         (INSTALL_DTV): Add parens.
3469         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
3470         Use passed descr instead of THREAD_SELF.
3471         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
3472         (__lll_mutex_timedlock_wait): Correct expected value after
3473         spurious wakeup.
3474         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
3475         Release lock before waking up the waiters.
3476         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
3477         criteria.  Reorderstruct passed to cleanup handler.  Fix
3478         handling of cancellation and failung pthread_mutex_unlock call.
3479         Use __pthread_enable_asynccancel_2 instead of
3480         __pthread_enable_asynccancel.
3481         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3482         Return result of lock re-get if it fails.
3483         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
3484         for __pthread_cleanup_push.
3485         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
3486         completely broken rwlock implementation.
3487         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3488         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3489         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3490         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3491         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3492         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
3493         versioned_symbol macro.
3494         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
3495         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
3497 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
3499         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
3500         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
3501         and __helper_tid.
3502         (struct timer): Remove th and bar field.
3503         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
3504         debugging code.  Create only one helper thread.
3505         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
3506         helper thread.
3507         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3508         Renamed.  Define statically.  Use thread info from siginfo.
3509         (__helper_once): New variable.
3510         (__helper_tid): New variable.
3511         (__reset_helper_control): New function.
3512         (__start_helper_thread): New function.
3514         * pthread_create.c (start_thread): Don't use setjmp inside
3515         __builtin_expect to work around gcc bug.
3517         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
3518         timer_delete syscall fails, but not with ENOSYS, set
3519         __no_posix_timers.
3521         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
3522         (timer_settime): Fix typo.
3523         * sysdeps/unix/sysv/linux/timer_getoverr.c
3524         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
3526 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3528         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
3529         offset of cleanupbuf.__prev.
3531 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
3533         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
3534         of included file.
3536 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
3538         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
3539         NULL provide default definition to syscall.
3541 2003-03-25  Roland McGrath  <roland@redhat.com>
3543         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
3544         (timer_id2ptr): Fix typo.
3546 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
3548         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
3549         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
3550         * sysdeps/ia64/pthreaddef.h: Likewise.
3551         * sysdeps/powerpc/pthreaddef.h: Likewise.
3552         * sysdeps/s390/pthreaddef.h: Likewise.
3553         * sysdeps/sh/pthreaddef.h: Likewise.
3554         * sysdeps/x86_64/pthreaddef.h: Likewise.
3555         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
3556         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
3557         being changed.
3558         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3559         SIGTIMER is not unblocked.
3560         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
3561         RT signal taken.
3562         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
3563         be send.
3564         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
3565         pass pointer through as ID.
3566         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
3567         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
3568         * sysdeps/unix/sysv/linux/timer_create.c: New file.
3569         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
3570         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
3571         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
3572         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
3573         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
3574         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
3575         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
3576         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
3577         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
3578         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
3579         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
3580         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
3581         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
3582         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
3583         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
3584         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
3585         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
3586         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
3587         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
3588         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
3589         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
3590         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
3591         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
3592         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
3593         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
3594         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
3595         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
3596         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
3597         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
3598         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
3600         * pthreadP.h: Remove FRAME_LEFT definition.
3601         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
3602         already left frame.  Programs which have this problem are not POSIX
3603         compliant.
3604         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
3606 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
3608         * sysdeps/pthread/tst-timer.c: Check return values of the
3609         functions we test.
3611 2003-03-23  Roland McGrath  <roland@redhat.com>
3613         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
3614         * tst-tls3mod.c: Likewise.
3615         * tst-tls1.c: Likewise.
3616         * tst-tls2.c: Likewise.
3618         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
3619         undefined behavior.
3621         * tst-join5.c (tf1, tf2): Add a cast.
3623         * Makeconfig (includes): Append -I$(..)nptl to this variable.
3625         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
3626         Don't test anything.
3627         * tst-cond4.c: Likewise.
3628         * tst-cond6.c: Likewise.
3629         * tst-flock2.c: Likewise.
3630         * tst-mutex4.c: Likewise.
3631         * tst-rwlock4.c: Likewise.
3632         * tst-signal1.c: Likewise.
3633         * tst-spin2.c: Likewise.
3634         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
3636         * tst-mutex4.c: Use test-skeleton.c.
3637         * tst-spin2.c: Likewise.
3638         * tst-sysconf.c: Likewise.
3639         * tst-barrier2.c: Likewise.
3640         * tst-cond4.c: Likewise.
3641         * tst-cond6.c: Likewise.
3642         * tst-rwlock4.c: Likewise.
3643         * tst-unload.c: Likewise.
3644         * tst-flock2.c (do_test): Use return instead of exit.
3646 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
3648         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
3650 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
3652         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3653         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
3654         instead of __lll_compare_and_swap.
3655         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3656         Likewise.
3657         Removed definition if __lll_compare_and_swap.
3659         * cancellation.c: Adjust for new form of compare&exchange macros.
3660         * cleanup_defer.c: Likewise.
3661         * init.c: Likewise.
3662         * libc-cancellation.c: Likewise.
3663         * old_pthread_cond_broadcast.c: Likewise.
3664         * old_pthread_cond_signal.c: Likewise.
3665         * old_pthread_cond_timedwait.c: Likewise.
3666         * old_pthread_cond_wait.c: Likewise.
3667         * pthread_cancel.c: Likewise.
3668         * pthread_create.c: Likewise.
3669         * pthread_detach.c: Likewise.
3670         * pthread_join.c: Likewise.
3671         * pthread_key_delete.c: Likewise.
3672         * pthread_setcancelstate.c: Likewise.
3673         * pthread_setcanceltype.c: Likewise.
3674         * pthread_timedjoin.c: Likewise.
3675         * pthread_tryjoin.c: Likewise.
3676         * sysdeps/pthread/createthread.c: Likewise.
3678 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
3680         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
3681         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
3682         definitions.  Replace uses with calls to atomic_* functions.
3683         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3684         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
3685         __lll_test_and_set calls with atomic_exchange_and_add and
3686         atomic_exchange calls respectively.
3687         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
3688         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
3689         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
3690         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3691         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
3692         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
3693         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
3695         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
3696         returns the old value.
3698 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
3700         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
3701         int for variable OLDVAL and correct inline assembler contraint.
3702         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
3703         type int for variable OLD.
3705         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
3706         only for s390-32.
3707         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3708         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
3709         instead of multiple_threads field in the TCB.
3711 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
3713         * sysdeps/i386/i686/bits/atomic.h: Removed.
3714         * sysdeps/i386/i586/bits/atomic.h: Removed.
3715         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
3716         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
3717         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
3718         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
3719         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
3720         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
3721         * atomic.h: Removed.  Moved to glibc.
3723         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
3724         support for clock selection.
3726         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
3727         signalling waiters.
3729 2003-03-18  Roland McGrath  <roland@redhat.com>
3731         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3732         Add __lll_rel_instr first.  Add memory clobber.
3733         (lll_mutex_unlock): Use __lll_test_and_set.
3734         From Paul Mackerras <paulus@samba.org>.
3736         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
3737         unconditionally.
3738         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3739         (SINGLE_THREAD_P):  Add `header.' prefix.
3740         From Paul Mackerras <paulus@samba.org>.
3742         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
3743         pthread_timedjoin_np to ...
3744         (libpthread: GLIBC_2.3.3): ... here.
3745         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
3747         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3748         Avoid shadowing VAL variable.
3750         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
3751         New macro.
3753 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
3755         * Makefile (tests): Add tst-cond11.
3756         * tst-cond11.c: New file.
3758         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
3759         struct passed to cleanup handler to eliminate one more
3760         instruction.
3761         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3763         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3764         (pthrad_cond_t): Replace __unused field with __clock.
3766         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
3767         waken all waiters in cleanup handler.
3768         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3769         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3771         * pthread_condattr_getclock.c: New file.
3772         * pthread_condattr_setclock.c: New file.
3773         * sysdeps/pthread/pthread.h: Declare these new functions.
3774         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
3775         * Makefile (libpthread-routines): Add the new functions.
3776         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
3777         Renamed field to value.  Document use of the bits.
3778         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
3779         change.
3780         * pthread_condattr_setpshared.c: Likewise.
3781         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
3782         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
3783         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3784         Add __clock field.
3785         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3786         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3787         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3788         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3789         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3790         Implement clock selection.
3791         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3792         * pthread-errnos.sym: Add ENOSYS.
3793         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3794         _POSIX_CLOCK_SELECTION.
3795         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3797         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
3798         invalid .size directive.
3800 2003-03-17  Roland McGrath  <roland@redhat.com>
3802         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3803         Formatting tweaks.
3805 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3807         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
3808         Use __lll_add instead of spelling it out.  Use protected symbol names.
3809         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
3810         Use __lll_add.
3811         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
3812         Renamed from lll_compare_and_swap.  Use new name where necessary.
3813         (__lll_add): Defined.
3814         (__lll_dec_if_positive): Defined.
3815         (__lll_test_and_set): Defined.
3816         * sysdeps/ia64/pthread_spin_init.c: Removed.
3817         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
3818         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
3819         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
3820         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
3821         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
3822         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
3823         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
3824         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
3825         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
3826         __sync_lock_release_si.
3827         Patch by Jakub Jelinek.
3829         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3830         Fix timeout handling.
3831         (__lll_timedwait_tid): Likewise.
3832         (lll_unlock_wake_cb): Wake up other waiters if necessary.
3833         Patch by Jakub Jelinek.
3835         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
3837 2003-03-17  Roland McGrath  <roland@redhat.com>
3839         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
3840         * sysdeps/pthread/pthread_spin_init.c: New file.
3841         * sysdeps/pthread/pthread_spin_unlock.c: New file.
3842         * sysdeps/powerpc/Makefile: New file.
3843         * sysdeps/powerpc/pthread_spin_lock.c: New file.
3844         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
3845         * sysdeps/powerpc/pthreaddef.h: New file.
3846         * sysdeps/powerpc/tcb-offsets.sym: New file.
3847         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
3848         * sysdeps/powerpc/tls.h: New file.
3849         * sysdeps/powerpc/bits/atomic.h: New file.
3850         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
3851         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
3852         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
3854         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
3855         * sysdeps/unix/sysv/linux/sem_post.c: New file.
3856         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
3857         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
3858         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
3859         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
3860         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
3861         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
3862         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
3863         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
3864         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
3865         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
3866         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
3867         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
3868         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
3870         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
3871         not gettimeofday.
3872         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
3873         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
3874         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
3875         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
3876         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
3878 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
3880         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
3881         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
3882         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3883         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3884         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
3886 2003-03-16  Roland McGrath  <roland@redhat.com>
3888         * tst-fork4.c: Include <string.h>.
3889         * tst-signal2.c: Likewise.
3890         * tst-mutex5.c (do_test): exit -> return.
3891         * tst-mutex2.c: Include <stdlib.h>.
3893 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
3895         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3896         (__lll_mutex_timedlock_wait): Correct expected value after
3897         spurious wakeup.  Otherwise we would never wait again.
3899         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
3900         zone versus inline asm stupidity.  Use correct instructions.
3902         * tst-rwlock6.c: Add some more status output.
3904 2003-03-15  Roland McGrath  <roland@redhat.com>
3906         * sysdeps/pthread/configure.in: New file.
3907         * sysdeps/pthread/configure: New file (generated).
3909 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3911         * allocatestack.c (allocate_stack): Store the exact stack size of
3912         user allocated stacks.
3914 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
3916         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
3917         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
3918         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3919         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
3920         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
3921         Use `header.' prefix.
3922         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
3924 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
3926         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
3927         __builtin_frame_address, use stack pointer.
3929         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
3930         instead of __builtin_frame_pointer.
3932 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3934         * tst-basic1.c (do_test): Add cast to avoid warning.
3935         * tst-basic2.c (do_test): Likewise.
3937         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
3938         amount of stack correction.
3940         * tst-fork4.c: Use test-skeleton.c.
3942 2003-03-14  Roland McGrath  <roland@redhat.com>
3944         * init.c: Fix typo "#eli" for "#else".
3946 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
3948         * allocatestack.c (__stack_user): Use hidden_data_def.
3949         * pthread_create.c (__pthread_keys): Likewise.
3951         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
3953 2003-03-14  Roland McGrath  <roland@redhat.com>
3955         * tst-fork4.c: New file.
3956         * Makefile (tests): Add it.
3958         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
3959         we always define the padding space.
3960         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
3961         stopped supporting its own extensions fully.
3962         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
3963         struct also called `header', so `header.multiple_threads' is the field
3964         name to use on all machines.
3965         * allocatestack.c (allocate_stack): Use `header.' prefix.
3966         * sysdeps/pthread/createthread.c (create_thread): Likewise.
3967         * pthread_create.c (__pthread_create_2_1): Likewise.
3968         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
3969         (THREAD_SELF): Likewise.
3970         * sysdeps/x86_64/tls.h: Likewise.
3971         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
3972         (SINGLE_THREAD_P): Likewise.
3973         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
3974         (SINGLE_THREAD_P): Likewise.
3975         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
3976         (SINGLE_THREAD_P): Likewise.
3978         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
3979         value directly.
3981 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
3983         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
3984         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
3986         * pthread_create.c (start_thread): setjmp is expected to return 0.
3988         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
3989         (THREAD_GETMEM_NC): Likewise.
3991 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
3993         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
3994         and the size of the stack which must be allocated is a multiple,
3995         allocate one more page.
3996         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
3997         MULTI_PAGE_ALIASING.
3999 2003-03-13  Roland McGrath  <roland@redhat.com>
4001         * pthread_create.c (start_thread): Set EXITING_BIT after the
4002         event-reporting (and destructors), not before.
4004 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
4006         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
4007         lll_futex_wake): Declare register variables as long int instead of
4008         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
4009         Make syscall arguments clobbered by the syscall.
4010         (lll_futex_wait): Define using lll_futex_timed_wait.
4012         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
4013         to void *.
4015         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
4016         PPID if [! NDEBUG].
4018         * allocatestack.c (nptl_ncreated): Only declare if
4019         COLORING_INCREMENT != 0.
4021         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
4022         (__libc_enable_asynccancel_2): Remove prototype.
4024         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
4025         ctid to match kernel.
4027 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4029         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
4030         libc_multiple_threads.
4031         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
4032         __libc_multiple_threads to...
4033         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
4035         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
4036         versioning.
4037         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4038         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4040         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
4041         (__pthread_once_internal): Define.
4043         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
4044         macros instead of .symver directly.
4045         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4046         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4048         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
4049         * sysdeps/x86_64/tcb-offsets.sym: New file.
4050         * sysdeps/x86_64/Makefile: New file.
4052         * sysdeps/i386/tcb-offsets.sym: Add SELF.
4053         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
4054         to access own pthread_t in TCB.
4055         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4056         Likewise.
4057         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4058         Likewise.
4059         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4061 2003-03-12  Roland McGrath  <roland@redhat.com>
4063         * pthread-errnos.sym: New file.
4064         * Makefile (gen-as-const-headers): New variable, list that file.
4065         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
4066         header <pthread-errnos.h> instead of defining errno values here.
4067         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4068         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4069         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4070         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4071         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4072         Likewise.
4073         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4074         Likewise.
4075         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4076         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4077         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4078         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4079         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4080         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4081         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4082         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4083         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4084         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4085         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4086         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
4087         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
4088         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
4089         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4090         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4091         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4092         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4093         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4094         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
4095         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4096         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
4097         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
4098         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
4099         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
4100         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4101         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4103         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
4104         CLONE_CHILD_SETTID worked.
4106 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4108         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
4109         file.
4110         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
4111         file.
4113         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4114         (pthread_cond_t): Add padding.
4116         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
4117         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
4118         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
4120         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
4121         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
4122         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
4123         (__pthread_rwlock_timedrdlock): Likewise.
4124         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
4125         (__pthread_rwlock_wrlock): Likewise.
4126         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
4127         (__pthread_rwlock_rdlock): Likewise.
4129         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
4131         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
4132         result of lock re-get if it fails.
4134 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4136         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
4137         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4138         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4139         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4140         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4141         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4142         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4143         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4144         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4145         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4147         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
4148         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
4150         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
4151         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
4152         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
4153         (create_thread): Likewise.
4154         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
4155         * init.c (__pthread_initialize_minimal_internal): Initialize
4156         __libc_multiple_threads_ptr if necessary.
4157         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
4158         __pthread_multiple_threads and __libc_multiple_threads_ptr.
4159         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
4160         __libc_multiple_threads.
4161         (__libc_pthread_init): Return pointer to __libc_pthread_init if
4162         necessary.
4164         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
4165         (THREAD_SETMEM_NC): Likewise.
4167         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
4168         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
4169         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
4170         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
4172         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
4173         Eliminate one entire instruction.
4175         * cancellation.c (__pthread_enable_asynccancel_2): New function.
4176         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
4177         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4178         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
4179         instead of __pthread_enable_asynccancel.
4180         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4181         (__pthread_cond_wait): Likewise.
4182         * sysdeps/pthread/pthread_cond_timedwait.c
4183         (__pthread_cond_timedwait): Likewise.
4184         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4186         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4187         (__condvar_cleanup): Wake up all waiters in case we got signaled
4188         after being woken up but before disabling asynchronous
4189         cancellation.
4190         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4191         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4192         (__condvar_cleanup): Likewise.
4194         * init.c (__NR_set_tid_address): If already defined, don't redefine.
4195         Make it an error if architecture has no #if case.  Add x86-64.
4197         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
4198         pt-initfini.s generation.
4200         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
4201         (TLS_INIT_TP): Fix typo.
4203 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4205         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
4206         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
4208         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
4209         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4210         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
4211         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
4212         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
4213         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4214         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4215         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4217 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4219         * sysdeps/pthread/pthread_cond_timedwait.c
4220         (__pthread_cond_timedwait): Return the result of the final
4221         locking.  If it succeeds, the regular function return value.
4223         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
4224         Return result of the final locking.
4225         * version.c (__nptl_main): Work around problems with the strange
4226         INTERNAL_SYSCALL macro on ppc32.
4227         * init.c (__pthread_initialize_minimal_internal): Unblock
4228         SIGCANCEL in case the parent blocked it.
4229         Reported by Paul Mackerras <paulus@samba.org>.
4231         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
4232         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
4233         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
4235 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4237         * sysdeps/pthread/pthread_cond_timedwait.c
4238         (__pthread_cond_timedwait): Unlock and fail if
4239         __pthread_mutex_unlock_internal failed.
4241         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
4242         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
4243         Use ARCH_CLONE.
4244         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
4245         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
4246         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
4247         ALLOCATE_STACK): New macros.
4248         (TLS_TPADJ): New macro.
4249         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
4250         (allocate_stack): Handle TLS_DTV_AT_TP and
4251         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
4252         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
4253         Don't set PD->self.
4254         * init.c [__ia64__] (__NR_set_tid_address): Define.
4256         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
4257         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
4258         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
4259         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
4260         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
4261         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
4262         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
4263         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
4264         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
4265         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
4266         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
4267         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
4268         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
4269         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
4270         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
4271         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
4272         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
4273         * sysdeps/ia64/bits/atomic.h: New file.
4274         * sysdeps/ia64/Makefile: New file.
4275         * sysdeps/ia64/pthread_spin_init.c: New file.
4276         * sysdeps/ia64/pthread_spin_lock.c: New file.
4277         * sysdeps/ia64/pthread_spin_trylock.c: New file.
4278         * sysdeps/ia64/pthread_spin_unlock.c: New file.
4279         * sysdeps/ia64/pthreaddef.h: New file.
4280         * sysdeps/ia64/tcb-offsets.sym: New file.
4281         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
4282         * sysdeps/ia64/tls.h: New file.
4284         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
4285         to syscall instead of no arguments.
4287 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
4289         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
4290         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
4291         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
4292         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
4294         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
4295         unused code.
4297         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
4299         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4300         lowlevelbarrier.sym.
4301         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
4302         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
4303         Include lowlevelbarrier.h and don't define offsets locally.
4304         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
4306         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4307         (__lll_mutex_lock_wait): Reverse order of first two parameters.
4308         (__lll_mutex_timedlock_wait): Likewise.
4309         (lll_mutex_lock): Adjust asm for that.
4310         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
4311         (lll_lock): Adjust asm for operand order change.
4312         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
4313         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
4315         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
4316         Reverse order of parameters.
4317         (__lll_timedwait_tid): Remove regparms attribute.
4318         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
4319         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
4321         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4322         (__lll_timedwait_tid): Remove one unnecessary instruction.
4324         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
4325         __lll_mutex_timedlock_wait only for NOT_IN_libc.
4326         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
4327         lowlevelmutex.S.
4329         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
4330         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
4331         for NOT_IN_libc.
4332         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
4333         lowlevellock.S.
4335         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
4336         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
4337         for libc.so.
4338         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
4339         define LOCK here (if UP is not defined).  The actual code is in
4340         lowlevelmutex.S.
4342         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
4343         LOCK is already defined.  Don't define lll_unlock_wake_cb and
4344         __lll_timedwait_tid for libc.so.
4345         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
4346         define LOCK here (if UP is not defined).  The actual code is in
4347         lowlevellock.S.
4349         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
4350         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
4351         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
4352         instead of lowlevelsem.h.
4353         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4354         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4355         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4357         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4358         lowlevelrwlock.sym.
4359         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
4360         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
4361         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
4363         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
4364         register loading.
4365         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
4366         last changed.  D'oh.
4368         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
4370         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
4371         of __libc_locking_needed.
4372         (lll_trylock): Initialize %eax to zero.
4374         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
4375         pthread_cond_t definition.
4377 2003-03-10  Roland McGrath  <roland@redhat.com>
4379         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
4380         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
4381         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
4382         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
4383         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
4385         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
4386         Instead of setting PD->multiple_threads, set globals
4387         __pthread_multiple_threads and __libc_multiple_threads.
4388         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4389         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
4390         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
4392         * descr.h (struct pthread): Conditionalize first member on
4393         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
4394         containing an anonymous tcbhead_t.  Move `list' member out.
4395         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
4396         * allocatestack.c: Remove use of `header.data.' prefix.
4397         * pthread_create.c: Likewise.
4398         * init.c (__pthread_initialize_minimal_internal): Likewise.
4399         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4400         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
4401         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
4402         * sysdeps/x86_64/tls.h: Likewise.
4403         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4404         (SINGLE_THREAD_P): Likewise.
4405         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4406         (SINGLE_THREAD_P): Likewise.
4407         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
4408         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
4410 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
4412         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
4414         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
4415         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4417         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
4418         leftovers from the ia32 code.
4420         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
4421         memory load.
4422         (clear_once_control): Don't load %esi.
4424         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
4425         handling.
4427         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4429         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
4430         * sysdeps/unix/sysv/linux/createthread.c: ...here.
4432         * Makefile (tests): Add tst-cond10.
4433         * tst-cond10.c: New file.
4435 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
4437         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
4438         * tst-signal3.c (do_test): Likewise.
4439         * tst-sem5.c (do_test): Likewise.
4440         * tst-kill6.c (do_test): Likewise.
4441         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
4443         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
4444         of inc/dec.
4445         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
4446         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
4447         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4448         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4449         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4450         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4451         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4452         Likewise.
4453         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4454         Likewise.
4455         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4456         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4457         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4458         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4459         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4460         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
4461         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4462         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4464         * allocatestack.c (allocate_stack): If mprotect() fails free the
4465         TLS memory.
4467 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
4469         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
4471         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
4472         lll_wake_tid.  This was used only to work around kernel limits in
4473         the early days.
4474         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
4475         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
4476         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4477         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
4479         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
4480         (__pthread_initialize_minimal_internal): Change initialization of
4481         __static_tls_align_m1 appropriately.
4482         * pthreadP.h (__static_tls_align_m1): Renamed from
4483         __static_tls_align.
4484         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
4485         instead of __static_tls_align-1.
4487 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
4489         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
4491         * pthread_create.c: Define __pthread_keys using nocommon
4492         attribute, not by placing it explicitly in bss.
4493         Remove DEFINE_DEALLOC definition.  Not needed anymore.
4495         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
4496         Use it in mmap call to allocate stacks.
4498         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
4500         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
4501         result of the thread function.
4503 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
4505         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
4506         version is just fine.
4508         * sysdeps/unix/sysv/linux/libc_pthread_init.c
4509         (__pthread_child_handler): Renamed from pthread_child_handler,
4510         exported, and marked hidden.  Change all users.
4511         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
4512         free __pthread_child_handler from child list.
4514 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4516         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
4518         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4519         Fix handling of cancellation and failing pthread_mutex_unlock call.
4520         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4521         (__pthread_cond_wait): Likewise.
4523         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4524         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
4525         lll_futex_timed_wait call.
4526         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4527         (pthread_rwlock_timedwrlock): Likewise.
4529         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4530         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
4531         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
4533         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
4534         check of lll_futex_wake return value.
4536 2003-03-03  Roland McGrath  <roland@redhat.com>
4538         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
4540         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4541         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
4542         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
4544 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
4546         * sysdeps/pthread/timer_create.c (timer_create): Return correct
4547         error for CPU clocks.
4549         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4550         _POSIX_MONOTONIC_CLOCK.
4551         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4553         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
4554         recent kernels.
4556 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4558         * descr.h (struct pthread): Move cleanup field to the front.
4560 2003-03-01  Roland McGrath  <roland@redhat.com>
4562         * sem_open.c (sem_open): Braino fix.
4564 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
4566         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
4567         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
4568         __pthread_cleanup_pop functionality.
4569         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4571         * descr.h (struct pthread): Move tid field to the front now that
4572         it is often used.
4574         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
4575         (__lll_mutex_timedlock_wait): Remove.
4576         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4577         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4578         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
4579         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4580         (lll_unlock_wake_cb): Don't save and restore %esi.
4581         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4582         %esi.
4583         (__lll_timedwait_tid): Add alignment.
4584         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
4585         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
4586         %esi.
4587         (__lll_timedwait_tid): Removed.
4588         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
4589         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
4590         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4591         (pthread_barrier_wait): Don't save, load, and restore %esi for
4592         last thread.
4593         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4594         (__pthread_cond_signal): Don't save, load, and restore %esi.
4595         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
4596         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
4597         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4598         Don't save, load, and restore %esi.
4600 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
4602         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
4603         Release lock before waking up the waiters.
4605         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
4607         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
4608         (reader_thread): Likewise.
4610         * sysdeps/pthread/pthread_rwlock_unlock.c
4611         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
4612         to wake up readers if there are none.
4614         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
4615         Release internal lock before wake threads.
4617 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
4619         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
4620         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
4621         predefined.
4622         * tst-rwlock9.c: Likewise.
4623         * tst-rwlock10.c: New file.
4624         * tst-rwlock11.c: New file.
4626         * Makefile (tests): Add tst-dlsym1.
4627         * tst-dlsym1.c: New file.
4629         * init.c (__pthread_initialize_minimal_internal): Set
4630         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
4631         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
4633 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
4635         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
4637         * tst-cond2.c: Fix sychronization with child.
4639         * tst-rwlock8.c (reader_thread): Remove unused variable.
4641         * Makefile: Add rules to build and run tst-tls3.
4642         * tst-tls3.c: New file.
4643         * tst-tls3mod.c: New file.
4645         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
4646         * tst-rwlock8.c: New file.
4647         * tst-rwlock9.c: New file.
4648         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
4649         complete broken rwlock implementation.
4650         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4651         Likewise.
4652         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4653         Likewise.
4654         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4655         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4656         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
4657         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4658         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4659         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
4660         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4662 2003-02-23  Roland McGrath  <roland@redhat.com>
4664         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
4666 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
4668         * Makefile (tests): Add tst-context1.
4669         * tst-context1.c: New file.
4671         * Makefile (tests): Add tst-tls1 and tst-tls2.
4672         * tst-tls1.c: New file.
4673         * tst-tls2.c: New file.
4675         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
4676         for failed cmpxchg.
4678         * pthread_create.c (start_thread): Set EXITING_BIT early.
4680         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
4681         (THREAD_GETMEM_NC): Likewise.
4683 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
4685         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
4686         off 3 more bytes by using offset-less instructions when possible.
4688         * Makefile: Add dependency for $(objpfx)version.d.
4690         * eintr.c (eintr_source): Add unnecessary return but the compiler
4691         insists.
4693         * tst-kill3.c: Include <unistd.h>.
4695 2003-02-21  Roland McGrath  <roland@redhat.com>
4697         * pthread_create.c (start_thread): Call __libc_thread_freeres.
4699 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4701         * Makefile (tests): Add tst-eintr1.
4702         (distribute): Add eintr.c.
4703         * tst-eintr1.c: New file.
4704         * eintr.c: New file.
4706         * pthread_cancel.c (pthread_cancel): Use tkill directly.
4708         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
4709         Disallow sending SIGCANCEL.
4711         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
4712         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
4713         * tst-kill1.c: New file.
4714         * tst-kill2.c: New file.
4715         * tst-kill3.c: New file.
4716         * tst-kill5.c: New file.
4717         * tst-kill6.c: New file.
4718         * tst-basic7.c: Renamed to...
4719         * tst-kill4.c: ...this.
4721 2003-02-21  Roland McGrath  <roland@redhat.com>
4723         * Makefile (install-lib-ldscripts): New variable.
4725 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
4727         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
4728         * pthread_cancel.c: Use INVALID_TD_P.
4729         * pthread_detach.c: Likewise.
4730         * pthread_getschedparam.c: Likewise.
4731         * pthread_setschedparam.c: Likewise.
4732         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
4733         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4734         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
4735         * pthread_timedjoin.c: Likewise.
4737         * tst-basic7.c: Include <signal.h>.
4739         * pthread_join.c (pthread_join): Limited checking for invalid
4740         descriptors.
4741         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
4743 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
4745         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
4746         beginning of the loop.  Clear the entire first block of TSD.
4747         * Makefile (tests): Add tst-key4.
4748         * tst-key4.c: New file.
4750 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
4752         * Makefile (tests): Add tst-basic7.
4753         * tst-basic7.c: New file.
4755         * pthread_create.c (deallocate_tsd): Mark as internal_function.
4756         Add some more __builtin_expect.
4758         * pthreadP.h: Define dummy version of DEBUGGING_P.
4760 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
4762         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
4763         _POSIX_THREAD_PRIORITY_SCHEDULING.
4764         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
4765         _XOPEN_REALTIME_THREADS.
4766         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4768         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
4769         kernel returns EINVAL for PID <= 0, work around it.
4771         * Makefile (tests): Add tst-signal5.
4772         * tst-signal5.c: New file.
4774         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
4775         and LOGIN_NAME_MAX.
4777         * tst-cancel1.c (tf): Block all signals.
4779         * Makefile (tests): Add tst-basic6.
4780         * tst-basic6.c: New file.
4782         * tst-basic1.c: Add test for process ID.
4784         * Makefile (tests): Add tst-cancel10.
4785         * tst-cancel10.c: New file.
4787         * Makefile (tests): Add tst-signal4.
4788         * tst-signal4.c: New file.
4790         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
4791         __sigismember instead of sigismember.  Add __builtin_expect.
4793 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
4795         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
4796         pthread_setcancelstate, and pthread_rwlock_setpshared.
4798         * tst-cancel7.c (do_test): Make sure the pid file exists before
4799         canceling the thread.
4801         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
4802         pthread_rwlock_timedrdlock tests.
4803         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
4804         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4805         Check for invalid tv_nsec field.
4806         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4807         Likewise.
4809         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
4810         recursive mutex of overflow.
4812         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
4814         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
4815         going into an endless loop.
4816         * Makefile (tests): Add tst-cancel9.
4817         * tst-cancel9.c: New file.
4819         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
4821 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
4823         * tst-mutex5.c (do_test): Add more timedlock tests.
4825         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
4826         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
4828         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4829         use INLINE_SYSCALL.  Error number is returned, not -1.
4831         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
4832         and __deallocate_stack with internal_function.
4833         * pthread_create.c: Adjust definitions appropriately.
4834         * allocatestack.c: Likewise.
4836         * pthread_join.c: Add one more __builtin_expect.
4837         * pthread_timedjoin.c: Likewise.
4839         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
4840         not data of sequence number does not match.
4841         Add one __builtin_expect.
4843         * Makefile (tests): Add tst-clock1.
4844         * tst-clock1.c: New file.
4846         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
4847         negative arguments.
4848         * Makefile (tests): Add tst-basic5.
4849         * tst-basic5.c: New file.
4851 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
4853         * Makefile (tests): Add tst-basic4.
4854         * tst-basic4.c: New file.
4856         * pthreadP.h: Add declaraction for __nptl_nthreads.
4857         * pthread_create.c: Define __nptl_nthreads
4858         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
4859         after thread is done.  If then zero, call exit(0).
4860         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4861         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
4862         * init.c (pthread_functions): Initialize ptr_nthreads.
4863         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
4864         (__reclaim_stacks): Decrement __nptl_nthreads.
4865         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
4866         Define.
4867         * Makefile (tests): Add tst-basic3.
4868         * tst-basic3.c: New file.
4870         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
4871         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
4872         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
4873         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
4874         if asynchronous canceling is enabled.
4875         * pthread_join.c (pthread_join): When recognizing circular joins,
4876         take into account the other thread might be already canceled.
4877         * Makefile (tests): Add tst-join5.
4878         * tst-join5.c: New file.
4880         * Makefile (tests): Add tst-join4.
4881         * tst-join4.c: New file.
4883 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
4885         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
4887 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4889         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
4890         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
4891         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
4892         warning.
4893         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
4894         to avoid warning.
4895         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
4896         error if lll_futex_wake failed.
4898 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
4900         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
4901         handling of cancellation and failung pthread_mutex_unlock call.
4902         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4903         * Makefile (tests): Add tst-cond8 and tst-cond9.
4904         * tst-cond8.c: New file.
4905         * tst-cond9.c: New file.
4907         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
4909         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
4910         non-standard initializers with __USE_GNU.
4912         * Makefile (tests): Add tst-cleanup3.
4913         * tst-cleanup3.c: New file.
4915 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
4917         * Makefile (tests): Add tst-attr1 and tst-attr2.
4918         * tst-attr1.c: New file.
4919         * tst-attr2.c: New file.
4921         * Makefile: Add rules to build and run tst-atfork2 test.
4922         * tst-atfork2.c: New file.
4923         * tst-atfork2mod.c: New file.
4925         * sysdeps/unix/sysv/linux/unregister-atfork.c
4926         (__unregister_atfork): Free the memory allocated for the handlers
4927         after removing them from the lists.
4929         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
4930         cleanup function.
4932         * tst-atfork1.c (do_test): Wait for the child we forked.
4933         Report error in child.
4935         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
4937         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
4939 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
4941         * Makefile (tests): Add tst-cancel8.
4942         * tst-cancel8.c: New file.
4944         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
4945         clearing of control variable.
4946         * Makefile (tests): Add tst-once3 and tst-once4.
4947         * tst-once3.c: New file.
4948         * tst-once4.c: New file.
4950 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
4952         * sysdeps/sh/Makefile: New file.
4953         * sysdeps/sh/bits/atomic.h: New file.
4954         * sysdeps/sh/pthread_spin_init.c: New file.
4955         * sysdeps/sh/pthread_spin_lock.c: New file.
4956         * sysdeps/sh/pthread_spin_trylock.S: New file.
4957         * sysdeps/sh/pthread_spin_unlock.S: New file.
4958         * sysdeps/sh/pthreaddef.h: New file.
4959         * sysdeps/sh/tcb-offsets.sym: New file.
4960         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
4961         * sysdeps/sh/tls.h: New file.
4962         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
4963         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
4964         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
4965         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
4966         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
4967         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
4968         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
4969         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
4970         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
4971         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
4972         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
4973         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
4974         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
4975         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
4976         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
4977         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
4978         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
4979         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
4980         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
4981         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
4982         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
4983         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
4984         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
4985         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
4986         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
4987         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
4988         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
4989         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
4990         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
4991         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
4993 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
4995         * tst-cond2.c: Rearrange code to not rely on behavior undefined
4996         according to POSIX.
4998         * tst-basic2.c (do_test): Lock mutex before creating the thread.
5000 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
5002         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
5003         (TLS_GET_FS): New #define.
5004         (TLS_SET_FS): New #define.
5005         Correct value of __NR_set_thread_area.
5007         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
5009 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
5011         * Makefile (tests): Add tst-popen1.
5012         * tst-popen1.c: New file.
5014         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
5015         but inactive generalization.
5016         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5017         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5018         Minor optimization, remove one instruction.
5019         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5021 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5023         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
5025 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5027         * init.c (__NR_set_tid_address): Add #ifdef for s390.
5028         * sysdeps/pthread/pthread_barrier_wait.c: New file.
5029         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
5030         * sysdeps/pthread/pthread_cond_signal.c: New file.
5031         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
5032         * sysdeps/pthread/pthread_cond_wait.c: New file.
5033         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
5034         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
5035         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
5036         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
5037         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
5038         * sysdeps/s390/Makefile: New file.
5039         * sysdeps/s390/bits/atomic.h: New file.
5040         * sysdeps/s390/pthread_spin_init.c: New file.
5041         * sysdeps/s390/pthread_spin_lock.c: New file.
5042         * sysdeps/s390/pthread_spin_trylock.c: New file.
5043         * sysdeps/s390/pthread_spin_unlock.c: New file.
5044         * sysdeps/s390/pthreaddef.h: New file.
5045         * sysdeps/s390/tcb-offsets.sym: New file.
5046         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
5047         * sysdeps/s390/tls.h: New file.
5048         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
5049         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
5050         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
5051         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
5052         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
5053         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
5054         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5055         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
5056         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
5057         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
5058         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
5059         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
5060         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
5061         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
5062         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
5063         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
5064         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
5065         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
5066         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
5067         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
5068         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
5069         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5070         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
5072 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
5074         * atomic.h: Add a couple more default implementations.
5075         (atomic_compare_and_exchange_acq): Use
5076         __arch_compare_and_exchange_32_acq in return value definition.  It
5077         always exists.
5078         (atomic_bit_set): Renamed from atomic_set_bit.
5079         Add missing atomic_ prefixes.
5081         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
5082         thread library is available, use correct value to mark initialized
5083         once variable.
5085 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
5087         * allocatestack.c (allocate_stack): Use __getpagesize instead of
5088         __sysconf to determine pagesize.
5090         * pthread_create.c: Include <atomic.h>.
5091         * allocatestack.c (allocate_stack): Implement coloring of the
5092         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
5093         size minus one.  Adjust users.
5094         * sysdeps/i386/i686/Makefile: New file.
5096 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
5098         * allocatestack.c: Improve comment throughout the file.
5100         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5101         (__lll_lock_wait): Add branch prediction.
5102         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5103         (__lll_lock_wait): Likewise.
5104         (lll_unlock_wake_cb): Removed.
5106 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
5108         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
5109         _POSIX_THREAD_PRIORITY_SCHEDULING.
5111 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
5113         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5114         Fix return type of ptr___pthread_getspecific.
5116 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
5118         * Makefile (tests): Add tst-umask1.
5119         (tst-umask1-ARGS): Define.
5120         * tst-umask1.c: New file.
5122 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
5124         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
5125         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
5126         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
5127         pthread_rwlock_unlock.
5128         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
5129         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
5130         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
5131         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
5132         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5133         New file.
5134         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
5135         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5136         New file.
5137         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
5138         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
5139         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
5140         New file.
5141         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
5142         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
5143         New file.
5144         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
5145         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
5146         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
5147         New file.
5148         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
5149         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
5150         New file.
5151         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
5153         * Makefile (libpthread-routines): Remove lowlevelcond and
5154         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
5155         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
5156         and pthread_cond_broadcast.
5157         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
5158         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
5159         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
5160         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
5161         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
5162         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
5163         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
5164         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
5165         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
5166         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
5167         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
5168         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
5169         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
5170         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
5171         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
5172         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
5173         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
5174         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
5175         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
5176         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
5177         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
5178         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
5179         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
5180         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
5181         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
5182         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
5183         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
5184         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
5185         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
5186         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
5187         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
5189         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
5190         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
5191         of the code is moved to ...
5192         * sysdeps/pthread/createthread.c: ...here.  New file.
5194 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
5196         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
5197         (__new_sem_post): Clear %eax before returning.
5198         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
5200         * Makefile (tests): Add tst-cleanup2.
5201         * tst-cleanup2.c: New file.
5203         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
5204         Interpret first parameter correctly.
5206 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
5208         * Makefile (headers): Add bits/semaphore.h.
5210 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
5212         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
5213         if not SHARED.
5215 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
5217         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
5218         must be used and mapping failed.
5219         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
5221         * Makefile (CFLAGS-pthread_self.os): Define this, not
5222         CFLAGS-pthread_self.c.
5224 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5226         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
5227         lll_unlock_wake_cb.
5229         * Makefile (libpthread-routines): Add version.  Add rules to build
5230         version.os and banner.h.
5231         * version.c: New file.
5233 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
5235         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
5236         the alias unconditional.
5237         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
5239 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5241         * Makefile (CFLAGS-pthread_self.c): New definition.
5243 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5245         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
5246         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
5247         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
5248         * init.c (__pthread_initialize_minimal_internal): Likewise.
5250 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
5252         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
5254         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
5255         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5256         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5257         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
5258         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5259         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5261 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5263         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
5264         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
5265         * tst-cancel-wrappers.sh: Remove all exceptions.
5267 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
5269         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
5270         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
5272         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
5273         Use __libc_pthread_functions array if SHARED.
5275         * pthreadP.h: Move pthread_cond_2_0_t definition to...
5276         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
5278         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
5279         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
5280         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
5281         __libc_ptf_call instead of __libc_maybe_call.
5282         (PTF): New #define.
5283         (__libc_cleanup_region_start): Wrap function name with PTF call.
5284         (__libc_cleanup_region_end): Likewise.
5285         (__libc_cleanup_end): Likewise.
5287         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
5288         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
5289         * pthread_key_create.c: Add __pthread_key_create_internal alias.
5290         * pthreadP.h: Add prototypes.
5292         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
5293         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
5294         __pthread_rwlock_unlock aliases.
5295         * pthreadP.h: Add prototypes for new aliases.
5297         * pthreadP.h (struct pthead_functions): Moved to...
5298         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
5299         * init.c (pthread_functions): Add initializers for new elements.
5301         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
5302         __pthread_cleanup_pop_restore aliases.
5303         * pthreadP.h: Add prototypes.
5305         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
5306         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
5307         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
5308         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
5309         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5310         * pthreadP.h: Adjust prototypes and callers.
5312 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
5314         * Makefile (tests): Add tst-cancel7.
5315         (tst-cancel7-ARGS): New variable.
5316         * tst-cancel7.c: New file.
5318         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
5319         around gcc defficiencies.
5320         * old_pthread_cond_signal.c: Likewise.
5321         * old_pthread_cond_timedwait.c: Likewise.
5322         * old_pthread_cond_wait.c: Likewise.
5324         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
5326 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5328         * Makefile (tests): Add tst-cond7.
5329         * tst-cond7.c: New file.
5331         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5332         (condvar_cleanup): Get condvar address from the right place.
5334         * atomic.h: Correct definitions of atomic_full_barrier,
5335         atomic_read_barrier, atomic_write_barrier.
5337         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
5338         race-free.
5339         * old_pthread_cond_signal.c: Likewise.
5340         * old_pthread_cond_timedwait.c: Likewise.
5341         * old_pthread_cond_wait.c: Likewise.
5343 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
5345         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
5347 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5349         * pthreadP.h (pthread_cond_2_0_t): New type.
5350         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
5351         Use new type for the 2.0 condvar function prototypes.
5352         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
5353         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
5354         parameter.
5355         * old_pthread_cond_destroy.c: Likewise.
5356         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
5357         * old_pthread_cond_signal.c: Likewise.
5358         * old_pthread_cond_timedwait.c: Likewise.
5359         * old_pthread_cond_wait.c: Likewise.
5361         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5362         (__pthread_cond_wait): Don't save cancellation mode and seq value
5363         in same location.
5365         * herrno.c (__h_errno_location): Don't define as weak.
5367 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5369         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
5370         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
5371         and pthread_cond_wait.
5372         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
5373         Renamed to...
5374         (__pthread_cond_broadcast_2_0): ... this.
5375         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
5376         Renamed to...
5377         (__pthread_cond_destroy_2_0): ... this.
5378         * old_pthread_cond_init.c (__old_pthread_cond_init):
5379         Renamed to...
5380         (__pthread_cond_init_2_0): ... this.
5381         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
5382         Renamed to...
5383         (__pthread_cond_signal_2_0): ... this.
5384         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
5385         Renamed to...
5386         (__pthread_cond_wait_2_0): ... this.
5387         * pthread_cond_destroy.c: Include shlib-compat.h.
5388         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
5389         * pthread_cond_init.c: Include shlib-compat.h.
5390         (pthread_cond_init): Change strong_alias into versioned_symbol.
5391         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
5392         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
5393         fields.
5394         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
5395         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
5396         __pthread_cond_wait_2_0): New prototypes.
5397         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
5398         __old_pthread_cond_init, __old_pthread_cond_signal,
5399         __old_pthread_cond_wait): Removed.
5400         * init.c: Include shlib-compat.h.
5401         (pthread_functions): Guard ptr___pthread_attr_init_2_0
5402         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
5403         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
5404         ptr___pthread_cond_*_2_0 fields.
5405         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
5406         pthread_cond_*@GLIBC_2.0 compatibility symbols.
5408         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
5409         LIBC_SIGACTION was not yet defined.
5410         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
5411         [!defined LIBC_SIGACTION] (__sigaction): New function and
5412         libc_hidden_weak.
5413         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
5414         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
5416 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5418         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
5420 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
5422         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5423         New, larger type definition.
5424         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
5425         implementation.
5426         * Versions [libpthread]: Add definitions for new pthread_cond_*
5427         interfaces for version GLIBC_2.3.2.
5428         * pthread_cond_init.c: Update initialization for new type definition.
5429         * Makefile (libpthread-routines): Remove pthread_cond_wait,
5430         pthread_cond_timedwait, pthread_cond_signal, and
5431         pthread_cond_broadcast.  Add old_pthread_cond_init,
5432         old_pthread_cond_destroy, old_pthread_cond_wait,
5433         old_pthread_cond_timedwait, old_pthread_cond_signal, and
5434         old_pthread_cond_broadcast.
5435         * old_pthread_cond_broadcast.c: New file.
5436         * old_pthread_cond_destroy.c: New file.
5437         * old_pthread_cond_init.c: New file.
5438         * old_pthread_cond_signal.c: New file.
5439         * old_pthread_cond_timedwait.c: New file.
5440         * old_pthread_cond_wait.c: New file.
5441         * pthreadP.h: Add prototypes for the compatibility interfaces.
5443         * pthread_cond_destroy.c: Don't include <errno.h>.
5445 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
5447         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
5448         unnecessary zero offset when addressing MUTEX.
5450 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5452         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
5453         __register_atfork.
5454         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
5455         for __register_atfork.
5457 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5459         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
5460         instead of ASSEMBLER test macro.
5462         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
5463         __libc_current_sigrtmax): Add libc_hidden_def.
5465         * sysdeps/pthread/list.h: Remove assert.h include.
5467 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5469         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
5470         __pthread_initialize_minimal_internal not
5471         __pthread_initialize_minimal.
5473 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
5475         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
5476         __pthread_initialize_minimal as hidden.
5478         * init.c (__pthread_initialize_minimal_internal): Don't mark as
5479         constructor.
5481 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5483         * Makefile ($(inst_libdir)/libpthread.so): Depend on
5484         $(common-objpfx)format.lds, include that into the output script.
5485         Fix comment.
5486         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
5488 2002-12-28  Andreas Jaeger  <aj@suse.de>
5490         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
5491         nsec resolution changes.
5492         (xstat64_conv): Likewise.
5493         (xstat32_conv): Likewise.
5494         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
5495         struct kernel_stat.
5496         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
5497         structs stat and stat64.
5498         * time/time.h (__timespec_defined): Define for __USE_MISC.
5499         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
5501 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
5503         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
5504         argument.
5505         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
5506         (pthread_exit): Use strong_alias to avoid warnings.
5507         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
5508         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
5509         ptr___pthread_attr_init_2_*.
5510         * init.c (pthread_functions): Adjust.
5512 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
5514         * forward.c: Make all functions available by default again.  It
5515         caused too much trouble.
5517         * pt-siglongjmp.c: Removed.
5519 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
5521         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
5522         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
5523         * sysdeps/i386/Makefile: New file.
5524         * sysdeps/i386/tcb-offsets.sym: New file.
5525         * sysdeps/pthread/tcb-offsets.h: New file.
5526         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5527         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
5529         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
5530         __register_atfork...
5531         (GLIBC_2.3.2): ...here.
5533 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5535         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
5536         pthread_attr_setstackaddr with __attribute_deprecated__.
5538 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5540         * pt-system.c (system): Remove cancellation handling.
5541         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
5542         cancellation routines.
5544 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
5546         * descr.h: Include <dl-sysdep.h>.
5547         (struct pthread): Move header.data.list to the back of the struct.
5548         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
5549         (MULTIPLE_THREADS_OFFSET): Adjust offset.
5550         (SYSINFO_OFFSEET): Likewise.
5552 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
5554         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
5555         Define.
5556         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
5557         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
5558         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
5559         (USE_DL_SYSINFO): Undef.
5561 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
5563         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
5564         $(common-objpfx)libc.so.
5565         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
5566         it is bigger than pipe buffer size even on arches with bigger
5567         page size.
5568         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
5570 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
5572         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
5573         correct errno access for case that USE___THREAD is not defined.
5575 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
5577         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
5578         Patch by Marijn Ros <marijn@mad.scientist.com>.
5580 2002-12-22  Roland McGrath  <roland@redhat.com>
5582         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
5584 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
5586         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
5588 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
5590         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
5591         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
5592         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
5594         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
5595         of int $0x80.
5596         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
5597         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
5598         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
5599         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5600         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5601         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
5602         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
5603         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5605         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
5606         sysenter.
5607         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5609         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
5611         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
5612         in new TCB.
5613         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
5614         that sysinfo is properly initialized.
5615         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
5616         to 1 only for ld.so.
5618         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
5619         RTLD_CORRECT_DYNAMIC_WEAK.
5621 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
5623         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
5624         Use return 0 as 6th argument to FORWARD4.
5625         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
5627 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5629         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
5630         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
5631         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
5632         (INIT_SYSINFO): New #define.
5633         (TLS_TP_INIT): Use INIT_SYSINFO.
5634         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5635         At test to make sure SYSINFO_OFFSET value is correct.
5636         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
5638 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
5640         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
5641         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
5642         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
5643         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
5644         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
5645         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
5646         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
5648 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
5650         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
5651         macro instead of using int $0x80 directly.
5653         * sysdeps/pthread/bits/stdio-lock.h: New file.
5654         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
5655         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
5656         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
5657         * Makefile (routines): Add libc-lowlevelmutex.
5659         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
5660         __i686.get_pc_thunk.dx.
5662 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5664         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
5665         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
5666         ($(objpfx)tst-cancel-wrappers.out): New rule.
5667         * tst-cancel-wrappers.sh: New test.
5668         * tst-locale1.c: Include signal.h.
5669         (uselocale): Test static linking of __libc_current_sigrt*.
5671 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
5673         * Makefile (tests): Add tst-cancel6.
5674         * tst-cancel6.c: New file
5676 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
5678         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
5679         Define meaningfully for assembler as well.
5680         * pthreadP.h (struct pthread_functions): Remove
5681         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
5682         and ptr_pthread_attr_init_2_1 fields.
5683         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
5684         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
5685         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
5686         (FORWARD3): Define using FORWARD4.
5687         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
5688         versions.
5689         * pt-system.c: Remove duplicate stdlib.h include.
5691 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
5693         * sem_init.c: Define sem_init@GLIBC_2.0.
5694         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
5695         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
5697         * flockfile.c: Moved to...
5698         * sysdeps/pthread/flockfile.c: ...here.  New file.
5699         * funlockfile.c: Moved to...
5700         * sysdeps/pthread/funlockfile.c: ...here.  New file.
5701         * ftrylockfile.c: Moved to...
5702         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
5704 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
5706         * libc-cancellation.c: Guard both function with
5707         #if !defined NOT_IN_libc.
5708         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
5709         automatically provided pthread wrappers.
5710         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
5711         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
5712         nor in libpthread.
5713         * pt-open.c: Removed.
5714         * pt-fcntl.c: Removed.
5715         * pt-fsync.c: Removed.
5716         * pt-lseek.c: Removed.
5717         * pt-msgrcv.c: Removed.
5718         * pt-msgsnd.c: Removed.
5719         * pt-msync.c: Removed.
5720         * pt-nanosleep.c: Removed.
5721         * pt-open64.c: Removed.
5722         * pt-pause.c: Removed.
5723         * pt-pread.c: Removed.
5724         * pt-pread64.c: Removed.
5725         * pt-pwrite.c: Removed.
5726         * pt-pwrite64.c: Removed.
5727         * pt-read.c: Removed.
5728         * pt-recv.c: Removed.
5729         * pt-recvfrom.c: Removed.
5730         * pt-recvmsg.c: Removed.
5731         * pt-send.c: Removed.
5732         * pt-sendto.c: Removed.
5733         * pt-sigtimedwait.c: Removed.
5734         * pt-sigwait.c: Removed.
5735         * pt-wait.c: Removed.
5736         * pt-waitpid.c: Removed.
5737         * pt-write.c: Removed.
5738         * pt-accept.c: Removed.
5739         * pt-close.c: Removed.
5740         * pt-connect.c: Removed.
5741         * pt-lseek64.c: Removed.
5742         * pt-sendmsg.c: Removed.
5743         * pt-tcdrain.c: Removed.
5745 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
5747         * init.c (__pthread_initialize_minimal_internal): Renamed from
5748         __pthread_initialize_minimal.  Make old name an alias.  This
5749         converts a normal relocation into a relative relocation.
5751         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
5753         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
5754         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
5755         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
5756         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
5757         pt-sigwaitinfo, pt-waitid, and pt-writev.
5758         * pt-creat.c: Removed.
5759         * pt-poll.c: Removed.
5760         * pt-pselect.c: Removed.
5761         * pt-readv.c: Removed.
5762         * pt-select.c: Removed.
5763         * pt-sigpause.c: Removed.
5764         * pt-sigsuspend.c: Removed.
5765         * pt-sigwaitinfo.c: Removed.
5766         * pt-waitid.c: Removed.
5767         * pt-writev.c: Removed.
5769         * init.c (pthread_functions): New variable.
5770         (__pthread_initialize_minimal): Pass pointer to pthread_functions
5771         (or NULL) to __libc_pthread_init.
5772         * forward.c: Rewrite to use __libc:pthread_functions array to get
5773         function addresses.
5774         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
5775         prototype.
5776         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
5777         Take new parameter.  Copy content of variable pointed to by it
5778         to __libc_pthread_init.
5780         * pthreadP.h (struct pthread_functions): New type.
5781         (__libc_pthread_init): Declare.
5783         * pthread_attr_destroy.c: Add namespace protected alias.
5784         * pthread_attr_getdetachstate.c: Likewise.
5785         * pthread_attr_getinheritsched.c: Likewise.
5786         * pthread_attr_getschedparam.c: Likewise.
5787         * pthread_attr_getschedpolicy.c: Likewise.
5788         * pthread_attr_getscope.c: Likewise.
5789         * pthread_attr_setdetachstate.c: Likewise.
5790         * pthread_attr_setinheritsched.c: Likewise.
5791         * pthread_attr_setschedparam.c: Likewise.
5792         * pthread_attr_setschedpolicy.c: Likewise.
5793         * pthread_attr_setscope.c: Likewise.
5794         * pthread_cond_broadcast.c: Likewise.
5795         * pthread_cond_destroy.c: Likewise.
5796         * pthread_cond_init.c: Likewise.
5797         * pthread_cond_signal.c: Likewise.
5798         * pthread_cond_wait.c: Likewise.
5799         * pthread_condattr_destroy.c: Likewise.
5800         * pthread_condattr_init.c: Likewise.
5801         * pthread_equal.c: Likewise.
5802         * pthread_exit.c: Likewise.
5803         * pthread_getschedparam.c: Likewise.
5804         * pthread_self.c: Likewise.
5805         * pthread_setcancelstate.c: Likewise.
5806         * pthread_setschedparam.c: Likewise.
5807         * pthread_mutex_destroy.c: Likewise.
5808         * pthread_mutex_init.c: Likewise.
5809         * pthreadP.h: Add prototypes for the aliases.
5811         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
5812         multiple_threads member in correct TCB to 1.
5814         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
5815         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
5816         member of thread decriptor, otherwise return unconditionally 1.
5818 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
5820         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
5821         regular Linux version.  Remove file.
5822         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
5823         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
5824         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
5825         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
5826         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
5827         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
5828         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
5829         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
5830         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
5831         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
5832         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
5833         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
5834         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
5835         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
5836         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
5837         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
5838         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
5839         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
5840         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
5841         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
5842         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
5843         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
5844         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
5845         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
5846         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
5847         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
5848         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
5849         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
5850         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
5851         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
5853 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
5855         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
5856         * sysdeps/unix/sysv/linux/open.c: Removed.
5857         * sysdeps/unix/sysv/linux/fsync.c: Removed.
5858         * sysdeps/unix/sysv/linux/lseek.c: Removed.
5859         * sysdeps/unix/sysv/linux/msync.c: Removed.
5860         * sysdeps/unix/sysv/linux/read.c: Removed.
5861         * sysdeps/unix/sysv/linux/close.c: Removed.
5862         * sysdeps/unix/sysv/linux/creat.c: Removed.
5863         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
5864         * sysdeps/unix/sysv/linux/pause.c: Removed.
5865         * sysdeps/unix/sysv/linux/select.c: Removed.
5866         * sysdeps/unix/sysv/linux/write.c: Removed.
5868 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
5870         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
5871         element in TCB to see whether locking is needed.
5873         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
5874         MULTIPLE_THREADS_OFFSET value is correct.
5876         * sysdeps/unix/sysv/linux/close.c: New file.
5877         * sysdeps/unix/sysv/linux/connect.S: New file.
5878         * sysdeps/unix/sysv/linux/creat.c: New file.
5879         * sysdeps/unix/sysv/linux/fsync.c: New file.
5880         * sysdeps/unix/sysv/linux/llseek.c: New file.
5881         * sysdeps/unix/sysv/linux/lseek.c: New file.
5882         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
5883         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
5884         * sysdeps/unix/sysv/linux/msync.c: New file.
5885         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
5886         * sysdeps/unix/sysv/linux/open.c: New file.
5887         * sysdeps/unix/sysv/linux/open64.c: New file.
5888         * sysdeps/unix/sysv/linux/pause.c: New file.
5889         * sysdeps/unix/sysv/linux/poll.c: New file.
5890         * sysdeps/unix/sysv/linux/pread.c: New file.
5891         * sysdeps/unix/sysv/linux/pread64.c: New file.
5892         * sysdeps/unix/sysv/linux/pselect.c: New file.
5893         * sysdeps/unix/sysv/linux/pwrite.c: New file.
5894         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
5895         * sysdeps/unix/sysv/linux/readv.c: New file.
5896         * sysdeps/unix/sysv/linux/recv.S: New file.
5897         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
5898         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
5899         * sysdeps/unix/sysv/linux/select.c: New file.
5900         * sysdeps/unix/sysv/linux/send.S: New file.
5901         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
5902         * sysdeps/unix/sysv/linux/sendto.S: New file.
5903         * sysdeps/unix/sysv/linux/sigpause.c: New file.
5904         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
5905         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
5906         * sysdeps/unix/sysv/linux/sigwait.c: New file.
5907         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
5908         * sysdeps/unix/sysv/linux/system.c: New file.
5909         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
5910         * sysdeps/unix/sysv/linux/wait.c: New file.
5911         * sysdeps/unix/sysv/linux/waitid.c: New file.
5912         * sysdeps/unix/sysv/linux/waitpid.c: New file.
5913         * sysdeps/unix/sysv/linux/writev.c: New file.
5914         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
5916         * pt-readv.c: Fix comment.
5918 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
5920         * tst-cleanup1.c: Include stdlib.h.
5922         * tst-cancel5.c: New test.
5923         * Makefile (tests): Add tst-cancel5.
5924         (tst-cancel5): Link against libc.so libpthread.so in that order.
5926 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
5928         * forward.c (test_loaded): Prevent recursive calls.
5930         * Makefile (routines): Add libc-cancellation.
5931         * libc-cancellation.c: New file.
5932         * descr.h (struct pthread): Add multiple_threads field.
5933         * allocatestack.c (allocate_stack): Initialize multiple_header field of
5934         new thread descriptor to 1.
5935         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
5936         Initialize multiple_thread field after successful thread creation.
5937         * cancellation.c (__do_cancel): Move to pthreadP.h.
5938         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
5939         (__pthread_disable_asynccancel): Add internal_function attribute.
5940         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
5941         * pthread_setcancelstate.c: Likewise.
5942         * pthread_setcanceltype.c: Likewise.
5943         * pthread_exit.c: Likewise.
5944         * pthreadP.h (CANCELLATION_P): Likewise.
5945         (__do_cancel): Define as static inline.
5946         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
5947         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
5948         declarations.
5949         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
5950         fields.  Define MULTIPLE_THREADS_OFFSET.
5951         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
5952         declaration.
5953         * sysdeps/unix/sysv/linux/accept.S: New file.
5954         * sysdeps/unix/sysv/linux/read.c: New file.
5955         * sysdeps/unix/sysv/linux/write.c: New file.
5956         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
5957         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
5958         initialization of __libc_locking_needed.
5959         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
5960         __libc_locking_needed, use multiple_threads field in TCB.
5961         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
5963 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
5965         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
5966         version.
5967         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
5969         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
5970         access to __libc_locking_needed for PIC.
5972 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
5974         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
5975         declare for libc.so.
5976         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
5977         expression.
5978         (__libc_lock_lock): Put into statement expression.
5979         (__libc_lock_unlock): Remove trailing semicolon.
5980         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
5982 2002-12-12  Roland McGrath  <roland@redhat.com>
5984         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
5985         "m" constraint to refer to __libc_locking_needed.  Declare it here.
5987 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
5989         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
5990         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
5991         Initialize __libc_locking_needed.
5992         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
5993         instead of __register_pthread_fork_handler.
5994         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
5995         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
5996         fork-gen with libc_pthread_init.
5997         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
5998         of __register_pthread_fork_handler.
5999         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
6000         of __register_pthread_fork_handler.
6001         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
6002         __libc_locking_needed to determine whether lock prefix can be avoided.
6003         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6005 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
6007         * Makefile (tests): Add tst-cleanup1.
6008         * tst-cleanup1.c: New file.
6009         * cancellation.c (__cleanup_thread): Removed.
6010         (__do_cancel): Remove call to __cleanup_thread.
6011         * pthreadP.h: Remove __cleanup_thread prorotype.
6013         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6014         Remember function and argument even if cancellation handler
6015         function is not available.
6016         (__libc_cleanup_region_end): Execute registered function directly if
6017         pthread functions are not available.
6018         (__libc_cleanup_end): Likewise.
6020         * init.c (__pthread_initialize_minimal): Fix initialization in
6021         static lib by preventing gcc from being too clever.
6023 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
6025         * init.c (__pthread_initialize_minimal): Remove unneccesary
6026         sigaddset call.
6028         * Makefile (tests): We can run tst-locale2 now.
6030 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
6032         * Versions: Remove duplicated sigwait entry.
6034 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
6036         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
6037         inside libpthread.
6039         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
6041         * pthreadP.h: Declare __pthread_enable_asynccancel and
6042         __pthread_disable_asynccancel.
6043         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
6044         (CANCEL_RESET): Use __pthread_disable_asynccancel.
6045         * cancellation.c (__pthread_enable_asynccancel): New function.
6046         (__pthread_disable_asynccancel): New function.
6047         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
6048         * pt-close.c: Likewise.
6049         * pt-connect.c: Likewise.
6050         * pt-creat.c: Likewise.
6051         * pt-fcntl.c: Likewise.
6052         * pt-fsync.c: Likewise.
6053         * pt-lseek.c: Likewise.
6054         * pt-lseek64.c: Likewise.
6055         * pt-msgrcv.c: Likewise.
6056         * pt-msgsnd.c: Likewise.
6057         * pt-msync.c: Likewise.
6058         * pt-nanosleep.c: Likewise.
6059         * pt-open.c: Likewise.
6060         * pt-open64.c: Likewise.
6061         * pt-pause.c: Likewise.
6062         * pt-poll.c: Likewise.
6063         * pt-pread.c: Likewise.
6064         * pt-pread64.c: Likewise.
6065         * pt-pselect.c: Likewise.
6066         * pt-pwrite.c: Likewise.
6067         * pt-pwrite64.c: Likewise.
6068         * pt-read.c: Likewise.
6069         * pt-readv.c: Likewise.
6070         * pt-recv.c: Likewise.
6071         * pt-recvfrom.c: Likewise.
6072         * pt-recvmsg.c: Likewise.
6073         * pt-select.c: Likewise.
6074         * pt-send.c: Likewise.
6075         * pt-sendmsg.c: Likewise.
6076         * pt-sendto.c: Likewise.
6077         * pt-sigpause.c: Likewise.
6078         * pt-sigsuspend.c: Likewise.
6079         * pt-sigtimedwait.c: Likewise.
6080         * pt-sigwait.c: Likewise.
6081         * pt-sigwaitinfo.c: Likewise.
6082         * pt-system.c: Likewise.
6083         * pt-tcdrain.c: Likewise.
6084         * pt-wait.c: Likewise.
6085         * pt-waitid.c: Likewise.
6086         * pt-waitpid.c: Likewise.
6087         * pt-write.c: Likewise.
6088         * pt-writev.c: Likewise.
6089         * pthread_join.c: Likewise.
6090         * pthread_timedjoin.c: Likewise.
6092         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
6093         (__xpg_sigpause): New function.
6094         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
6096 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
6098         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
6100         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
6101         _GI_pthread_cleanup_pop to pthreadP.h.
6103         * ftrylockfile.c: Use _IO_lock_trylock instead of
6104         pthread_mutex_trylock.
6106         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
6107         (CANCEL_RESET): Likewise.
6108         (__pthread_setcanceltype_): Declare.
6109         (__pthread_mutex_lock_internal): Declare.
6110         (__pthread_mutex_unlock_internal): Declare.
6111         (__pthread_once_internal): Declare.
6112         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
6113         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
6115         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
6116         and pthread_mutex_unlock.
6117         * pthread_cond_wait.c: Likewise.
6118         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
6119         * pthread_mutex_unlock.c: Likewise.
6121         * pthread_setcanceltype.c: Add additional alias
6122         __pthread_setcanceltype.
6124         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
6125         * sem_open.c (sem_open): Likewise.
6126         Use __libc_open, __libc_write, and __libc_close instead of
6127         open, write, and close respectively.
6129         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
6130         Rewrite as statement expression since it must return a value.
6132         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
6133         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
6134         __pthread_kill.
6136         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
6137         alias __pthread_once_internal.
6139         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
6141 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
6143         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
6144         * tst-stdio1.c: New file.
6145         * tst-stdio2.c: New file.
6147         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
6149         * Makefile (tests): Comment out tst-locale2 for now.
6150         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
6152         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
6153         -D_IO_MTSAFE_IO.
6154         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
6155         Use _IO_lock_init instead of explicit assignment.
6157         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
6158         Define __libc_lock_* and __libc_lock_recursive macros with
6159         lowlevellock macros, not pthread mutexes.
6161         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
6162         of pthread_mutex_lock.
6163         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
6164         instead of pthread_mutex_unlock.
6166 2002-12-06  Roland McGrath  <roland@redhat.com>
6168         * allocatestack.c (__stack_user): Use uninitialized defn.
6169         * init.c (__pthread_initialize_minimal): Initialize it here.
6171 2002-12-05  Roland McGrath  <roland@redhat.com>
6173         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
6174         string.
6175         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
6177         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
6178         missing & here too.
6180 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
6182         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6183         lowlevellock.
6184         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
6185         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
6186         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
6187         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
6188         for __libc_lock_* macros.
6189         * Makefile (routines): Add libc-lowlevellock.
6191 2002-10-09  Roland McGrath  <roland@redhat.com>
6193         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
6194         Under [__PIC__], call the function via the pointer fetched for
6195         comparison rather than a call by name that uses the PLT.
6196         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
6197         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
6198         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
6199         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
6200         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
6202 2002-12-04  Roland McGrath  <roland@redhat.com>
6204         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
6206         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
6207         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
6209         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
6211 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6213         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
6214         a completely opaque, non-integer type.
6215         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6217 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
6219         * sysdeps/i386/tls.h: Include stdlib.h.
6220         * sysdeps/x86_64/tls.h: Likewise.
6222 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6224         * Makefile (tests): Add tst-locale2.
6225         (tests-static): Likewise.
6226         * tst-locale2.c: New file.
6228         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
6229         volatile and add memory clobbers to lock operations.
6231 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
6233         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
6234         * sysdeps/i386/i486/bits/atomic.h: New file.
6235         * sysdeps/i386/i586/bits/atomic.h: New file.
6236         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
6237         include i486 version.
6238         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
6239         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
6240         Patch by Marijn Ros <marijn@mad.scientist.com>.
6242         * allocatestack.c (get_cached_stack): Don't crash if we first
6243         found a stack with a larger size then needed.
6244         Reported by Hui Huang <hui.huang@sun.com>.
6246         * Makefile (tests): Add tst-sysconf.
6247         * tst-sysconf.c: New file.
6249         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
6250         PTHREAD_THREADS_MAX.
6252 2002-12-02  Roland McGrath  <roland@redhat.com>
6254         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
6255         Declare using hidden_proto instead of attribute_hidden, so there are
6256         non-.hidden static symbols for gdb to find.
6257         (__pthread_keys): Likewise.
6258         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
6259         * allocatestack.c (__stack_user): Likewise.
6260         * pthread_create.c (__pthread_keys): Likewise.
6261         (__nptl_threads_events, __nptl_last_event): Make these static instead
6262         of hidden.
6263         * pthread_key_create.c (__pthread_pthread_keys_max,
6264         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
6266 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
6268         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
6269         statically.
6270         * tst-locale1.c: New file.
6272         * pthread_cond_timedwait.c: Include <stdlib.h>.
6274         * Makefile (tests): Add tst-fork2 and tst-fork3.
6275         * tst-fork2.c: New file.
6276         * tst-fork3.c: New file.
6278 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
6280         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
6282         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
6283         require it to 200112L.
6285         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
6286         instruction only if HAVE_CMOV is defined.
6287         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
6289         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
6291         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
6293         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
6295         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
6297 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
6299         * sysdeps/x86_64/bits/atomic.h: New file.
6301         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
6302         16-bit operations.
6304         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
6305         possible since gettid cannot fail.
6307         * sysdeps/x86_64/pthreaddef.h: New file.
6309         * sysdeps/i386/pthreaddef.h (gettid): Removed.
6311         * sysdeps/x86_64/pthread_spin_init.c: New file.
6312         * sysdeps/x86_64/pthread_spin_lock.c: New file.
6313         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
6314         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
6316         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
6317         Add missing lock prefix.  Minute optimization.
6319         * tst-spin2.c (main): Also check successful trylock call.
6321         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
6322         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
6324         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
6325         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
6327         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
6328         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
6329         value in case of an error.  Add support for INTERNAL_SYSCALL.
6331         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
6332         value in case of an error.
6334         * sysdeps/x86_64/tls.h: New file.
6336 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6338         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
6339         takes the array member name and the index as parameters.
6340         (THREAD_SETMEM_NC): Likewise.
6341         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
6342         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
6343         interfaces.
6345         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
6346         to decide which code to use.
6347         (THREAD_SETMEM_NC): Likewise.
6349         * allocatestack.c (queue_stack): Don't remove stack from list here.
6350         Do it in the caller.  Correct condition to prematurely terminate
6351         loop to free stacks.
6352         (__deallocate_stack): Remove stack from list here.
6354 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6356         * Makefile (tests): Add tst-stack1.
6357         * tst-stack1.c: New file.
6359         * allocatestack.c (allocate_stack): Initialize the TCB on a user
6360         provided stack.
6362         * pthread_attr_getstack.c: Return bottom of the thread area.
6364 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
6366         * Makefile (libpthread-routines): Add pt-allocrtsig and
6367         pthread_kill_other_threads.
6368         * pt-allocrtsig.c: New file.
6369         * pthread_kill_other_threads.c: New file.
6370         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
6371         all three functions.
6372         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6373         allocrtsig.
6374         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
6375         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
6376         and __libc_allocate_rtsig_private.
6377         * Versions (libpthread): Export pthread_kill_other_threads_np,
6378         __libc_current_sigrtmin, and __libc_current_sigrtmax.
6380 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
6382         * allocatestack.c (allocate_stack): stackaddr in attribute points to
6383         the end of the stack.  Adjust computations.
6384         When mprotect call fails dequeue stack and free it.
6385         * pthread_attr_setstack.c: Store top of the stack in stackaddr
6386         attribute.
6387         * pthread_getattr_np.c: Likewise.
6389         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
6390         surprises.
6392 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
6394         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
6395         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6397 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
6399         * pthread_getspecific.c: Optimize access to first 2nd-level array.
6400         * pthread_setspecific.c: Likewise.
6402 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
6404         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
6405         definitions.  Get them from the official place.
6406         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
6408         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
6409         Use new CLONE_ flags in clone() calls.
6411         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
6412         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
6414         * Versions: Add pthread_* functions for libc.
6415         * forward.c: New file.
6417         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
6418         errno-loc.
6419         * herrno.c: New file.
6420         * res.c: New file.
6422         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
6423         sem_trywait, and sem_timedwait.  Add herrno and res.
6424         * sem_init.c: Don't initialize lock and waiters members.
6425         * sem_open.c: Likewise.
6426         * sem_post.c: Removed.
6427         * sem_wait.c: Removed.
6428         * sem_trywait.c: Removed.
6429         * sem_timedwait.c: Removed.
6430         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
6431         Includes full implementations of sem_post, sem_wait, sem_trywait,
6432         and sem_timedwait.
6433         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
6434         for new implementation.
6435         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
6436         and waiters fields.
6438         * tst-sem3.c: Improve error message.
6439         * tst-signal3.c: Likewise.
6441         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
6442         to tell the kernel about the termination futex and to initialize tid
6443         member.  Don't initialize main_thread.
6444         * descr.h (struct pthread): Remove main_thread member.
6445         * cancelllation.c (__do_cancel): Remove code handling main thread.
6446         The main thread is not special anymore.
6448         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
6449         size of the stacks to stack_cache_actsize.
6451         * pt-readv.c: Add missing "defined".
6452         * pt-sigwait.c: Likewise.
6453         * pt-writev.c: Likewise.
6455 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
6457         * Versions: Export __connect from libpthread.
6458         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6460         * Makefile (libpthread-routines): Add pt-raise.
6461         * sysdeps/unix/sysv/linux/raise.c: New file.
6462         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
6463         * sysdeps/generic/pt-raise.c: New file.
6465         * pthread_cond_init.c: Initialize all data elements of the condvar
6466         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6468         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
6469         * pthread_create.c: Likewise.
6471         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
6472         * tst-key1.c: New file.
6473         * tst-key2.c: New file.
6474         * tst-key3.c: New file.
6476         * Versions: Export pthread_detach for version GLIBC_2.0.
6477         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
6479 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
6481         * pthread_key_create.c: Terminate search after an unused key was found.
6482         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6484         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
6485         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6487 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
6489         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
6490         dynamic lookup for errno in PIC.
6492         * allocatestack.c (get_cached_stack): Rearrange code slightly to
6493         release the stack lock as soon as possible.
6494         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
6495         the static TLS block.
6496         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
6498         * cancellation.c: Renamed from cancelation.c.
6499         * Makefile: Adjust accordingly.
6500         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
6501         * cleanup_defer.c: Use CANCELLATION_P.
6502         * pthread_testcancel.c: Likewise.
6503         * descr.h: Fix spelling in comments.
6504         * init.c: Likewise.
6505         * pthread_getattr_np.c: Likewise.
6506         * pthread_getschedparam.c: Likewise.
6507         * pthread_setschedparam.c: Likewise.
6508         * Versions: Likewise.
6510         * pt-pselect.c: New file.
6511         * Makefile (libpthread-routines): Add pt-pselect.
6512         * Versions: Add pselect.
6514         * tst-cancel4.c: New file.
6515         * Makefile (tests): Add tst-cancel4.
6517 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
6519         * pthread_mutex_lock.c: Always record lock ownership.
6520         * pthread_mutex_timedlock.c: Likewise.
6521         * pthread_mutex_trylock.c: Likewise.
6523         * pt-readv.c: New file.
6524         * pt-writev.c: New file.
6525         * pt-creat.c: New file.
6526         * pt-msgrcv.c: New file.
6527         * pt-msgsnd.c: New file.
6528         * pt-poll.c: New file.
6529         * pt-select.c: New file.
6530         * pt-sigpause.c: New file.
6531         * pt-sigsuspend.c: New file.
6532         * pt-sigwait.c: New file.
6533         * pt-sigwaitinfo.c: New file.
6534         * pt-waitid.c: New file.
6535         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
6536         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
6537         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
6538         * Versions: Add all the new functions.
6540         * tst-exit1.c: New file.
6541         * Makefile (tests): Add tst-exit1.
6543         * sem_timedwait.c: Minor optimization for more optimal fastpath.
6545 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
6547         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
6549         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
6550         call.  pthread_join is an official cancellation point.
6551         * pthread_timedjoin.c: Likewise.
6553         * pthread_cond_wait.c: Revert order in which internal lock are dropped
6554         and the condvar's mutex are retrieved.
6555         * pthread_cond_timedwait.c: Likewise.
6556         Reported by dice@saros.East.Sun.COM.
6558 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
6560         * pthreadP.h: Cut out all type definitions and move them...
6561         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
6562         * pthreadP.h: Include <internaltypes.h>.
6564         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
6565         performance tweaks.
6567         * sem_trywait.c: Shuffle #includes around to get right order.
6568         * sem_timedwait.c: Likewise.
6569         * sem_post.c: Likewise.
6570         * sem_wait.c: Likewise.
6572         * nptl 0.3 released.
6574         * Makefile (tests): Add tst-signal3.
6575         * tst-signal3.c: New file.
6577 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
6579         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
6580         the asms modify the sem object.
6581         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
6583         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
6584         the actual members.
6585         * pthreadP.h (struct sem): New type.  Actual semaphore type.
6586         * semaphoreP.h: Include pthreadP.h.
6587         * sem_getvalue.c: Adjust to sem_t change.
6588         * sem_init.c: Likewise.
6589         * sem_open.c: Likewise.
6590         * sem_post.c: Likewise.
6591         * sem_timedwait.c: Likewise.
6592         * sem_trywait.c: Likewise.
6593         * sem_wait.c: Likewise.
6595 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
6597         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
6598         * tst-basic2.c: New file.
6599         * tst-exec1.c: New file.
6600         * tst-exec2.c: New file.
6601         * tst-exec3.c: New file.
6603         * tst-fork1.c: Remove extra */.
6605         * nptl 0.2 released.  The API for IA-32 is complete.