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