Update.
[kopensolaris-gnu/glibc.git] / nptl / ChangeLog
1 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
2
3         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4         internal use.
5         * allocatestack.c (__nptl_setxid): New function.
6         * descr.h (struct xid_command): Define type.
7         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
8         (sighandler_setxid): New function.
9         (__pthread_initialize_minimal): Register sighandler_setxid for
10         SIGCANCEL.
11         * pt-allocrtsig.c: Update comment.
12         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
13         Declare __nptl_setxid.
14         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
15         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
16         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
17         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
18         and pthread_setresuid_np.
19         * pthread_setgid_np.c: New file.
20         * pthread_setuid_np.c: New file.
21         * pthread_setegid_np.c: New file.
22         * pthread_seteuid_np.c: New file.
23         * pthread_setregid_np.c: New file.
24         * pthread_setreuid_np.c: New file.
25         * pthread_setresgid_np.c: New file.
26         * pthread_setresuid_np.c: New file.
27         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
28         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
29         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
30         and pthread_setresuid_np.
31         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
32         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
33         pthread_setregid, and pthread_setresgid.
34
35 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
36
37         * allocatestack.c (allocate_stack): Return EAGAIN instead of
38         ENOMEM when out of memory.
39
40 2004-09-10  Roland McGrath  <roland@redhat.com>
41
42         [BZ #379]
43         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
44         code, since we don't try to use the broken CLONE_STOPPED any more.
45         * pthread_create.c (start_thread): Likewise.
46
47 2004-09-15  Richard Henderson  <rth@redhat.com>
48
49         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
50
51 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
52
53         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
54         (__libc_unwind_longjmp): Delete macro and declare as function.
55         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
56         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
57         nptl directory.
58         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
59         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
60         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
61
62 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
63
64         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
65         for __USE_XOPEN2K.
66         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
67         types also for __USE_XOPEN2K.
68         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
69         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
70         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
71         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
72         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
73         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
74         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
75         [BZ #320]
76
77 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
78
79         * sysdeps/pthread/pthread.h
80         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
81         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
82         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
83         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
84         [BZ #375]
85
86 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
87
88         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
89         PSEUDO to be used with . prefix.
90
91         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
92         Use atomic_increment instead of atomic_exchange_and_add.
93         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
94         Likewise.
95         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
96         Likewise.
97         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
98         Likewise.
99
100         * allocatestack.c (allocate_stack): Use atomic_increment_val
101         instead of atomic_exchange_and_add.
102         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
103         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
104         Likewise.
105         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
106         Likewise.
107
108         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
109         the initialization function might throw.
110
111 2005-09-05  Richard Henderson  <rth@redhat.com>
112
113         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
114         Move definition inside libpthread, libc, librt check.  Provide
115         definition for rtld.
116
117 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
118
119         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
120         * sysdeps/i386/jmpbuf-unwind.h: Likewise
121         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
122         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
123         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
124         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
125         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
126         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
127         * unwind.c: Use it.
128
129         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
130         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
131         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
132         Likewise.
133         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
134         Decrement __nwaiters.  If pthread_cond_destroy has been called and
135         this is the last waiter, signal pthread_cond_destroy caller and
136         avoid using the pthread_cond_t structure after unlock.
137         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
139         Read clock type from the least significant bits of __nwaiters instead
140         of __clock.
141         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
142         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
143
144 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
145
146         [BZ #342]
147         * Makefile (tests): Add tst-cond20 and tst-cond21.
148         * tst-cond20.c: New test.
149         * tst-cond21.c: New test.
150         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
151         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
152         it unsigned int.
153         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
154         Likewise.
155         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
156         (pthread_cond_t): Likewise.
157         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
158         Likewise.
159         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
160         Likewise.
161         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
162         Likewise.
163         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
164         (cond_nwaiters): New.
165         (clock_bits): New.
166         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
167         if there are waiters not signalled yet.
168         Wait until all already signalled waiters wake up.
169         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
170         __nwaiters.  If pthread_cond_destroy has been called and this is the
171         last waiter, signal pthread_cond_destroy caller and avoid using
172         the pthread_cond_t structure after unlock.
173         (__pthread_cond_wait): Increment __nwaiters in the beginning,
174         decrement it when leaving.  If pthread_cond_destroy has been called
175         and this is the last waiter, signal pthread_cond_destroy caller.
176         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
177         Likewise.  Read clock type from the least significant bits of
178         __nwaiters instead of __clock.
179         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
180         whether clock ID can be encoded in COND_CLOCK_BITS bits.
181         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
182         clock type just from the last COND_CLOCK_BITS bits of value.
183         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
184         instead of __clock, just from second bit of condattr's value.
185
186 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
187
188         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
189         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
190         != 64.
191         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
192
193 2004-08-15  Roland McGrath  <roland@frob.com>
194
195         * pthread_atfork.c: Update copyright terms including special exception
196         for these trivial files, which are statically linked into executables
197         that use dynamic linking for the significant library code.
198
199 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
200
201         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
202         pthread_rwlock_rdlock.
203         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
204         Decrease __nr_readers_queued after reacquiring lock.
205         * sysdeps/pthread/pthread_rwlock_timedrdlock
206         (pthread_rwlock_timedrdlock): Likewise.
207         Reported by Bob Cook <bobcook47@hotmail.com>.
208
209 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
210
211         * tst-rwlock14.c (tf): Read main thread handle from *ARG
212         before pthread_barrier_wait.
213
214 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
215
216         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
217         Remove unnecessary exception handling data.
218
219 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
220
221         [BZ #284]
222         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
223         instead of clockid_t.
224
225 2004-07-21  Roland McGrath  <roland@redhat.com>
226
227         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
228
229 2004-07-19  Roland McGrath  <roland@redhat.com>
230
231         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
232
233 2004-07-02  Roland McGrath  <roland@redhat.com>
234
235         * configure: Don't exit.
236
237 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
238
239         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
240         (__pthread_cond_timedwait): Check for invalid nanosecond in
241         timeout value.
242
243 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
244
245         * Makefile: Add rules to build and run tst-fini1.
246         * tst-fini1.c: New file.
247         * tst-fini1mod.c: New file.
248
249 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
250
251         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
252         if no cancellation support is needed.
253         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
254         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
255         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
256         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
257         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
258         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
259         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
260         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
261         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
262
263         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
264         only if not already defined.
265
266 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
267
268         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
269         constraint "m" instead of "0" for futex.
270
271         * shlib-versions: Add powerpc64-.*-linux.*.
272
273 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
274
275         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
276         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
277         for valid tv_nsec.
278         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
279         1 billion and 64-bit tv_nsec which is valid when truncated to 32
280         bits.
281
282 2004-06-29  Roland McGrath  <roland@redhat.com>
283
284         * Banner: NPTL no longer has its own version number.
285         * Makefile (nptl-version): Variable removed.
286         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
287         using $(version), the glibc version number.
288
289 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
290
291         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
292         Fix branch offset for a PLT entry.
293         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
294         Likewise.
295         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
296         Likewise.
297         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
298         Likewise.
299         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
300         Likewise.
301
302 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
303
304         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
305         unconditionally.
306
307 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
308
309         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
310         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
311         instead of tv_sec.
312         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
313         (pthread_rwlock_timedrdlock): Likewise.
314
315 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
316
317         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
318         Set __r7 to val, not mutex.
319
320 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
321
322         * Makefile: Add rules to build tst-rwlock14.
323         * tst-rwlock14.c: New file.
324
325 2004-06-24  Boris Hu  <boris.hu@intel.com>
326
327         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
328         check.
329         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
330
331 2004-06-19  Andreas Jaeger  <aj@suse.de>
332
333         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
334         assembler in last patch.
335
336 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
337
338         * sysdeps/pthread/pthread_cond_timedwait.c
339         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
340         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
341         (__pthread_cond_timedwait): Check for invalid nanosecond in
342         timeout value.
343         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
344         * tst-cond19.c: New file.
345         * Makefile: Add rules to build and run tst-cond19.
346
347 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
348
349         * tst-context1.c (GUARD_PATTERN): Defined.
350         (tst_context_t): Define struct containing ucontext_t & guard words.
351         (ctx): Declare as an array of tst_context_t.
352         (fct): Verify uc_link & guard words are still valid.
353         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
354
355 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
356
357         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
358         Add __data.__futex field, reshuffle __data.__clock.
359         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
360         (__pthread_cond_signal): Increment __futex at the same time as
361         __wakeup_seq or __total_seq.  Pass address of __futex instead of
362         address of low 32-bits of __wakeup_seq to futex syscall.
363         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
364         (__pthread_cond_wait): Likewise.  Pass __futex value from before
365         releasing internal lock to FUTEX_WAIT.
366         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
367         (__pthread_cond_timedwait): Likewise.
368         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
369         (FUTEX_CMP_REQUEUE): Define.
370         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
371         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
372         Pass __futex value from before the unlock and __futex address instead
373         of address of low 32-bits of __wakeup_seq to futex syscall.
374         Fallback to FUTEX_WAKE all on any errors.
375
376 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
377
378         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
379         comment typo.
380         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
381         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
382         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
383         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
384         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
385
386 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
387
388         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
389         Add memory clobber to inline assembly.
390         (__lll_mutex_trylock): Likewise.
391         (__lll_mutex_cond_trylock): Likewise.
392
393 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
394
395         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
396         Pass val argument as 6th system call argument in %r7.
397
398 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
399
400         * Makefile (tests): Add tst-cond16.
401         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
402         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
403         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
404         Add __data.__futex field, reshuffle __data.__clock.
405         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
406         (__pthread_cond_signal): Increment __futex at the same time as
407         __wakeup_seq or __total_seq.  Pass address of __futex instead of
408         address of low 32-bits of __wakeup_seq to futex syscall.
409         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
410         (__pthread_cond_wait): Likewise.  Pass __futex value from before
411         releasing internal lock to FUTEX_WAIT.
412         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
413         (__pthread_cond_timedwait): Likewise.
414         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
415         (FUTEX_CMP_REQUEUE): Define.
416         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
417         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
418         Pass __futex value from before the unlock and __futex address instead
419         of address of low 32-bits of __wakeup_seq to futex syscall.
420         Fallback to FUTEX_WAKE all on any errors.
421         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
422         Define.
423         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
424         internally.  Return non-zero if error, zero if success.
425         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
426         Add __data.__futex field, reshuffle __data.__clock.
427         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
428         Define.
429         (lll_futex_requeue): Add val argument, return 1 unconditionally
430         for the time being.
431         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
432         Add __data.__futex field, reshuffle __data.__clock.
433         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
434         Define.
435         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
436         internally.  Return non-zero if error, zero if success.
437         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
438         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
439         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
440         Define.
441         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
442         internally.  Return non-zero if error, zero if success.
443         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
444         Add __data.__futex field, reshuffle __data.__clock.
445         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
446         Define.
447         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
448         internally.  Return non-zero if error, zero if success.
449         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
450         Add __data.__futex field, reshuffle __data.__clock.
451         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
452         Add __data.__futex field, reshuffle __data.__clock.
453         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
454         Increment __futex at the same time as __wakeup_seq or __total_seq.
455         Pass address of __futex instead of address of low 32-bits of
456         __wakeup_seq to futex syscall.
457         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
458         Pass __futex value from before releasing internal lock
459         to FUTEX_WAIT.
460         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
461         Likewise.  Avoid unnecessary shadowing of variables.
462         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
463         Set __futex to 2 * __total_seq.  Pass __futex value from before the
464         unlock and __futex address instead of address of low 32-bits of
465         __wakeup_seq to futex_requeue macro, adjust for new return value
466         meaning.
467         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
468         (__pthread_cond_signal): Increment __futex at the same time as
469         __wakeup_seq or __total_seq.  Pass address of __futex instead of
470         address of low 32-bits of __wakeup_seq to futex syscall.
471         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
472         (__pthread_cond_wait): Likewise.  Pass __futex value from before
473         releasing internal lock to FUTEX_WAIT.
474         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
475         (__pthread_cond_timedwait): Likewise.
476         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
477         (FUTEX_CMP_REQUEUE): Define.
478         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
479         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
480         Pass __futex value from before the unlock and __futex address instead
481         of address of low 32-bits of __wakeup_seq to futex syscall.
482         Fallback to FUTEX_WAKE all on any errors.
483
484 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
485
486         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
487         Add nop to align the end of critical section.
488         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
489
490 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
491
492         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
493         Add __broadcast_seq field.
494         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
495         all waiters as woken with woken_seq and bump broadcast counter.
496         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
497         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
498         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
499         Comment typo fixes.  Avoid returning -ETIMEDOUT.
500
501 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
502
503         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
504         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
505         Reported by Kaz Kojima.
506
507 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
508
509         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
510
511 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
512
513         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
514         __broadcast_seq with bc_seq after acquiring internal lock instead of
515         before it.
516
517 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
518
519         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
520         compilation.
521         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
522         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
523         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
524         (pthread_cond_t): Add __data.__broadcast_seq field.
525         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
526         (FRAME_SIZE): Define.
527         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
528         Comment typo fixes.
529         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
530         Define.
531         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
532         typo fixes.
533         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
534         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
535         fixes.
536
537 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
538
539         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
540         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
541         Add __broadcast_seq field.
542         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
543         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
544         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
545         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
546         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
547         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
548         all waiters as woken with woken_seq and bump broadcast counter.
549         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
550         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
551         __broadcast_seq field.
552         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
553         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
554         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
555         * pthread_cond_init.c: Initialize __broadcast_seq field.
556         * Makefile (tests): Add tst-cond17 and tst-cond18.
557         Add .NOTPARALLEL goal.
558         * tst-cond16.c: New file.  From Jakub.
559         * tst-cond17.c: New file.  From Jakub.
560         * tst-cond18.c: New file.  From Jakub.
561
562 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
563
564         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
565         unwind info.
566
567         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
568         Parametrize frame size.  Correct some unwind info.
569         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
570
571 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
572
573         * tst-stack3.c: Note testing functionality beyond POSIX.
574
575 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
576
577         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
578         Change conditional from ifdef to if.
579
580 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
581
582         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
583         SYSDEP_CANCEL_ERROR): Define.
584         (PSEUDO): Use it.
585
586 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
587
588         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
589
590 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
591
592         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
593
594 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
595
596         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
597         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
598         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
599         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
600
601 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
602
603         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
604         thread has all signals blocked.
605
606 2004-04-18  Andreas Jaeger  <aj@suse.de>
607
608         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
609         (SEM_VALUE_MAX): Add missing brace.
610
611 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
612
613         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
614         in rt subdir.
615         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
616         * sysdeps/pthread/tst-mqueue8x.c: New test.
617         * tst-cancel4.c: Update comment about message queues.
618
619         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
620         return it_value { 0, 0 }.
621         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
622         like SIGEV_SIGNAL.
623         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
624         assertion for SIGEV_NONE.
625         (thread_attr_compare): Compare all attributes, not just a partial
626         subset.
627
628 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
629
630         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
631
632 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
633
634         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
635         Just use a plain number.
636         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
637         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
638         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
639         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
640         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
641         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
642         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
643
644 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
645
646         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
647         frame info.
648         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
649
650 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
651
652         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
653         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
654         of calling sigwaitinfo.
655
656 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
657
658         * allocatestack.c (allocate_stack): Set reported_guardsize
659         unconditionally.
660         * pthread_getattr_np.c (pthread_getattr_np): Use
661         reported_guardsize instead of guardsize.
662         * descr.h (struct pthread): Add reported_guardsize field.
663
664 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
665
666         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
667
668 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
669
670         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
671
672 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
673
674         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
675         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
676         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
677         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
678         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
679         Define.
680         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
681         (_POSIX_MESSAGE_PASSING): Define.
682         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
683         (_POSIX_MESSAGE_PASSING): Define.
684         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
685         (_POSIX_MESSAGE_PASSING): Define.
686
687 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
688
689         * tst-context1.c (fct): Check whether correct stack is used.
690
691 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
692
693         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
694         matching constraints for asm mem parameters.
695
696         * tst-clock2.c (tf): Don't define unless needed.
697
698 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
699
700         * Makefile (link-libc-static): Use $(static-gnulib) instead of
701         $(gnulib).
702
703 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
704
705         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
706         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
707         * pthreadP.h: Declare __nptl_deallocate_tsd.
708         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
709         Adjust caller.
710
711         * Makefile (tests): Add tst-tsd5.
712         * tst-tsd5.c: New file.
713
714 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
715
716         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
717         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
718         is SHLIB_COMPAT check.
719         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
720         (__pthread_attr_getaffinity_old): Likewise.
721         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
722         (__pthread_getaffinity_old): Likewise.
723         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
724         (__pthread_setaffinity_old): Likewise.
725
726 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
727
728         * allocatestack.c (_make_stacks_executable): Call
729         _dl_make_stack_executable first.
730
731 2004-03-24  Roland McGrath  <roland@redhat.com>
732
733         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
734         constraint instead of "0".
735
736 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
737
738         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
739         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
740
741         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
742         code to avoid warning.
743
744 2004-03-24  Andreas Jaeger  <aj@suse.de>
745
746         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
747         (__pthread_attr_setaffinity_old): Remove const.
748
749 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
750
751         * sysdeps/unix/sysv/linux/smp.h: New file.
752         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
753         * init.c: Define __is_smp.
754         (__pthread_initialize_minimal_internal): Call is_smp_system to
755         initialize __is_smp.
756         * pthreadP.h: Declare __is_smp.
757         Define MAX_ADAPTIVE_COUNT is necessary.
758         * pthread_mutex_init.c: Add comment regarding __spins field.
759         * pthread_mutex_lock.c: Implement adaptive mutex type.
760         * pthread_mutex_timedlock.c: Likewise.
761         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
762         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
763         Add __spins field.
764         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
765         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
766         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
767         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
768         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
769         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
770         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
771         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
772         lll_mutex_cond_trylock.
773         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
774         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
775         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
776         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
777         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
778         Define BUSY_WAIT_NOP.
779         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
780         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
781
782         * tst-mutex5.c: Add support for testing adaptive mutexes.
783         * tst-mutex7.c: Likewise.
784         * tst-mutex5a.c: New file.
785         * tst-mutex7a.c: New file.
786         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
787
788         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
789         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
790         vgettimeofday call might destroy the content.
791
792         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
793         @pause in the loop.
794
795         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
796         No need to restrict type of ret.  Make it int.  Add comment.
797
798         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
799         Remove unnecessary setne instruction.
800
801 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
802
803         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
804         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
805         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
806         If realloc fails, break out of the loop.
807
808 2004-03-20  Andreas Jaeger  <aj@suse.de>
809
810         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
811         (__pthread_setaffinity_old): Fix interface.
812         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
813         (__pthread_getaffinity_old): Likewise.
814
815         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
816         (__pthread_setaffinity_new): Remove duplicate declaration.
817
818 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
819
820         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
821         the return value to a safe register.
822         (CDISABLE): Set the function argument correctly.
823
824 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
825
826         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
827         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
828         Rewrite so that only one locked memory operation per round is needed.
829         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
830         (pthread_barrier_wait): After wakeup, release lock only when the
831         last thread stopped using the barrier object.
832         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
833         (__pthread_cond_wait): Don't store mutex address if the current
834         value is ~0l.  Add correct cleanup support and unwind info.
835         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
836         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
837         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
838         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
839         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
840         Add correct cleanup support and unwind info.
841         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
842         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
843         information for syscall wrappers.
844
845 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
846
847         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
848         cpusetsize field, remove next.
849         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
850         parameter for size of the CPU set.
851         (pthread_setaffinity_np): Likewise.
852         (pthread_attr_getaffinity_np): Likewise.
853         (pthread_attr_setaffinity_np): Likewise.
854         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
855         interface change, keep compatibility code.
856         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
857         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
858         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
859         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
860         __pthread_getaffinity_np.
861         * Versions: Add version for changed interfaces.
862         * tst-attr3.c: Adjust test for interface change.
863         * pthread_getattr_np.c: Query the kernel about the affinity mask with
864         increasing buffer sizes.
865         * pthread_attr_destroy.c: Remove unused list handling.
866         * pthread_attr_init.c: Likewise.
867
868 2004-03-17  Roland McGrath  <roland@redhat.com>
869
870         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
871         first argument to clock_getres so we ever enable kernel timers.
872
873 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
874
875         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
876
877 2004-03-12  Richard Henderson  <rth@redhat.com>
878
879         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
880         oldvalue from CENABLE to CDISABLE.
881
882 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
883
884         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
885         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
886         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
887         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
888
889 2004-03-11  Richard Henderson  <rth@redhat.com>
890
891         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
892         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
893         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
894
895 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
896
897         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
898         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
899         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
900
901 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
902
903         * forward.c (__pthread_cond_broadcast_2_0,
904         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
905         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
906         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
907
908 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
909
910         * sysdeps/sh/tcb-offsets.sym: Add PID.
911         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
912         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
913
914 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
915
916         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
917         include <sysdep-cancel.h>, vfork is no cancellation point.
918         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
919         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
920         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
921
922 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
923
924         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
925         libc_hidden_def.
926         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
927         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
928         Likewise.
929         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
930         Likewise.
931         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
932         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
933         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
934         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
935         of DO_CALL_VIA_BREAK.  Work around a gas problem.
936
937         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
938         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
939         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
940         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
941         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
942         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
943
944         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
945         a local register for saving old PID.  Negate PID in parent upon exit.
946
947         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
948         tcb-offsets.h.
949         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
950         before syscall, set to the old value in the parent afterwards.
951         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
952         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
953         tcb-offsets.h.
954         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
955         before syscall, set to the old value in the parent afterwards.
956         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
957         * sysdeps/s390/tcb-offsets.sym: Add PID.
958
959         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
960         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
961         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
962         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
963         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
964         * sysdeps/sparc/tcb-offsets.sym: Add PID.
965
966 2004-03-10  Andreas Schwab  <schwab@suse.de>
967
968         * sysdeps/ia64/tcb-offsets.sym: Add PID.
969         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
970         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
971
972 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
973
974         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
975         * tst-cancel21.c (do_one_test): Likewise.
976         Reported by Gordon Jin <gordon.jin@intel.com>.
977
978 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
979
980         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
981         if non-zero and set to INT_MIN if zero.
982         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
983         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
984         (SAVE_PID, RESTORE_PID): Define.
985         (__vfork): Use it.
986         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
987         Use relative path to avoid including NPTL i386/vfork.S.
988         (SAVE_PID, RESTORE_PID): Define.
989         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
990         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
991         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
992         tst-vfork2x.
993         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
994         * tst-vfork1.c: New test.
995         * tst-vfork2.c: New test.
996         * tst-vfork1x.c: New test.
997         * tst-vfork2x.c: New test.
998
999 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
1000
1001         * sysdeps/i386/tcb-offsets.sym: Add PID.
1002         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1003         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
1004         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
1005
1006 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
1007
1008         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
1009
1010 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1011
1012         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1013         _rtld_global_ro.
1014
1015 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
1016
1017         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1018         _rtld_global_ro.
1019
1020         * tst-once4.c: Remove unnecessary macro definition.
1021
1022         * tst-mutex7.c (do_test): Limit thread stack size.
1023         * tst-once2.c (do_test): Likewise.
1024         * tst-tls3.c (do_test): Likewise.
1025         * tst-tls1.c (do_test): Likewise.
1026         * tst-signal3.c (do_test): Likewise.
1027         * tst-kill6.c (do_test): Likewise.
1028         * tst-key4.c (do_test): Likewise.
1029         * tst-join4.c (do_test): Likewise.
1030         * tst-fork1.c (do_test): Likewise.
1031         * tst-context1.c (do_test): Likewise.
1032         * tst-cond2.c (do_test): Likewise.
1033         * tst-cond10.c (do_test): Likewise.
1034         * tst-clock2.c (do_test): Likewise.
1035         * tst-cancel10.c (do_test): Likewise.
1036         * tst-basic2.c (do_test): Likewise.
1037         * tst-barrier4.c (do_test): Likewise.
1038
1039 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
1040
1041         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
1042
1043 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
1044
1045         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1046         (__pthread_cond_timedwait): Optimize wakeup test.
1047         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1048         (__pthread_cond_wait): Likewise.
1049         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1050         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1051         Likewise.
1052
1053 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
1054
1055         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1056         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
1057         the atomic instruction needed.
1058         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1059         (__lll_mutex_lock_wait): Likewise.
1060
1061 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
1062
1063         * Makefile (tests): Add tst-cond14 and tst-cond15.
1064         * tst-cond14.c: New file.
1065         * tst-cond15.c: New file.
1066
1067 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
1068
1069         * sysdeps/pthread/createthread.c (create_thread): Remove use of
1070         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
1071         needs to be implemented differently to be useful.
1072
1073 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
1074
1075         * pthread_attr_setschedparam.c: Don't test priority against limits
1076         here.  Set ATTR_FLAG_SCHED_SET flag.
1077         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
1078         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
1079         from parent thread to child.  If attribute is used and scheduling
1080         parameters are not inherited, copy parameters from attribute or
1081         compute them.  Check priority value.
1082         * pthread_getschedparam.c: If the parameters aren't known yet get
1083         them from the kernel.
1084         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
1085         ATTR_FLAG_POLICY_SET flag for thread.
1086         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
1087         and ATTR_FLAG_POLICY_SET.
1088
1089         * sysdeps/pthread/createthread.c: Use tgkill if possible.
1090
1091         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
1092         fail if stack address hasn't been set.  Just return 0.
1093
1094 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
1095
1096         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
1097         libpthread for the files in this list.
1098         (CFLAGS-tst-unload): Removed.
1099         * tst-unload.c (do_test): Don't use complete path for
1100         LIBPHREAD_SO.
1101
1102         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
1103         tst-_res1mod2.
1104
1105 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
1106
1107         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1108         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
1109         operation per round is needed.
1110         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1111         (__lll_mutex_lock_wait): Likewise.
1112
1113 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
1114
1115         * tst-cancel9.c (cleanup): Don't print to stderr.
1116
1117 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1118
1119         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
1120
1121 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1122
1123         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1124         (__syscall_error_handler2): Call CDISABLE.
1125         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1126         (__syscall_error_handler2): Call CDISABLE.
1127
1128         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1129         Release lock before the loop, don't reacquire it.
1130
1131         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
1132
1133 2004-02-19  Andreas Schwab  <schwab@suse.de>
1134
1135         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1136         Fix last change.
1137
1138 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
1139
1140         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1141         (pthread_barrier_wait): After wakeup, release lock only when the
1142         last thread stopped using the barrier object.
1143         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
1144         (pthread_barrier_wait): Likewise.
1145         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1146         Likewise.
1147         * Makefile (tests): Add tst-barrier4.
1148         * tst-barrier4.c: New file.
1149
1150         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1151         (__pthread_cond_timedwait): Perform timeout test while holding
1152         internal lock to prevent wakeup race.
1153         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1154         * sysdeps/pthread/pthread_cond_timedwait.c
1155         (__pthread_cond_timedwait): Likewise.
1156         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1157         (__pthread_cond_timedwait): Likewise.
1158
1159 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
1160
1161         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
1162         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
1163         * Makefile (tests): Add tst-rwlock13.
1164         * tst-rwlock13.c: New test.
1165
1166 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
1167
1168         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1169         (__condvar_tw_cleanup): Little optimization.
1170         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1171
1172 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
1173
1174         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
1175         libpthread as "lib" parameter to SHLIB_COMPAT.
1176         (__novmx_siglongjmp): Fix typo in function name.
1177         (__novmx_longjmp): Fix typo in function name.
1178
1179 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1180
1181         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
1182         __builtin_expect.
1183
1184         * sysdeps/generic/pt-longjmp.c: Moved to...
1185         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
1186
1187 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
1188
1189         * Makefile (libpthread-routines): Add pt-cleanup.
1190         * pt-longjmp.c: Removed.
1191         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1192         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1193         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1194         Version longjmp, siglongjmp for GLIBC_2.3.4.
1195         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1196
1197 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1198
1199         * sysdeps/pthread/pthread_cond_timedwait.c
1200         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1201         Reuse code.  Add __builtin_expects.
1202
1203         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1204         (__pthread_cond_timedwait): Get internal lock in case timeout has
1205         passed before the futex syscall.
1206         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1207
1208 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1209
1210         * allocatestack.c: Pretty printing.
1211
1212         * sysdeps/pthread/createthread.c (create_thread): Don't add
1213         CLONE_DETACHED bit if it is not necessary.
1214
1215 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1216
1217         * pthread_getattr_np.c: Include ldsodefs.h.
1218
1219 2004-01-16  Richard Henderson  <rth@redhat.com>
1220
1221         * allocatestack.c: Don't declare __libc_stack_end.
1222         * init.c (__pthread_initialize_minimal_internal): Likewise.
1223         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1224
1225 2004-01-15  Richard Henderson  <rth@redhat.com>
1226
1227         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1228         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1229         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1230         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1231         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1232         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1233         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1234         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1235
1236 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1237
1238         * init.c (pthread_functions): Make array const.
1239
1240 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1241
1242         * allocatestack.c (__make_stacks_executable): Change interface.
1243         Check parameters.  Pass parameter on to libc counterpart.
1244         * pthreadP.h: Change declaration.
1245
1246 2004-01-13  Richard Henderson  <rth@redhat.com>
1247
1248         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1249         prototype form.
1250         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1251         Likewise.
1252
1253         * sysdeps/alpha/Makefile: New file.
1254         * sysdeps/alpha/tcb-offsets.sym: New file.
1255         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1256         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
1257
1258         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
1259         on powerpc version.
1260
1261 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
1262
1263         * Makefile (tests): Add tst-backtrace1.
1264         * tst-backtrace1.c: New test.
1265
1266 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
1267
1268         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
1269         register as second parameter to the REGISTER macro.
1270         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
1271         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
1272         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
1273         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
1274         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
1275         of thread register as second parameter to REGISTER macro in 64 case.
1276
1277 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
1278
1279         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
1280         (CFLAGS-getpid.o): Defined.
1281         (CFLAGS-getpid.os): Defined.
1282
1283 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
1284
1285         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
1286         returned for main thread does not overlap with any other VMA.
1287         Patch by Jakub Jelinek.
1288
1289 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
1290
1291         * tst-raise1.c: Include stdio.h.
1292
1293 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
1294
1295         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
1296         setting with __ASSUME_TGKILL || defined __NR_tgkill.
1297         If pid is 0, set it to selftid.
1298         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
1299         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
1300         != 0, return self->tid without doing a syscall.
1301         * descr.h (struct pthread): Move pid field after tid.
1302
1303         * Makefile (tests): Add tst-raise1.
1304         * tst-raise1.c: New file.
1305
1306 2003-12-23  Roland McGrath  <roland@redhat.com>
1307
1308         * tst-oddstacklimit.c: New file.
1309         * Makefile (tests): Add it.
1310         (tst-oddstacklimit-ENV): New variable.
1311
1312         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
1313         value up to page size for __default_stacksize.
1314
1315 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
1316
1317         * Makefile (tests): Add tst-eintr5.
1318         * tst-eintr5.c: New file.
1319
1320         * eintr.c (eintr_source): Prevent sending signal to self.
1321
1322         * tst-eintr2.c (tf1): Improve error message.
1323
1324 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
1325
1326         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
1327         * sysdeps/unix/sysv/linux/getpid.c: New file.
1328         * pthread_cancel.c: Add comment explaining use of PID field.
1329         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1330         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
1331         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
1332         temporarily to signal the field must not be relied on and updated
1333         by getpid().
1334         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
1335         temporarily negative.
1336         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1337
1338 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
1339
1340         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
1341         (eintr_source): If ARG != NULL, use pthread_kill.
1342         * tst-eintr1.c: Adjust for this change.
1343         * tst-eintr2.c: Likewise.
1344         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
1345         * tst-eintr3.c: New file.
1346         * tst-eintr4.c: New file.
1347
1348 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
1349
1350         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
1351         if CANCELSTATE_BITMASK is set.
1352         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
1353         Likewise.
1354
1355         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
1356         (tests-reverse): Add tst-cancel23.
1357         * tst-cancel22.c: New test.
1358         * tst-cancel23.c: New test.
1359
1360 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
1361
1362         * tst-eintr1.c: Better error messages.
1363
1364         * Makefile (tests): Add tst-eintr2.
1365         * tst-eintr2.c: New file.
1366
1367 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
1368
1369         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
1370         (CFLAGS-tst-cancelx21.c): Set.
1371         * tst-cancel21.c: New test.
1372         * tst-cancelx21.c: New test.
1373
1374         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
1375         comparison operand.
1376         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
1377         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
1378         * pt-longjmp.c: Include jmpbuf-unwind.h.
1379         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
1380         _JMPBUF_UNWINDS.  Adjust compared pointers.
1381         * init.c (__pthread_initialize_minimal_internal): Initialize
1382         pd->stackblock_size.
1383         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
1384         * sysdeps/alpha/jmpbuf-unwind.h: New file.
1385         * sysdeps/i386/jmpbuf-unwind.h: New file.
1386         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
1387         * sysdeps/s390/jmpbuf-unwind.h: New file.
1388         * sysdeps/sh/jmpbuf-unwind.h: New file.
1389         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
1390         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
1391         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
1392         (_JMPBUF_CFA_UNWINDS): Remove.
1393         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
1394
1395 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
1396
1397         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
1398         (CFLAGS-tst-cancelx20.c): Set.
1399         * tst-cancel20.c: New test.
1400         * tst-cancelx20.c: New test.
1401
1402 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
1403
1404         * init.c (__pthread_initialize_minimal_internal): Don't treat
1405         architectures with separate register stack special here when
1406         computing default stack size.
1407
1408 2003-12-17  Roland McGrath  <roland@redhat.com>
1409
1410         * Makefile (tst-cancelx7-ARGS): New variable.
1411         Reportd by Greg Schafer <gschafer@zip.com.au>.
1412
1413 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
1414
1415         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
1416         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
1417         (tst-stack3-ENV): Set.
1418         ($(objpfx)tst-stack3-mem): New.
1419         * tst-stack3.c: New test.
1420
1421 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
1422
1423         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
1424         Add unwind directives.  Drop unused .regstk directive.
1425         (_fini_EPILOG_BEGINS): Add unwind directives.
1426
1427 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
1428
1429         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1430         Assume parameter is a pointer.
1431         (lll_futex_wake): Likewise.
1432         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
1433         Likewise.
1434         (lll_futex_wake): Likewise.
1435         Reported by Boris Hu.
1436         * sysdeps/unix/sysv/linux/unregister-atfork.c
1437         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
1438
1439         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
1440
1441 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
1442
1443         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
1444         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
1445         __rtld_lock_initialize for ld.so lock.
1446         Patch in part by Adam Li <adam.li@intel.com>.
1447
1448 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
1449
1450         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
1451         in $(gnulib).  Also, remove stale comment.
1452
1453 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
1454
1455         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
1456         advantage of new syscall stub and optimize accordingly.
1457
1458         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
1459         from SYS_futex, to match expectations of
1460         sysdep.h:DO_INLINE_SYSCALL.
1461         (lll_futex_clobbers): Remove.
1462         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
1463         (lll_futex_wake): Likewise.
1464         (lll_futex_requeue): Likewise.
1465         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
1466         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
1467         Jelinek).
1468         (__lll_mutex_lock): Likewise.
1469         (__lll_mutex_cond_lock): Likewise.
1470         (__lll_mutex_timed_lock): Likewise.
1471         (__lll_mutex_unlock): Likewise.
1472         (__lll_mutex_unlock_force): Likewise.
1473
1474         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
1475         comes before the include of <sysdep.h>.
1476         (THREAD_SELF_SYSINFO): New macro.
1477         (THREAD_SYSINFO): Likewise.
1478         (INIT_SYSINFO): New macro.
1479         (TLS_INIT_TP): Call INIT_SYSINFO.
1480
1481         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
1482
1483         * sysdeps/pthread/createthread.c (create_thread): Use
1484         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
1485         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
1486         THREAD_SELF_SYSINFO instead of open code.
1487         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
1488         (THREAD_SYSINFO): Likewise.
1489
1490         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
1491
1492         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
1493
1494 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
1495
1496         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
1497         instead of .init.  Patch by David Mosberger.
1498
1499 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
1500
1501         * sysdeps/pthread/configure.in: Remove broken declaration in C
1502         cleanup handling check.
1503
1504 2003-11-30  Andreas Jaeger  <aj@suse.de>
1505
1506         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
1507         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
1508         Likewise.
1509
1510 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
1511
1512         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
1513         * pthread_attr_destroy.c: Include shlib-compat.h.
1514         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
1515         is set in iattr->flags.
1516         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
1517
1518 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
1519
1520         * Makefile (distribute): Add tst-cleanup4aux.c.
1521
1522         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
1523         include.
1524
1525 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
1526
1527         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
1528         pthread_cond_signal.
1529
1530         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
1531         store mutex address if the current value is ~0l.
1532         * sysdeps/pthread/pthread_cond_timedwait.c
1533         (__pthread_cond_timedwait): Likewise.
1534         * sysdeps/pthread/pthread_cond_broadcast.c
1535         (__pthread_cond_broadcast): Don't use requeue for pshared
1536         condvars.
1537
1538         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1539         (__pthread_cond_wait): Don't store mutex address if the current
1540         value is ~0l.
1541         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1542         (__pthread_cond_timedwait): Likewise.
1543         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1544         (__pthread_cond_broadcast): Don't use requeue for pshared
1545         condvars.
1546
1547         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
1548         element with ~0l for pshared condvars, with NULL otherwise.
1549
1550         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1551         (__pthread_cond_wait): Don't store mutex address if the current
1552         value is ~0l.
1553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1554         (__pthread_cond_timedwait): Likewise.
1555         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1556         (__pthread_cond_broadcast): Don't use requeue for pshared
1557         condvars.
1558
1559         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
1560         * tst-cond12.c: New file.
1561         * tst-cond13.c: New file.
1562
1563 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
1564
1565         * sysdeps/pthread/configure.in: Make missing forced unwind support
1566         fatal.
1567
1568 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
1569
1570         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
1571
1572 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
1573
1574         * Makefile: Add magic to clean up correctly.
1575
1576 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
1577
1578         * unwind.c (FRAME_LEFT): Define.
1579         (unwind_stop): Handle old style cleanups here.
1580         (__pthread_unwind): Handle old style cleanups only if
1581         !HAVE_FORCED_UNWIND.
1582         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
1583         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
1584         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
1585         ($(objpfx)tst-cleanupx4): Likewise.
1586         * tst-cleanup4.c: New test.
1587         * tst-cleanup4aux.c: New.
1588         * tst-cleanupx4.c: New test.
1589
1590 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
1591
1592         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
1593         lll_mutex_*lock macros to skip atomic operations on some archs.
1594
1595 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
1596
1597         * sysdeps/pthread/tst-timer.c (main): Initialize
1598         sigev2.sigev_value as well.
1599
1600 2003-10-15  Roland McGrath  <roland@redhat.com>
1601
1602         * sysdeps/pthread/configure.in: Barf if visibility attribute support
1603         is missing.
1604         * sysdeps/pthread/configure: Regenerated.
1605
1606 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1607
1608         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
1609         locking macros.  No distinction between normal and mutex locking
1610         anymore.
1611         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
1612         Merge bits from lowlevelmutex.S we still need.
1613         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
1614         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
1615         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
1616         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
1617         new mutex implementation.
1618         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
1619         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
1620         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1621         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1622         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1623         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1624         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1625         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1626         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1627         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
1628         symbol for entry point to avoid cancellation.
1629
1630 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
1631
1632         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
1633         changes.
1634         (SAVE_OLDTYPE_0): Fix a typo.
1635
1636 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
1637
1638         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
1639         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
1640
1641 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1642
1643         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
1644         correct offset.
1645
1646 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
1647
1648         * Makefile (tests): Add tst-cancel19.
1649         * tst-cancel19.c: New test.
1650
1651 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
1652
1653         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
1654         restoring of the old cancellation type.
1655
1656 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
1657
1658         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
1659
1660 2003-09-27  Wolfram Gloger  <wg@malloc.de>
1661
1662         * sysdeps/pthread/malloc-machine.h: New file
1663
1664 2003-09-24  Roland McGrath  <roland@redhat.com>
1665
1666         * allocatestack.c (__make_stacks_executable): Don't ignore return
1667         value from _dl_make_stack_executable.
1668
1669 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
1670
1671         * allocatestack.c (__make_stacks_executable): Also change
1672         permission of the currently unused stacks.
1673
1674         * allocatestack.c (change_stack_perm): Split out from
1675         __make_stacks_executable.
1676         (allocate_stack): If the required permission changed between the time
1677         we started preparing the stack and queueing it, change the permission.
1678         (__make_stacks_executable): Call change_stack_perm.
1679
1680         * Makefile: Build tst-execstack-mod locally.
1681         * tst-execstack-mod.c: New file.
1682
1683 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
1684
1685         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
1686
1687 2003-09-23  Roland McGrath  <roland@redhat.com>
1688
1689         * tst-execstack.c: New file.
1690         * Makefile (tests): Add it.
1691         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
1692         (LDFLAGS-tst-execstack): New variable.
1693
1694         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
1695         whether to use PROT_EXEC for stack mmap.
1696         (__make_stacks_executable): New function.
1697         * pthreadP.h: Declare it.
1698         * init.c (__pthread_initialize_minimal_internal): Set
1699         GL(dl_make_stack_executable_hook) to that.
1700
1701 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1702
1703         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
1704         recommendation from AMD re avoidance of lock prefix.
1705
1706 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
1707
1708         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
1709         lll_futex_timed_wait instead of lll_futex_wait.
1710         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
1711         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
1712         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
1713         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
1714         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
1715         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
1716         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
1717         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
1718         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
1719         Completely revamp the locking macros.  No distinction between
1720         normal and mutex locking anymore.
1721         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1722         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
1723         __lll_lock_timedwait): Fix prototypes.
1724         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
1725         __lll_lock_timedwait): Likewise.
1726         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
1727         macros, add __builtin_expect.
1728         (lll_mutex_timedlock): Likewise.  Fix return value.
1729         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
1730         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
1731         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
1732         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
1733         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
1734         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
1735         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
1736         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
1737
1738 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
1739
1740         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1741         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
1742         operation if possible.
1743
1744         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
1745         like jumping over the lock prefix.
1746
1747 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
1748
1749         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
1750         locking macros.  No distinction between normal and mutex locking
1751         anymore.
1752         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1753         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1754         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1755         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
1756         locking.  Merge bits from lowlevelmutex.S we still need.
1757         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1758         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1759         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
1760         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
1761         * Makefile (routines): Remove libc-lowlevelmutex.
1762         (libpthread-rountines): Remove lowlevelmutex.
1763         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
1764         for new mutex implementation.
1765         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1766         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1767         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1768         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1769         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1770         Likewise.
1771         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1772         Likewise.
1773         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1774         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1775         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
1776         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1777         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1778         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1779         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1780         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1781         Likewise.
1782         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1783         Likewise.
1784         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1785         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1786         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1787         Don't use requeue.
1788         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1789         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
1790
1791 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
1792
1793         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
1794         in parameters of asm with output parameters.
1795
1796         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
1797         type of DECR parameter to int.
1798         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
1799
1800 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
1801
1802         * tst-attr3.c (tf, do_test): Print stack start/end/size and
1803         guardsize for each thread.
1804
1805 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1806
1807         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
1808         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1809         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
1810
1811         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1812         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
1813         NULL.
1814         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
1815         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
1816         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1817         (pthread_getaffinity_np): Add hidden_def.
1818
1819         * Makefile (tests): Add tst-attr3.
1820         * tst-attr3.c: New test.
1821
1822         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
1823
1824 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1825
1826         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
1827         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
1828
1829 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
1830
1831         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
1832         * tst-align.c: Include tst-stack-align.h.
1833         (tf, do_test): Use TEST_STACK_ALIGN macro.
1834
1835 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
1836
1837         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
1838         variable.
1839
1840 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
1841
1842         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
1843         stack-related values for the initial thread.
1844
1845 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
1846
1847         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
1848
1849 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
1850
1851         * pthread_mutex_lock.c: Minor code rearrangements.
1852
1853 2003-09-05  Roland McGrath  <roland@redhat.com>
1854
1855         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
1856         Instead, include ../nptl_db/db_info.c to do its magic.
1857         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
1858         (__pthread_pthread_key_2ndlevel_size): Likewise.
1859         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
1860         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
1861         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
1862         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
1863         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
1864         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
1865         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
1866         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
1867         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
1868         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
1869         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
1870         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
1871         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
1872         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
1873         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
1874         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
1875         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
1876
1877 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
1878
1879         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
1880         of pthread_t to be compatible with LT.
1881         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1882         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1883         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1884         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1885         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1886         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1887         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1888
1889 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
1890
1891         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
1892
1893 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
1894
1895         * unwind-forcedunwind.c: Move to...
1896         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
1897         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
1898         * sysdeps/pthread/jmpbuf-unwind.h: New file.
1899         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
1900         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
1901         * unwind.c: Include jmpbuf-unwind.h.
1902         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
1903
1904 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
1905
1906         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
1907         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
1908         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
1909         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
1910         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
1911         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
1912         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
1913         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
1914         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
1915         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
1916         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
1917         function.
1918         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
1919         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
1920         * Makefile (tests): Add tst-stack2.
1921         * tst-stack2.c: New test.
1922         * tst-stack1.c: Include limits.h and sys/param.h.
1923         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
1924
1925         * pthread_condattr_setpshared.c: Include errno.h.
1926         (pthread_condattr_setpshared): Return EINVAL if pshared
1927         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
1928
1929         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
1930         defined symbol for entry point to avoid cancellation.
1931         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
1932         Likewise.
1933         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1934         Likewise.
1935         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
1936         Likewise.
1937         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
1938         Likewise.
1939         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
1940         Likewise.
1941         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
1942         __close_nocancel, __read_nocancel, __write_nocancel,
1943         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
1944         libpthread.so or librt.so, define to corresponding function
1945         without _nocancel suffix.
1946         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
1947         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
1948         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
1949
1950         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
1951
1952 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
1953
1954         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
1955         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
1956
1957         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
1958         in subsections has a symbol associated with it.
1959
1960         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
1961         defined symbol for entry point to avoid cancellation.
1962         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
1963
1964 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1965
1966         * Makefile (tests): Add tst-tls5.
1967         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
1968         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
1969         ($(objpfx)tst-tls5): New.
1970         ($(objpfx)tst-tls6.out): Likewise.
1971         (tests): Depend on $(objpfx)tst-tls6.out.
1972         * tst-tls3.c: Include stdint.h and pthreaddef.h.
1973         (do_test): Check pthread_self () return value alignment.
1974         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
1975         (tf): Check pthread_self () return value alignment.
1976         * tst-tls5.c: New test.
1977         * tst-tls5.h: New.
1978         * tst-tls5mod.c: New.
1979         * tst-tls5moda.c: New.
1980         * tst-tls5modb.c: New.
1981         * tst-tls5modc.c: New.
1982         * tst-tls5modd.c: New.
1983         * tst-tls5mode.c: New.
1984         * tst-tls5modf.c: New.
1985         * tst-tls6.sh: New test.
1986
1987         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
1988         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
1989         * init.c (pthread_functions): Initialize them.
1990         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
1991         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
1992         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
1993         pthread_cond_timedwait@@GLIBC_2.3.2.
1994
1995 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
1996
1997         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
1998         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
1999         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
2000         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
2001         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
2002         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2003
2004         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
2005
2006         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
2007         _POSIX_THREAD_PRIORITY_SCHEDULING.
2008         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2009
2010 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
2011
2012         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
2013         nested function, use static inline function from libio.h.
2014         Code by Richard Henderson.
2015
2016         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
2017         weak.
2018
2019 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
2020
2021         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
2022         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
2023         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
2024         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
2025         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
2026         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
2027         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
2028         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
2029         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
2030         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
2031         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
2032         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
2033         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
2034         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
2035         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
2036         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
2037         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
2038         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
2039         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
2040         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
2041         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
2042         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
2043         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
2044         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
2045         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
2046         * sysdeps/sparc/tls.h: New file.
2047         * sysdeps/sparc/tcb-offsets.sym: New file.
2048         * sysdeps/sparc/Makefile: New file.
2049         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
2050         * init.c [__sparc__] (__NR_set_tid_address): Define.
2051
2052 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
2053
2054         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
2055         _IO_release_lock): Define.
2056
2057 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
2058
2059         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
2060         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
2061
2062 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
2063
2064         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
2065         (__pthread_cleanup_class): Add missing return types of member
2066         functions.
2067
2068 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
2069
2070         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2071         (lll_mutex_unlock_force): Add memory barrier between store and futex
2072         syscall.
2073
2074 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
2075
2076         * tst-cancel4.c (do_test): Also unlink tempfname and remove
2077         tempmsg in first loop.
2078
2079 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
2080
2081         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2082         _POSIX_THREAD_PRIORITY_SCHEDULING.
2083         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2084
2085 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2086
2087         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
2088         (__rtld_lock_default_lock_recursive,
2089         __rtld_lock_default_unlock_recursive): Define.
2090         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
2091         __rtld_lock_unlock_recursive): Define using
2092         GL(_dl_rtld_*lock_recursive).
2093         * init.c (__pthread_initialize_minimal_internal): Initialize
2094         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
2095         Lock GL(_dl_load_lock) the same number of times as
2096         GL(_dl_load_lock) using non-mt implementation was nested.
2097
2098         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
2099         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2100
2101 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
2102
2103         * tst-cancel17.c (do_test): Make len2 maximum of page size and
2104         PIPE_BUF.
2105
2106 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2107
2108         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2109
2110 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
2111
2112         * sysdeps/pthread/createthread.c (do_clone): Move error handling
2113         to first syscall error check.  Move syscall error check for tkill
2114         into __ASSUME_CLONE_STOPPED #ifdef.
2115
2116 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
2117
2118         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
2119         is not defined, do explicit synchronization.
2120         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
2121         is not defined also unlock pd->lock for non-debugging case in case
2122         it is necessary.
2123         * pthread_create.c (start_thread): Always get and release pd->lock
2124         if __ASSUME_CLONE_STOPPED is not defined.
2125         (start_thread_debug): Removed.  Adjust users.
2126         * allocatestack.c (allocate_stack): Always initialize lock if
2127         __ASSUME_CLONE_STOPPED is not defined.
2128         * Makefile (tests): Add tst-sched1.
2129         * tst-sched1.c: New file.
2130
2131         * sysdeps/pthread/createthread.c (do_clone): Only use
2132         sched_setschduler and pass correct parameters.
2133
2134 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2135
2136         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
2137         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
2138         PTHREAD_STACK_MIN in comments.
2139
2140 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2141
2142         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2143         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
2144         argument.
2145         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
2146         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
2147         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
2148         (__pthread_cleanup_upto): Fix prototype.
2149         (_longjmp_unwind): Adjust caller.
2150         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
2151         Change second argument to const struct pointer.
2152         * tst-sem8.c (main): Remove unused s2 and s3 variables.
2153         * tst-sem9.c (main): Likewise.
2154         * unwind.c: Include string.h for strlen prototype.
2155
2156 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
2157
2158         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2159         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
2160         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
2161         Define HAVE_CMOV.
2162         Patch by Nicholas Miell <nmiell@attbi.com>.
2163
2164 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
2165
2166         * init.c (__pthread_initialize_minimal_internal): Initialize
2167         GL(dl_init_static_tls).
2168         * pthreadP.h (__pthread_init_static_tls): New prototype.
2169         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
2170         New functions.
2171         * Makefile (tests): Add tst-tls4.
2172         (modules-names): Add tst-tls4moda and tst-tls4modb.
2173         ($(objpfx)tst-tls4): Link against libdl and libpthread.
2174         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
2175         tst-tls4modb.so.
2176         * tst-tls4.c: New file.
2177         * tst-tls4moda.c: New file.
2178         * tst-tls4modb.c: New file.
2179
2180 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
2181
2182         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
2183         before __timer_dealloc.
2184         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
2185         Don't call list_unlink.
2186
2187 2003-07-29  Roland McGrath  <roland@redhat.com>
2188
2189         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2190
2191 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2192
2193         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2194         Don't reuse struct aiocb A if it failed.
2195         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2196         not just one byte, as that does not block.
2197
2198 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2199
2200         * sysdeps/pthread/unwind-resume.c: New file.
2201         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2202         unwind-resume in csu subdir.
2203         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2204         exceptions.
2205         (librt-sysdep_routines, librt-shared-only-routines): Add
2206         rt-unwind-resume.
2207         * sysdeps/pthread/rt-unwind-resume.c: New file.
2208         * unwind-forcedunwind.c: New file.
2209         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2210         (libpthread-shared-only-routines): Likewise.
2211         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2212         * pthreadP.h (pthread_cancel_init): New prototype.
2213         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2214
2215         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2216         attr argument const struct pthread_attr *.
2217
2218         * res.c (__res_state): Return __resp.
2219         * descr.h: Include resolv.h.
2220         (struct pthread): Add res field.
2221         * pthread_create.c: Include resolv.h.
2222         (start_thread): Initialize __resp.
2223         * Makefile (tests): Add tst-_res1.
2224         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2225         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2226         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2227         libpthread.
2228         * tst-_res1.c: New file.
2229         * tst-_res1mod1.c: New file.
2230         * tst-_res1mod2.c: New file.
2231
2232 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2233
2234         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2235
2236         * Makefile: Define various *-no-z-defs variables for test DSOs
2237         which has undefined symbols.
2238
2239 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2240
2241         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2242         Retry if the stwcx fails to store once_control.
2243
2244 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2245
2246         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2247         pthread_attr_setaffinity.
2248         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2249         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2250         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2251         * pthread_attr_destroy.c: Free cpuset element if allocated.
2252         * pthread_create.c: Pass iattr as additional parameter to
2253         create_thread.
2254         * sysdeps/pthread/createthread.c: If attribute is provided and
2255         a new thread is created with affinity set or scheduling parameters,
2256         start thread with CLONE_STOPPED.
2257         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
2258         pthread_attr_setaffinity.
2259         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2260         cpuset element.
2261
2262 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
2263
2264         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2265
2266 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
2267
2268         * sysdeps/pthread/configure.in: Require CFI directives also for
2269         ppc and s390.
2270
2271 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
2272
2273         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2274         Add cfi directives.
2275
2276 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2277
2278         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
2279         CLEANUP_JMP_BUF.
2280         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
2281         registers as variables.  Call __pthread_mutex_unlock_usercnt.
2282         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2283         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
2284         not self pointer in __writer.  Compare with TID to determine
2285         deadlocks.
2286         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2287         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2288         Likewise.
2289         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2290         Likewise.
2291         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
2292         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2293         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
2294         macros also when compiling librt.
2295
2296 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
2297
2298         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
2299         -fasynchronous-unwind-tables.
2300         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2301         (PSEUDO): Add cfi directives.
2302         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
2303         Likewise.
2304         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2305         Likewise.
2306
2307 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
2308
2309         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
2310         __pthread_unregister_cancel): Add prototypes and hidden_proto.
2311         * unwind.c (__pthread_unwind_next): Add hidden_def.
2312         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
2313         Likewise.
2314         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2315         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2316         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2317         Likewise.
2318         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
2319         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2320         Likewise.
2321         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
2322         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
2323         __pthread_unregister_cancel and __pthread_unwind_next.
2324
2325 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
2326
2327         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
2328         different symbol for the cancellation syscall wrapper and
2329         non-cancellation syscall wrapper.
2330         (PSEUDO_END): Define.
2331
2332 2003-07-05  Richard Henderson  <rth@redhat.com>
2333
2334         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
2335         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
2336         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2337         return actual return value from the syscall, not 0.
2338
2339 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
2340
2341         * descr.h (struct pthread): Add pid field.
2342         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
2343         (__reclaim_stacks): Likewise.
2344         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
2345         also check for PID of the signal source.
2346         (__pthread_initialize_minimal_internal): Also initialize pid field
2347         of initial thread's descriptor.
2348         * pthread_cancel.c: Use tgkill instead of tkill if possible.
2349         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2350         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
2351         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2352         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2353
2354 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
2355
2356         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
2357         Fix use of parameter.
2358         (__libc_cleanup_pop): Likewise.
2359
2360 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
2361
2362         * init.c (sigcancel_handler): Change parameters to match handler
2363         for SA_SIGACTION.  Check signal number and code to recognize
2364         invalid invocations.
2365
2366 2003-07-03  Roland McGrath  <roland@redhat.com>
2367
2368         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
2369         Apply sizeof (struct pthread) bias to r13 value.
2370
2371 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
2372
2373         * sysdeps/pthread/configure.in: Require CFI directives.
2374
2375         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
2376         definition.
2377         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
2378         libpthread compilation.
2379         * unwind.c (__pthread_unwind): Add hidden_def.
2380         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2381
2382 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2383
2384         * libc-cancellation.c (__libc_cleanup_routine): Define.
2385         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
2386         (__pthread_cleanup_pop): Define.
2387
2388 2003-07-01  Richard Henderson  <rth@redhat.com>
2389
2390         * sysdeps/alpha/elf/pt-initfini.c: New file.
2391         * sysdeps/alpha/pthread_spin_lock.S: New file.
2392         * sysdeps/alpha/pthread_spin_trylock.S: New file.
2393         * sysdeps/alpha/pthreaddef.h: New file.
2394         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
2395         * sysdeps/alpha/tls.h: New file.
2396         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
2397         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
2398         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
2399         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
2400         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
2401         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
2402         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
2403         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
2404         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
2405         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2406
2407 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2408
2409         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
2410         cleanup support and unwind info.
2411
2412 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
2413
2414         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2415         Use correct cleanup handler registration.  Add unwind info.
2416         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
2417         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
2418         * tst-once3.c: Add cleanup handler and check it is called.
2419         * tst-once4.c: Likewise.
2420         * tst-oncex3.c: New file.
2421         * tst-oncex4.c: New file.
2422         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2423
2424 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
2425
2426         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2427
2428 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
2429
2430         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
2431         (tf_msgsnd): Likewise.
2432
2433         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
2434         premature returns a bit more.
2435
2436 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
2437
2438         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
2439         definition to the front.
2440
2441         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
2442         the cleanup functions to make the names unique.  Fix dwarf opcode
2443         un unwind table.
2444         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
2445         functions to make the names unique.  Fix CFA offset for two blocks.
2446
2447 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
2448
2449         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
2450         missing closing braces.
2451         Patch by Christophe Saout <christophe@saout.de>.
2452
2453 2003-06-24  Roland McGrath  <roland@redhat.com>
2454
2455         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2456
2457 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
2458
2459         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
2460         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
2461
2462         * pthreadP.h: Declare __find_thread_by_id.
2463         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
2464         * pthread_clock_gettime.c: Allow using other thread's clock.
2465         * pthread_clock_settime.c: Likewise.
2466         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2467         * Makefile: Add rules to build and run tst-clock2.
2468         * tst-clock2.c: New file.
2469
2470 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
2471
2472         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
2473         to use exception-based cleanup handler.
2474         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2475
2476         * tst-cond8.c (ch): Announce that we are done.
2477
2478         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
2479
2480         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
2481         Also test aio_suspend with timeout value.
2482
2483 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
2484
2485         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
2486         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
2487         attribute_hidden.
2488
2489         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
2490         (__pthread_mutex_lock_internal): Likewise.
2491         (__pthread_mutex_unlock_internal): Likewise.
2492         (__pthread_mutex_unlock_usercnt): Declare.
2493         * pthread_mutex_destroy.c: Always fail if used in any way.
2494         * pthread_mutex_init.c: Update comment.
2495         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
2496         * pthread_mutex_timedlock.c: Adjust __nusers.
2497         * pthread_mutex_trylock.c: Adjust __nusers.
2498         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
2499         and public interfaces are wrapper with pass additional parameter.
2500         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
2501         parameter zero.
2502         * tst-mutex8.c: New file.
2503         * Makefile (tests): Add tst-mutex8.
2504         * sysdeps/pthread/pthread_cond_timedwait.c: Call
2505         __pthread_mutex_unlock_usercnt.
2506         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2507         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2509         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2510         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2511         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
2512         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2513         Add __nusers.
2514         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2515         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2516         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2517         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2518         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2519
2520         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
2521         * pthread_mutex_timedlock.c: Likewise.
2522         * pthread_mutex_trylock.c: Adjust __nusers.
2523         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
2524         * tst-mutex9.c: New file.
2525         * Makefile (tests): Add tst-mutex9.
2526         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
2527         * sysdeps/ia64/tls.h: Likewise.
2528         * sysdeps/powerpc/tls.h: Likewise.
2529         * sysdeps/s390/tls.h: Likewise.
2530         * sysdeps/sh/tls.h: Likewise.
2531         * sysdeps/x86_64/tls.h: Likewise.
2532         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2533         Change type of __owner.
2534         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2535         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2536         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2537         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2538         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2539
2540 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
2541
2542         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
2543         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
2544
2545         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
2546         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
2547         instead of nr to lll_futex_wake.  Only set errno and return -1
2548         if err < 0.
2549
2550         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
2551         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2552         return actual return value from the syscall, not 0.
2553
2554 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
2555
2556         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
2557         find a random value.
2558         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
2559         errno==EIDRM.
2560
2561         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
2562         compat_timer_settime.
2563         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
2564         compat_timer_gettime.
2565         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
2566         compat_timer_getoverrun.
2567         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
2568         compat_timer_delete.
2569
2570         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
2571         error-checking mutex detect busy mutexes.
2572
2573 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2574
2575         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
2576         Add ax to clobber list.
2577         (lll_mutex_cond_lock): Likewise.
2578         (lll_mutex_unlock): Likewise.
2579         (lll_lock): Likewise.
2580         (lll_unlock): Likewise.
2581
2582         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
2583         * tst-cancel18.c: New file.
2584         * tst-cancelx18.c: New file.
2585
2586         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
2587         and tcdrain.
2588
2589         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
2590         * tst-cancel17.c: New file.
2591         * tst-cancelx17.c: New file.
2592
2593         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
2594         * sysdeps/unix/sysv/linux/sigwait.c: New file.
2595         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
2596
2597         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
2598
2599 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
2600
2601         * sysdeps/pthread/createthread.c (create_thread): Set
2602         header.multiple_threads unconditionally.
2603         * allocatestack.c (allocate_stack): Likewise.
2604         * descr.h (struct pthread): Add header.multiple_threads
2605         unconditionally.
2606         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
2607         Define for librt.  #error if neither libpthread, libc nor librt.
2608         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
2609         Likewise.
2610         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
2611         CDISABLE): Likewise.
2612         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
2613         CDISABLE): Likewise.
2614         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
2615         CDISABLE): Likewise.
2616         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
2617         CDISABLE): Likewise.  Access header.multiple_threads outside of
2618         libc and libpthread.
2619         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
2620         Likewise.
2621         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
2622         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
2623
2624 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
2625
2626         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
2627         Also test early cancellation before the thread reaches the cancellation
2628         point.
2629
2630         * Makefile: Compile forward.c with exceptions.
2631
2632         * sysdeps/unix/sysv/linux/sleep.c: New file.
2633
2634 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
2635
2636         * Makefile: Add CFLAGS definition to compile function wrappers
2637         duplicated from libc with exceptions.
2638         * tst-cancel4.c: Also check cancellation handlers.
2639
2640         * Makefile: Add rules to build and run tst-cancel16 and
2641         tst-cancelx16.  Add missing CFLAGS definitions.
2642         * tst-cancel16.c: New file.
2643         * tst-cancelx16.c: New file.
2644
2645 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
2646
2647         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2648         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
2649         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2650         (DL_SYSINFO_IMPLEMENTATION): Likewise.
2651
2652         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
2653         (LIBC_CANCEL_RESET): Likewise.
2654         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
2655         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
2656         librt-cancellation.
2657         (CFLAGS-libcrt-cancellation.c): Define.
2658         * sysdeps/pthread/librt-cancellation.c: New file.
2659         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
2660         macros also when compiling librt.
2661         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2662         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2663         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2664         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2665         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2666         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2667         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2668
2669         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
2670         compat_timer_create.
2671
2672 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
2673
2674         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
2675
2676         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2677         __register_atfork.
2678         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
2679         Add libc_hidden_def.
2680
2681 2003-06-13  Roland McGrath  <roland@redhat.com>
2682
2683         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
2684         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
2685
2686 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
2687
2688         * allocatestack.c (queue_stack): Always inline.
2689         * ptreadhP.h (__do_cancel): Likewise.
2690
2691 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
2692
2693         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
2694         a typo.
2695
2696 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
2697
2698         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2699         (__pthread_cond_signal): Remove incorrect second addition for
2700         cond_lock!=0.
2701
2702 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
2703
2704         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2705         (__pthread_cond_signal): Use correct futex pointer in
2706         __lll_mutex_lock_wait call.
2707
2708         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2709         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
2710
2711 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
2712
2713         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
2714         cancelable.
2715         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2716         Likewise.
2717
2718         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
2719         hand-written CFI generation code.  Since ENTRY/END also initiated
2720         CFI frames this caused two CFI sets to be generated.
2721
2722 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
2723
2724         * cleanup_routine.c: New file.
2725         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
2726         * sysdeps/pthread/pthread.h: Add support for fully exception-based
2727         cleanup handling.
2728         * Makefile (libpthread-routines): Add cleanup_routine.
2729         Add more CFLAGS variables to compile with exceptions.  Add comments
2730         why which file needs unwind tables.
2731         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
2732         tests.
2733         * tst-cancelx1.c: New file.
2734         * tst-cancelx2.c: New file.
2735         * tst-cancelx3.c: New file.
2736         * tst-cancelx4.c: New file.
2737         * tst-cancelx5.c: New file.
2738         * tst-cancelx6.c: New file.
2739         * tst-cancelx7.c: New file.
2740         * tst-cancelx8.c: New file.
2741         * tst-cancelx9.c: New file.
2742         * tst-cancelx10.c: New file.
2743         * tst-cancelx11.c: New file.
2744         * tst-cancelx12.c: New file.
2745         * tst-cancelx13.c: New file.
2746         * tst-cancelx14.c: New file.
2747         * tst-cancelx15.c: New file.
2748         * tst-cleanupx0.c: New file.
2749         * tst-cleanupx0.expect: New file.
2750         * tst-cleanupx1.c: New file.
2751         * tst-cleanupx2.c: New file.
2752         * tst-cleanupx3.c: New file.
2753
2754         * tst-cleanup0.c: Make standard compliant.
2755         * tst-cleanup1.c: Likewise.
2756
2757         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
2758         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2759         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2760         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2761         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2762         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2763         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
2764         CLEANUP_JMP_BUF.
2765         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2766         * tst-cancel12.c: New file.
2767         * tst-cancel13.c: New file.
2768         * tst-cancel14.c: New file.
2769         * tst-cancel15.c: New file.
2770         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
2771         and tst-cancel15.
2772
2773         * tst-cancel1.c: Add some comments.
2774
2775         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
2776         timeout correctly.
2777
2778 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
2779
2780         * Makefile (CFLAGS-pthread_cancel.c): Define.
2781
2782 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
2783
2784         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
2785         Change type of __writer element to int.
2786         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2787         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2788         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2789         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2790         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2791         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
2792         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2793         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
2794         Compare with TID to determine deadlocks.
2795         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2796         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2797         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
2798         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2799         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2800         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2801         Likewise.
2802         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2803         Likewise.
2804         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2805         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2806         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2807         Likewise.
2808         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2809         Likewise.
2810         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2811         * Makefile (tests): Add tst-rwlock12.
2812         * tst-rwlock12.c: New file.
2813
2814 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
2815
2816         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
2817         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
2818         Remove bogus hidden_proto.
2819         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
2820         Likewise.
2821         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
2822         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
2823         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
2824         ___lll_mutex_timedlock): Likewise.
2825
2826 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
2827
2828         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2829         (__pthread_cond_signal): Add some code to eventually handle
2830         cond_lock!=0.
2831
2832 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
2833
2834         * Makefile (tests): Add tst-exec4.
2835         (tst-exec4-ARGS): Define.
2836         * tst-exec4.c: New file.
2837
2838 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
2839
2840         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2841         Also fail if tv_nsec < 0.
2842         (__lll_timedwait_tid): Likewise.
2843         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
2844         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
2845         Likewise.
2846         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
2847         Likewise.
2848         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
2849         Likewise.
2850         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
2851         Likewise.
2852         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
2853         Likewise.
2854         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
2855         Likewise.
2856
2857         * Makefile (tests): Add tst-sem8 and tst-sem9.
2858         * tst-sem8.c: New file.
2859         * tst-sem9.c: New file.
2860         * sem_open.c: Fix creation of in_use record if the file exists but
2861         no internal record.
2862
2863         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
2864         definitions.
2865
2866         * sysdeps/pthread/timer_create.c (timer_create): In case
2867         evp==NULL, assign timer ID to sival_ptr.
2868
2869         * descr.h (struct pthread_unwind_buf): Change type of prev element to
2870         struct pthread_unwind_buf *.
2871         (struct pthread): Likewise for cleanup_jmp_buf element.
2872
2873         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
2874         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
2875         * unwind.c (__pthread_unwind_next): Likewise.
2876
2877 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2878
2879         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2880         (lll_futex_timed_wait): Use int for futex value parameter.
2881         (lll_futex_wake): Likewise.
2882         (lll_futex_requeue): Likewise.
2883
2884         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
2885         Replace one memory operation with one register operation.
2886
2887         * tst-join4.c (do_test): Fix error message.
2888
2889         * tst-rwlock6.c (do_test): Use correct format specifier.
2890
2891         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
2892         (__lll_mutex_lock_wait): Replace one memory operation with one
2893         register operation.
2894         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
2895         (__lll_mutex_lock_wait): Likewise.
2896
2897         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2898         (__lll_mutex_cond_lock): Add one to value parameter of
2899         __lll_lock_wait to reflect reality in the futex syscall.
2900         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2901         (lll_mutex_cond_lock): Likewise.
2902
2903 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2904
2905         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
2906         New function.
2907         (lll_mutex_cond_lock): Define.
2908
2909 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
2910
2911         * Makefile (tests): Add tst-signal6.
2912         * tst-signal6.c: New file.
2913
2914         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
2915         (__lll_mutex_unlock_force): New function
2916         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2917
2918         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
2919         (__lll_mutex_unlock_force): New function.
2920         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
2921
2922         * tst-rwlock7.c (do_test): Use correct format specifier.
2923
2924         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
2925         Find break parameter in correct asm argument.
2926
2927 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
2928
2929         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
2930         Remove out4.
2931         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
2932         error occured.
2933         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2934         Add __mutex.
2935         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
2936         lll_futex_requeue, lll_mutex_unlock_force): Define.
2937
2938 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
2939
2940         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2941         (pthread_cond_t): Add __mutex.
2942         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
2943         lll_futex_requeue, lll_mutex_unlock_force): Define.
2944
2945 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2946
2947         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
2948         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2949         Add __mutex field.
2950         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
2951         Define.
2952         (lll_futex_wait, lll_futex_wake): Define.
2953         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
2954         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
2955         FUTEX_REQUEUE instead of FUTEX_WAIT.
2956         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2957         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
2958         mutex which was used in condvar structure.  Call
2959         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
2960         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2961
2962         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
2963         include tcb-offsets.h.  Read wakeup value in locked region.
2964         Use the value of gbr register as THREAD_ID.
2965         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2966         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2967         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2968
2969         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
2970         macros.
2971
2972 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
2973
2974         * sysdeps/pthread/pthread_cond_broadcast.c
2975         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
2976
2977 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
2978
2979         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
2980         typo in register name.
2981         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
2982         correctly.  Actually use requeue.  Little optimization.
2983         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
2984         mutex address early.  Handle cancellation state as 32-bit value.
2985         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2986         Remove unnecessary label.
2987
2988 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
2989
2990         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
2991         instead of FUTEX_WAIT.
2992         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
2993         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2994         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2995         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2996         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2997         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
2998         used in condvar structure.  Call __pthread_mutex_cond_lock instead
2999         of __pthread_mutex_lock_internal.
3000         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3001         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3002         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3003         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
3004         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3005         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3006         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
3007         Add pthread_mutex_cond_lock.
3008         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
3009         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
3010         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
3011         lll_mutex_cond_lock.
3012         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3013         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3014         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3015         Add __mutex field.
3016         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3017         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3018
3019         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
3020         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3021
3022         * pthreadP.h: Declare __pthread_mutex_cond_lock.
3023         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
3024         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
3025         macro don't define aliases.
3026
3027         * cancellation.c: Remove __pthread_enable_asynccancel_2.
3028         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
3029         * sysdeps/pthread/pthread_cond_timedwait.c: Use
3030         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
3031         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3032         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3033         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3034         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3035         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3036
3037 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
3038
3039         * sem_open.c: Fix one endless loop.  Implement correct semantics
3040         wrt opening the same semaphore more then once.
3041         * sem_close.c: Adjust for sem_open change.
3042         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
3043         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
3044         * Makefile (tests): Add tst-sem7.
3045         * tst-sem7.c: New file.
3046
3047 2003-05-16  Roland McGrath  <roland@redhat.com>
3048
3049         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
3050         uninitialized variable braino.
3051
3052 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
3053
3054         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
3055         test for syscall availability.
3056
3057         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
3058         __no_posix_timers to -1 if the syscalls don't exist.
3059
3060         * pthread_join.c (pthread_join): Set tid field of the joined
3061         thread to -1.  This isn't necessary but helps to recognize some
3062         error conditions with almost no cost.
3063
3064         * allocatestack.c (FREE_P): Also negative values indicate an
3065         unused stack.
3066
3067         * unwind.c: Include <unistd.h>.
3068
3069 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
3070
3071         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
3072
3073 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
3074
3075         * Makefile (crti-objs, crtn-objs): New variables.
3076         (omit-deps, extra-objs): Add crtn.
3077         ($(objpfx)libpthread.so): Depend on both crti and crtn
3078         and links to them in multidir.
3079         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
3080
3081 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
3082
3083         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3084         (lll_mutex_unlock): Use atomic_exchange_rel.
3085
3086 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
3087
3088         * cond-perf.c (cons): Add missing locking around setting of alldone.
3089
3090 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
3091
3092         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
3093         related macros.
3094         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3095
3096 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
3097
3098         * tst-sem6.c: New file.
3099         * Makefile (tests): Add tst-sem6.
3100
3101         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
3102         Use atomic_exchange_rel instead of atomic_exchange.
3103         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
3104         Likewise.
3105
3106         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
3107         code for lll_futex_wait and lll_futex_wake in static apps.  Use
3108         vsyscall is possible.
3109
3110         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
3111         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
3112         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
3113         pthread_setaffinity_np.
3114         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
3115         and pthread_setaffinity_np.
3116         * Makefile (libpthread-routines): Add pthread_getaffinity and
3117         pthread_setaffinity.
3118
3119         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
3120         use it in case mmap to allocate the stack fails.
3121         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
3122         ARCH_MAP_FLAGS here.
3123         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
3124         ARCH_RETRY_MMAP.
3125
3126 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
3127
3128         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
3129         handler implementation.  It is now lockless in fork().
3130         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3131         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3132         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
3133         declare the __fork_*_lists.
3134         (struct fork_handler): Include pointers to all three functions.
3135         Add next, refcntr and need_signal elements.
3136         (__fork_handlers): New declaration.
3137         (__register_atfork_malloc): Remove declaration.
3138         (HAVE_register_atfork_malloc): Remove definition.
3139         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
3140         __pthread_child_handler variable.
3141         (__libc_pthread_init): Use __register_atfork instead of explicitly
3142         adding to the list.
3143         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
3144         and lll_futex_wake.
3145         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3146
3147         * unwind.c (unwind_cleanup): Print error message and then abort.  This
3148         function must never be reached.
3149
3150         * cond-perf.c: New file.
3151
3152 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
3153
3154         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
3155
3156 2003-05-04  Roland McGrath  <roland@redhat.com>
3157
3158         * Makefile ($(objpfx)../libc.so): New target.
3159
3160 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
3161
3162         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3163         (pthread_condattr_t): Size is only an int, don't use long for
3164         alignment.
3165         (pthread_mutexattr_t): Likewise.
3166         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3167         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3168         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3169
3170 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
3171
3172         * sysdeps/i386/tls.h: Define THREAD_ID.
3173         * sysdeps/ia64/tls.h: Likewise.
3174         * sysdeps/powerpc/tls.h: Likewise.
3175         * sysdeps/s390/tls.h: Likewise.
3176         * sysdeps/sh/tls.h: Likewise.
3177         * sysdeps/x86_64/tls.h: Likewise.
3178         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
3179         record ownership.
3180         * pthread_mutex_timedlock.c: Likewise.
3181         * pthread_mutex_trylock.c: Likewise.
3182         * pthread_mutex_unlock.c: Likewise.
3183         * pthread_rwlock_trywrlock.c: Likewise.
3184         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
3185         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3186         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3187         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3188
3189         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
3190         flag.
3191
3192 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3193
3194         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3195         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3196         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3197         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3198         Make __align long long instead of long.
3199         (pthread_rwlock_t): Formatting.
3200         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3201         (pthread_rwlock_t): Formatting.
3202         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3203         (pthread_cond_t): Make __align long long instead of long.
3204         (pthread_rwlock_t): Move __flags field to the same position as in
3205         linuxthreads.
3206
3207 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3208
3209         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3210         * tst-rwlock7.c (do_test): Likewise.
3211
3212 2003-04-26  Roland McGrath  <roland@redhat.com>
3213
3214         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3215
3216 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3217
3218         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3219         sizeof (struct pthread).
3220         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3221         1 struct pthread.
3222         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3223         to 0.
3224         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3225         struct pthread.
3226         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3227         to 32-bit bytes.
3228         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3229         tcbp.
3230         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3231         unneccessarily.
3232         (NO_TLS_OFFSET): Define.
3233         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3234         add TLS_TCB_SIZE unnecessarily.
3235
3236 2003-04-22  Roland McGrath  <roland@redhat.com>
3237
3238         * Makeconfig (shared-thread-library): Reverse link order to work
3239         around linker bug.
3240
3241 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3242
3243         * semaphore.h: Fix typo in comment.
3244
3245 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3246
3247         * sysdeps/pthread/sigfillset.c: New file.
3248
3249         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3250         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3251         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3252         * sysdeps/pthread/sigaction.c: Likewise.
3253         * sysdeps/pthread/sigprocmask.c: New file.
3254         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3255         __SIGRTMIN+1.
3256         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3257         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
3258         in this case.
3259
3260 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
3261
3262         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3263         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
3264
3265         * sysdeps/unix/sysv/linux/unregister-atfork.c
3266         (__unregister_atfork): Don't free memory not allocated dynamically.
3267
3268         * semaphore.h: Remove __THROW marker from cancellation points.
3269         * nptl/sysdeps/pthread/pthread.h: Likewise.
3270
3271 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
3272
3273         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
3274         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
3275         __THROW.
3276
3277 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3278
3279         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
3280
3281 2003-04-15  Roland McGrath  <roland@redhat.com>
3282
3283         * forward.c (__pthread_unwind): Tweak to avoid warning.
3284
3285 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
3286
3287         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
3288
3289 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
3290
3291         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
3292         overflow CFA advance instructions.
3293         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3294
3295 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
3296
3297         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
3298         * sysdeps/i386/pthread_spin_lock.c: Likewise.
3299         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
3300         defined.
3301
3302         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
3303         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
3304         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
3305         DW_CFA_advance_loc for .Laddl-.Lsubl.
3306
3307 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
3308
3309         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
3310         position-independent unwind data for static libraries.
3311         Add missing unwind info.  Add comments.
3312
3313         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
3314         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3315         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3316         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3317
3318 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
3319
3320         * Makefile: Make sure all cancellation points are compiled with
3321         exception and asynchronous unwind tables.
3322
3323         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
3324         which mishandles loading of global object addresses in PIC.
3325         (THREAD_SETMEM_NC): Likewise.
3326
3327 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3328
3329         * pthread.h: Define new data structure for cleanup buffer.  Declare
3330         new cleanup handler interfaces.
3331         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
3332         (struct pthread): Add cleanup_jmp_buf pointer.  Define
3333         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
3334         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
3335         it.  Declare old cleanup handler installation functions.
3336         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
3337         handling.
3338         * cleanup_defer.c: Likewise.
3339         * cleanup_compat.c: New file.  Old cleanup code.
3340         * cleanup_def_compat.c: New file.  Old cleanup code.
3341         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
3342         if own thread descriptor.
3343         * unwind.c: New file.
3344         * forward.c: Add __pthread_unwind.
3345         * init.c (pthread_functions): Add __pthread_unwind.
3346         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
3347         Add ptr___pthread_unwind.
3348         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
3349         and unwind function.
3350         * Makefile (libpthread-routines): Add cleanup_compat,
3351         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
3352         table generation if necessary.
3353         * version.c: Record whether unwind support is compiled in.
3354         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
3355         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
3356         handler interfaces.
3357         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
3358         complication to generate unwind information for syscall wrappers.
3359         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3360         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3361         __cleanup_fct_attribute.
3362
3363         * Makefile: Add rules to build and run tst-cleanup0.
3364         * tst-cleanup0.c: New file.
3365         * tst-cleanup0.expect: New file.
3366
3367         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
3368         caller.  Optimize to avoid often unecessary local variable.
3369
3370 2003-04-11  Roland McGrath  <roland@redhat.com>
3371
3372         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
3373         sets variable `multidir'; include that.
3374         (generated): Add it.
3375         ($(objpfx)$(multidir)/crti.o): New target.
3376         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
3377
3378 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3379
3380         * tst-attr2.c (do_test): Add cast to avoid warning.
3381         * tst-mutex4.c (do_test): Likewise.
3382
3383 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
3384
3385         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
3386         in child.
3387
3388 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
3389
3390         * Makefile (tests): Add tst-detach1.
3391         * tst-detach1.c: New file.
3392
3393 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
3394
3395         * sysdeps/pthread/pthread.h: Remove duplicate
3396         pthread_cleanup_{push,pop} definitions.
3397
3398         * tst-barrier2.c: Eliminate warnings.
3399         * tst-cancel4.c: Likewise.
3400         * tst-cond4.c: Likewise.
3401         * tst-cond6.c: Likewise.
3402         * tst-detach1.c: Likewise.
3403         * tst-rwlock4.c: Likewise.
3404         * tst-rwlock6.c: Likewise.
3405         * tst-rwlock7.c: Likewise.
3406         * tst-sem3.c: Likewise.
3407         * tst-spin2.c: Likewise.
3408         * tst-umask1.c: Likewise.
3409
3410 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
3411
3412         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
3413
3414 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
3415
3416         * descr.h (struct pthread): Move cancelhandling member to the front.
3417
3418 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
3419
3420         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
3421         malloc_parent, and malloc_child statically.
3422         (__register_atfork_malloc): New function.
3423         (free_mem): Don't free any of the malloc_* variables on the list.
3424         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
3425         Define HAVE_register_atfork_malloc.
3426
3427 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
3428
3429         * sysdeps/pthread/createthread.c (create_thread): Add some more
3430         comments explaining when to set multiple_threads and when not.
3431
3432         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3433         THREAD_ATOMIC_BIT_SET if not already defined.
3434         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3435         THREAD_ATOMIC_BIT_SET:
3436         * sysdeps/x86_64/tls.h: Likewise.
3437         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
3438         THREAD_ATOMIC_CMPXCHG_VAL.
3439         (_pthread_cleanup_pop_restore): Likewise.
3440         * cancellation.c (__pthread_enable_asynccancel): Likewise.
3441         (__pthread_enable_asynccancel_2): Likewise.
3442         (__pthread_disable_asynccancel): Likewise.
3443         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3444         (__libc_disable_asynccancel): Likewise.
3445         * init.c (sigcancel_handler): Likewise.
3446         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
3447         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
3448
3449 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
3450
3451         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
3452         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3453         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
3454         * Makefile (tests): Add tst-cancel11.
3455         * tst-cancel11.c: New file.
3456
3457 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
3458
3459         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
3460         round, not the first.  Use specific_used flag instead of local
3461         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
3462         (__free_tcb): Don't call deallocate_tsd here.
3463         (start_thread): Call deallocate_tsd here.
3464         * pthread_setspecific.c: Set specific_used flag really only when
3465         needed.
3466         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.