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