* rt/tst-cpuclock1.c: New file.
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2005-04-27  Roland McGrath  <roland@redhat.com>
2
3         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
5         translating to the kernel clockid_t for our own process/thread clock.
6
7         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
8
9 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
10
11         * old_pthread_cond_init.c: Include <errno.h>.
12         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
13         process shared or uses clock other than CLOCK_REALTIME.
14         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
15
16 2005-04-13  David S. Miller  <davem@davemloft.net>
17
18         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
19         * sysdeps/sparc/sparc64/clone.S: New file.
20
21 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
22
23         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
24         __inline instead of inline.
25         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
26
27 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
28
29         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
30         functionally equivalent, but shorter instructions.
31         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
32         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
33         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
34         Likewise.
35         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
36         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
37         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
38         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
39         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
40         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
41         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
42         Likewise.
43         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
44         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
45         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
46         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
47         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
48
49 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
50
51         * sysdeps/mips/Makefile: New file.
52         * sysdeps/mips/nptl-sysdep.S: New file.
53         * sysdeps/mips/tcb-offsets.sym: New file.
54         * sysdeps/mips/pthread_spin_lock.S: New file.
55         * sysdeps/mips/pthread_spin_trylock.S: New file.
56         * sysdeps/mips/pthreaddef.h: New file.
57         * sysdeps/mips/tls.h: New file.
58         * sysdeps/mips/jmpbuf-unwind.h: New file.
59         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
60         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
61         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
62         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
63         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
64         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
65         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
66         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
67         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
68         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
69
70 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
71
72         * pthread_create.c (__pthread_create_2_1): Rename syscall error
73         variable to scerr.
74
75 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
76
77         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
78
79 2005-02-25  Roland McGrath  <roland@redhat.com>
80
81         * alloca_cutoff.c: Correct license text.
82         * tst-unload.c: Likewise.
83         * sysdeps/pthread/allocalim.h: Likewise.
84         * sysdeps/pthread/pt-initfini.c: Likewise.
85         * sysdeps/pthread/bits/libc-lock.h: Likewise.
86         * sysdeps/pthread/bits/sigthread.h: Likewise.
87         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
88         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
89
90 2005-02-16  Roland McGrath  <roland@redhat.com>
91
92         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
93         Use unsigned int * for ptr_nthreads.
94
95 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
96
97         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
98         gcc4.
99
100 2005-02-07  Richard Henderson  <rth@redhat.com>
101
102         [BZ #787]
103         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
104         argument.
105
106 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
107
108         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
109         order of arguments in invocation of atomic_add_zero.
110
111 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
112
113         [BZ #737]
114         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
115         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
116         at least gotntpoff relocation and addition.
117         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
118         Likewise.
119         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
120         Likewise.
121         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
122         Likewise.
123
124 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
125
126         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
127         entry for static tls deallocation fix.
128         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
129         also contains information whether the memory pointed to is static
130         TLS or not.
131         * sysdeps/i386/tls.h: Likewise.
132         * sysdeps/ia64/tls.h: Likewise.
133         * sysdeps/powerpc/tls.h: Likewise.
134         * sysdeps/s390/tls.h: Likewise.
135         * sysdeps/sh/tls.h: Likewise.
136         * sysdeps/sparc/tls.h: Likewise.
137         * sysdeps/x86_64/tls.h: Likewise.
138
139 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
140
141         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
142
143 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
144
145         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
146         %esp.
147         * Makefile (tests): Add tst-align2.
148         * tst-align2.c: New test.
149         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
150         -mpreferred-stack-boundary=4.
151
152 2004-12-18  Roland McGrath  <roland@redhat.com>
153
154         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
155         New file removed withdrawn for the moment.
156
157 2004-12-17  Richard Henderson  <rth@redhat.com>
158
159         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
160         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
161
162 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
163
164         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
165         Increased PTHREAD_STACK_MIN.
166
167         * tst-context1.c (stacks): Use bigger stack size.
168
169 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
170
171         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
172         * sysdeps/sparc/tcb-offsets.sym: Add TID.
173
174 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
175
176         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
177         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
178         * sysdeps/s390/tcb-offsets.sym (TID): Add.
179
180 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
181
182         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
183
184 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
185
186         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
187         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
188
189         * tst-getpid1.c: If child crashes, report this first.  Print which
190         signal.
191
192 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
193
194         * init.c (__pthread_initialize_minimal_internal): Also unblock
195         SIGSETXID.
196
197 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
198
199         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
200         _POSIX_THREAD_CPUTIME): Define to 0.
201         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
202         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
203         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
204         __timer_signal_thread_tclk): Remove.
205         (init_module): Remove their initialization.
206         (thread_cleanup): Remove their cleanup assertions.
207         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
208         __timer_signal_thread_tclk): Remove.
209         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
210         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
211         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
212
213 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
214
215         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
216         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
217
218         * Makefile (tests): Add tst-getpid2.
219         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
220         (do_test): Use it.  Use __clone2 instead of clone on ia64.
221         * tst-getpid2.c: New test.
222
223 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
224
225         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
226
227 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
228
229         * Makefile (tests): Add tst-getpid1.
230         * tst-getpid1.c: New file.
231         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
232         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
233
234 2004-12-02  Roland McGrath  <roland@redhat.com>
235
236         * Makefile (libpthread-nonshared): Variable removed.
237         ($(objpfx)libpthread_nonshared.a): Target removed.
238         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
239         These are now handled by generic magic from
240         libpthread-static-only-routines being set.
241
242 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
243
244         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
245         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
246         _POSIX_THREAD_PRIO_PROTECT): Define.
247         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
248         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
249         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
250
251 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
252
253         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
254         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
255         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
256         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
257         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
258         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
259         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
260
261 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
262
263         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
264
265         * Makefile (libpthread-routines): Add pthread_setschedprio.
266         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
267         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
268         * pthread_setschedprio.c: New file.
269
270 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
271
272         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
273         * pthread_cancel.c (pthread_create): Likewise.
274
275         * Makefile (libpthread-routines): Add vars.
276         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
277         * init.c (__default_stacksize, __is_smp): Remove.
278         * vars.c: New file.
279         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
280         and define a wrapper macro.
281         (PTHREAD_STATIC_FN_REQUIRE): Define.
282         * allocatestack.c (__find_thread_by_id): Undefine.
283         * pthread_create (__pthread_keys): Remove.
284         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
285         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
286         PTHREAD_STATIC_FN_REQUIRE.
287
288 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
289
290         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
291         parameter to REGISTER macro.
292
293 2004-11-17  Roland McGrath  <roland@redhat.com>
294
295         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
296         Make sure SIGCANCEL is blocked as well.
297
298 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
299
300         * sysdeps/pthread/setxid.h: New file.
301         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
302         (struct xid_command): Add forward decl.
303         (struct pthread_functions): Change return type of __nptl_setxid hook
304         to int.
305         * pthreadP.h (__nptl_setxid): Change return type to int.
306         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
307         calling thread, return its return value and set errno on failure.
308         * descr.h (struct xid_command): Change id type to long array.
309
310         * Makefile: Add rules to build and test tst-setuid1 and
311         tst-setuid1-static.
312         * tst-setuid1.c: New test.
313         * tst-setuid1-static.c: New test.
314
315 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
316
317         * Makefile (tests): Add tst-exit3.
318         * tst-exit3.c: New test.
319
320 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
321
322         * Makefile (tests): Add tst-exit2.
323         * tst-exit2.c: New file.
324
325 2004-11-09  Roland McGrath  <roland@redhat.com>
326
327         [BZ #530]
328         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
329         here, before calling clone.
330         * pthread_create.c (start_thread): Don't do it here.
331
332 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
333
334         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
335
336 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
337
338         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
339         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
340         assembler warning.
341
342 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
343
344         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
345         if sched_priority is not between minprio and maxprio.
346
347 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
348
349         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
350         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
351
352         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
353         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
354
355 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
356
357         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
358         not-cancelable I/O functions.
359
360 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
361
362         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
363         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
364         make sure 2 is stored in the futex and we looked at the old value.
365         Fix a few other problems to return the correct value.
366
367 2004-10-14  Richard Henderson  <rth@redhat.com>
368
369         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
370         make gcc4 happy.
371
372 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
373
374         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
375         of pthread-functions.h and pthreaddef.h.
376         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
377
378         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
379         Change __data.__nwaiters from int to unsigned int.
380
381         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
382         sysconf (_SC_THREAD_CPUTIME) returns negative value.
383
384         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
385         before return type.
386
387         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
388         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
389
390 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
391
392         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
393         test fails, remove message queue.
394         (tf_msgsnd): Likewise.
395
396 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
397
398         * tst-clock1.c: Change #ifdef to #if defined.
399         * tst-clock2.c: Likewise.
400         * tst-cond11.c: Likewise.
401
402         * sysdeps/pthread/timer_create.c (timer_create): Use
403         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
404         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
405         THREAD_CPUTIME.
406
407 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
408
409         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
410         _POSIX_THREAD_CPUTIME): Define to 0.
411
412 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
413
414         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
415         and _POSIX_THREAD_CPUTIME to zero.
416         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
417         * tst-barrier2.c: Fix testing for POSIX feature.
418         * tst-clock1.c: Likewise.
419         * tst-clock2.c: Likewise.
420         * tst-cond11.c: Likewise.
421         * tst-cond4.c: Likewise.
422         * tst-cond6.c: Likewise.
423         * tst-flock2.c: Likewise.
424         * tst-mutex4.c: Likewise.
425         * tst-mutex9.c: Likewise.
426         * tst-rwlock12.c: Likewise.
427         * tst-rwlock4.c: Likewise.
428         * tst-signal1.c: Likewise.
429         * tst-spin2.c: Likewise.
430         * sysdeps/pthread/posix-timer.h: Likewise.
431         * sysdeps/pthread/timer_create.c: Likewise.
432         * sysdeps/pthread/timer_routines.c: Likewise.
433
434 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
435
436         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
437         (__lll_mutex_timedlock_wait): Address futex correctly.
438
439         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
440         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
441         make sure 2 is stored in the futex and we looked at the old value.
442         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
443         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
444         which might very well made the code not working at all before.
445         [BZ #417]
446
447 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
448
449         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
450         allow SIGSETXID to be sent.
451         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
452         for SIGSETXID to be defined.
453         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
454         SIGSETXID cannot be blocked.
455
456         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
457         Add __extension__ to long long types.
458         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
459         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
460         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
461         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
462         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
463         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
464         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
465
466 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
467
468         * descr.h (struct pthread): Add stopped_start field.
469         * sysdeps/pthread/createthread.c (create_thread): Set
470         start_stopped flag in descriptor for new thread appropriately.
471         * pthread_create.c (start_thread): Only take lock to be stopped on
472         startup if stopped_start flag says so.
473
474 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
475
476         * pthread_create.c (__pthread_create_2_1): Remember whether thread
477         is created detached and if yes, do not try to free the stack in case
478         the thread creation failed.
479         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
480         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
481         case there has been no error.  [BZ #405]
482
483         * pthread_create.c (start_thread): Don't wait for scheduler data
484         etc to be set at the beginning of the function.  The cancellation
485         infrastructure must have been set up.  And enable async
486         cancellation before potentially going to sleep.  [BZ #401]
487
488 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
489
490         * Versions: Remove exports for pthread_set*id_np functions.
491         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
492         for now.
493         * Makefile: Don't build pthread_set*id code for now.
494
495 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
496
497         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
498         internal use.
499         * allocatestack.c (__nptl_setxid): New function.
500         * descr.h (struct xid_command): Define type.
501         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
502         (sighandler_setxid): New function.
503         (__pthread_initialize_minimal): Register sighandler_setxid for
504         SIGCANCEL.
505         * pt-allocrtsig.c: Update comment.
506         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
507         Declare __nptl_setxid.
508         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
509         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
510         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
511         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
512         and pthread_setresuid_np.
513         * pthread_setgid_np.c: New file.
514         * pthread_setuid_np.c: New file.
515         * pthread_setegid_np.c: New file.
516         * pthread_seteuid_np.c: New file.
517         * pthread_setregid_np.c: New file.
518         * pthread_setreuid_np.c: New file.
519         * pthread_setresgid_np.c: New file.
520         * pthread_setresuid_np.c: New file.
521         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
522         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
523         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
524         and pthread_setresuid_np.
525         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
526         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
527         pthread_setregid, and pthread_setresgid.
528
529 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
530
531         * allocatestack.c (allocate_stack): Return EAGAIN instead of
532         ENOMEM when out of memory.
533
534 2004-09-10  Roland McGrath  <roland@redhat.com>
535
536         [BZ #379]
537         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
538         code, since we don't try to use the broken CLONE_STOPPED any more.
539         * pthread_create.c (start_thread): Likewise.
540
541 2004-09-15  Richard Henderson  <rth@redhat.com>
542
543         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
544
545 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
546
547         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
548         (__libc_unwind_longjmp): Delete macro and declare as function.
549         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
550         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
551         nptl directory.
552         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
553         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
554         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
555
556 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
557
558         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
559         for __USE_XOPEN2K.
560         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
561         types also for __USE_XOPEN2K.
562         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
563         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
564         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
565         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
566         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
567         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
568         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
569         [BZ #320]
570
571 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
572
573         * sysdeps/pthread/pthread.h
574         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
575         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
576         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
577         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
578         [BZ #375]
579
580 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
581
582         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
583         PSEUDO to be used with . prefix.
584
585         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
586         Use atomic_increment instead of atomic_exchange_and_add.
587         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
588         Likewise.
589         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
590         Likewise.
591         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
592         Likewise.
593
594         * allocatestack.c (allocate_stack): Use atomic_increment_val
595         instead of atomic_exchange_and_add.
596         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
597         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
598         Likewise.
599         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
600         Likewise.
601
602         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
603         the initialization function might throw.
604
605 2005-09-05  Richard Henderson  <rth@redhat.com>
606
607         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
608         Move definition inside libpthread, libc, librt check.  Provide
609         definition for rtld.
610
611 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
612
613         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
614         * sysdeps/i386/jmpbuf-unwind.h: Likewise
615         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
616         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
617         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
618         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
619         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
620         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
621         * unwind.c: Use it.
622
623         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
624         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
625         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
626         Likewise.
627         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
628         Decrement __nwaiters.  If pthread_cond_destroy has been called and
629         this is the last waiter, signal pthread_cond_destroy caller and
630         avoid using the pthread_cond_t structure after unlock.
631         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
632         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
633         Read clock type from the least significant bits of __nwaiters instead
634         of __clock.
635         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
636         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
637
638 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
639
640         [BZ #342]
641         * Makefile (tests): Add tst-cond20 and tst-cond21.
642         * tst-cond20.c: New test.
643         * tst-cond21.c: New test.
644         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
645         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
646         it unsigned int.
647         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
648         Likewise.
649         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
650         (pthread_cond_t): Likewise.
651         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
652         Likewise.
653         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
654         Likewise.
655         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
656         Likewise.
657         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
658         (cond_nwaiters): New.
659         (clock_bits): New.
660         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
661         if there are waiters not signalled yet.
662         Wait until all already signalled waiters wake up.
663         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
664         __nwaiters.  If pthread_cond_destroy has been called and this is the
665         last waiter, signal pthread_cond_destroy caller and avoid using
666         the pthread_cond_t structure after unlock.
667         (__pthread_cond_wait): Increment __nwaiters in the beginning,
668         decrement it when leaving.  If pthread_cond_destroy has been called
669         and this is the last waiter, signal pthread_cond_destroy caller.
670         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
671         Likewise.  Read clock type from the least significant bits of
672         __nwaiters instead of __clock.
673         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
674         whether clock ID can be encoded in COND_CLOCK_BITS bits.
675         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
676         clock type just from the last COND_CLOCK_BITS bits of value.
677         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
678         instead of __clock, just from second bit of condattr's value.
679
680 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
681
682         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
683         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
684         != 64.
685         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
686
687 2004-08-15  Roland McGrath  <roland@frob.com>
688
689         * pthread_atfork.c: Update copyright terms including special exception
690         for these trivial files, which are statically linked into executables
691         that use dynamic linking for the significant library code.
692
693 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
694
695         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
696         pthread_rwlock_rdlock.
697         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
698         Decrease __nr_readers_queued after reacquiring lock.
699         * sysdeps/pthread/pthread_rwlock_timedrdlock
700         (pthread_rwlock_timedrdlock): Likewise.
701         Reported by Bob Cook <bobcook47@hotmail.com>.
702
703 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
704
705         * tst-rwlock14.c (tf): Read main thread handle from *ARG
706         before pthread_barrier_wait.
707
708 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
709
710         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
711         Remove unnecessary exception handling data.
712
713 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
714
715         [BZ #284]
716         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
717         instead of clockid_t.
718
719 2004-07-21  Roland McGrath  <roland@redhat.com>
720
721         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
722
723 2004-07-19  Roland McGrath  <roland@redhat.com>
724
725         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
726
727 2004-07-02  Roland McGrath  <roland@redhat.com>
728
729         * configure: Don't exit.
730
731 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
732
733         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
734         (__pthread_cond_timedwait): Check for invalid nanosecond in
735         timeout value.
736
737 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
738
739         * Makefile: Add rules to build and run tst-fini1.
740         * tst-fini1.c: New file.
741         * tst-fini1mod.c: New file.
742
743 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
744
745         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
746         if no cancellation support is needed.
747         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
748         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
749         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
750         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
751         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
752         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
753         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
754         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
755         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
756
757         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
758         only if not already defined.
759
760 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
761
762         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
763         constraint "m" instead of "0" for futex.
764
765         * shlib-versions: Add powerpc64-.*-linux.*.
766
767 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
768
769         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
770         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
771         for valid tv_nsec.
772         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
773         1 billion and 64-bit tv_nsec which is valid when truncated to 32
774         bits.
775
776 2004-06-29  Roland McGrath  <roland@redhat.com>
777
778         * Banner: NPTL no longer has its own version number.
779         * Makefile (nptl-version): Variable removed.
780         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
781         using $(version), the glibc version number.
782
783 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
784
785         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
786         Fix branch offset for a PLT entry.
787         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
788         Likewise.
789         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
790         Likewise.
791         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
792         Likewise.
793         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
794         Likewise.
795
796 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
797
798         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
799         unconditionally.
800
801 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
802
803         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
804         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
805         instead of tv_sec.
806         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
807         (pthread_rwlock_timedrdlock): Likewise.
808
809 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
810
811         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
812         Set __r7 to val, not mutex.
813
814 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
815
816         * Makefile: Add rules to build tst-rwlock14.
817         * tst-rwlock14.c: New file.
818
819 2004-06-24  Boris Hu  <boris.hu@intel.com>
820
821         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
822         check.
823         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
824
825 2004-06-19  Andreas Jaeger  <aj@suse.de>
826
827         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
828         assembler in last patch.
829
830 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
831
832         * sysdeps/pthread/pthread_cond_timedwait.c
833         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
834         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
835         (__pthread_cond_timedwait): Check for invalid nanosecond in
836         timeout value.
837         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
838         * tst-cond19.c: New file.
839         * Makefile: Add rules to build and run tst-cond19.
840
841 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
842
843         * tst-context1.c (GUARD_PATTERN): Defined.
844         (tst_context_t): Define struct containing ucontext_t & guard words.
845         (ctx): Declare as an array of tst_context_t.
846         (fct): Verify uc_link & guard words are still valid.
847         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
848
849 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
850
851         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
852         Add __data.__futex field, reshuffle __data.__clock.
853         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
854         (__pthread_cond_signal): Increment __futex at the same time as
855         __wakeup_seq or __total_seq.  Pass address of __futex instead of
856         address of low 32-bits of __wakeup_seq to futex syscall.
857         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
858         (__pthread_cond_wait): Likewise.  Pass __futex value from before
859         releasing internal lock to FUTEX_WAIT.
860         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
861         (__pthread_cond_timedwait): Likewise.
862         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
863         (FUTEX_CMP_REQUEUE): Define.
864         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
865         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
866         Pass __futex value from before the unlock and __futex address instead
867         of address of low 32-bits of __wakeup_seq to futex syscall.
868         Fallback to FUTEX_WAKE all on any errors.
869
870 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
871
872         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
873         comment typo.
874         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
875         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
876         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
877         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
878         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
879
880 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
881
882         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
883         Add memory clobber to inline assembly.
884         (__lll_mutex_trylock): Likewise.
885         (__lll_mutex_cond_trylock): Likewise.
886
887 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
888
889         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
890         Pass val argument as 6th system call argument in %r7.
891
892 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
893
894         * Makefile (tests): Add tst-cond16.
895         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
896         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
897         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
898         Add __data.__futex field, reshuffle __data.__clock.
899         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
900         (__pthread_cond_signal): Increment __futex at the same time as
901         __wakeup_seq or __total_seq.  Pass address of __futex instead of
902         address of low 32-bits of __wakeup_seq to futex syscall.
903         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
904         (__pthread_cond_wait): Likewise.  Pass __futex value from before
905         releasing internal lock to FUTEX_WAIT.
906         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
907         (__pthread_cond_timedwait): Likewise.
908         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
909         (FUTEX_CMP_REQUEUE): Define.
910         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
911         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
912         Pass __futex value from before the unlock and __futex address instead
913         of address of low 32-bits of __wakeup_seq to futex syscall.
914         Fallback to FUTEX_WAKE all on any errors.
915         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
916         Define.
917         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
918         internally.  Return non-zero if error, zero if success.
919         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
920         Add __data.__futex field, reshuffle __data.__clock.
921         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
922         Define.
923         (lll_futex_requeue): Add val argument, return 1 unconditionally
924         for the time being.
925         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
926         Add __data.__futex field, reshuffle __data.__clock.
927         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
928         Define.
929         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
930         internally.  Return non-zero if error, zero if success.
931         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
932         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
933         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
934         Define.
935         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
936         internally.  Return non-zero if error, zero if success.
937         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
938         Add __data.__futex field, reshuffle __data.__clock.
939         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
940         Define.
941         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
942         internally.  Return non-zero if error, zero if success.
943         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
944         Add __data.__futex field, reshuffle __data.__clock.
945         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
946         Add __data.__futex field, reshuffle __data.__clock.
947         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
948         Increment __futex at the same time as __wakeup_seq or __total_seq.
949         Pass address of __futex instead of address of low 32-bits of
950         __wakeup_seq to futex syscall.
951         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
952         Pass __futex value from before releasing internal lock
953         to FUTEX_WAIT.
954         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
955         Likewise.  Avoid unnecessary shadowing of variables.
956         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
957         Set __futex to 2 * __total_seq.  Pass __futex value from before the
958         unlock and __futex address instead of address of low 32-bits of
959         __wakeup_seq to futex_requeue macro, adjust for new return value
960         meaning.
961         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
962         (__pthread_cond_signal): Increment __futex at the same time as
963         __wakeup_seq or __total_seq.  Pass address of __futex instead of
964         address of low 32-bits of __wakeup_seq to futex syscall.
965         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
966         (__pthread_cond_wait): Likewise.  Pass __futex value from before
967         releasing internal lock to FUTEX_WAIT.
968         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
969         (__pthread_cond_timedwait): Likewise.
970         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
971         (FUTEX_CMP_REQUEUE): Define.
972         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
973         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
974         Pass __futex value from before the unlock and __futex address instead
975         of address of low 32-bits of __wakeup_seq to futex syscall.
976         Fallback to FUTEX_WAKE all on any errors.
977
978 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
979
980         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
981         Add nop to align the end of critical section.
982         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
983
984 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
985
986         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
987         Add __broadcast_seq field.
988         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
989         all waiters as woken with woken_seq and bump broadcast counter.
990         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
991         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
992         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
993         Comment typo fixes.  Avoid returning -ETIMEDOUT.
994
995 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
996
997         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
998         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
999         Reported by Kaz Kojima.
1000
1001 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
1002
1003         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
1004
1005 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1006
1007         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
1008         __broadcast_seq with bc_seq after acquiring internal lock instead of
1009         before it.
1010
1011 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
1012
1013         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
1014         compilation.
1015         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1016         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
1017         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1018         (pthread_cond_t): Add __data.__broadcast_seq field.
1019         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1020         (FRAME_SIZE): Define.
1021         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
1022         Comment typo fixes.
1023         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
1024         Define.
1025         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
1026         typo fixes.
1027         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1028         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
1029         fixes.
1030
1031 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
1032
1033         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
1034         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1035         Add __broadcast_seq field.
1036         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1037         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1038         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1039         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1040         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1041         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
1042         all waiters as woken with woken_seq and bump broadcast counter.
1043         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
1044         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
1045         __broadcast_seq field.
1046         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1047         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1048         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1049         * pthread_cond_init.c: Initialize __broadcast_seq field.
1050         * Makefile (tests): Add tst-cond17 and tst-cond18.
1051         Add .NOTPARALLEL goal.
1052         * tst-cond16.c: New file.  From Jakub.
1053         * tst-cond17.c: New file.  From Jakub.
1054         * tst-cond18.c: New file.  From Jakub.
1055
1056 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
1057
1058         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
1059         unwind info.
1060
1061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1062         Parametrize frame size.  Correct some unwind info.
1063         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1064
1065 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1066
1067         * tst-stack3.c: Note testing functionality beyond POSIX.
1068
1069 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1070
1071         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
1072         Change conditional from ifdef to if.
1073
1074 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
1075
1076         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
1077         SYSDEP_CANCEL_ERROR): Define.
1078         (PSEUDO): Use it.
1079
1080 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
1081
1082         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
1083
1084 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
1085
1086         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
1087
1088 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1089
1090         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
1091         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1092         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
1093         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1094
1095 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
1096
1097         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
1098         thread has all signals blocked.
1099
1100 2004-04-18  Andreas Jaeger  <aj@suse.de>
1101
1102         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
1103         (SEM_VALUE_MAX): Add missing brace.
1104
1105 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1106
1107         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
1108         in rt subdir.
1109         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
1110         * sysdeps/pthread/tst-mqueue8x.c: New test.
1111         * tst-cancel4.c: Update comment about message queues.
1112
1113         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
1114         return it_value { 0, 0 }.
1115         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
1116         like SIGEV_SIGNAL.
1117         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
1118         assertion for SIGEV_NONE.
1119         (thread_attr_compare): Compare all attributes, not just a partial
1120         subset.
1121
1122 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1123
1124         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
1125
1126 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
1127
1128         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
1129         Just use a plain number.
1130         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
1131         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1132         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1133         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1134         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1135         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1136         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1137
1138 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1139
1140         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
1141         frame info.
1142         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1143
1144 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
1145
1146         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
1147         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
1148         of calling sigwaitinfo.
1149
1150 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
1151
1152         * allocatestack.c (allocate_stack): Set reported_guardsize
1153         unconditionally.
1154         * pthread_getattr_np.c (pthread_getattr_np): Use
1155         reported_guardsize instead of guardsize.
1156         * descr.h (struct pthread): Add reported_guardsize field.
1157
1158 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
1159
1160         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
1161
1162 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
1163
1164         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
1165
1166 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
1167
1168         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
1169         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
1170         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
1171         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
1172         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1173         Define.
1174         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
1175         (_POSIX_MESSAGE_PASSING): Define.
1176         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
1177         (_POSIX_MESSAGE_PASSING): Define.
1178         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
1179         (_POSIX_MESSAGE_PASSING): Define.
1180
1181 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
1182
1183         * tst-context1.c (fct): Check whether correct stack is used.
1184
1185 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
1186
1187         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
1188         matching constraints for asm mem parameters.
1189
1190         * tst-clock2.c (tf): Don't define unless needed.
1191
1192 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
1193
1194         * Makefile (link-libc-static): Use $(static-gnulib) instead of
1195         $(gnulib).
1196
1197 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
1198
1199         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
1200         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
1201         * pthreadP.h: Declare __nptl_deallocate_tsd.
1202         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
1203         Adjust caller.
1204
1205         * Makefile (tests): Add tst-tsd5.
1206         * tst-tsd5.c: New file.
1207
1208 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
1209
1210         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1211         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
1212         is SHLIB_COMPAT check.
1213         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1214         (__pthread_attr_getaffinity_old): Likewise.
1215         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1216         (__pthread_getaffinity_old): Likewise.
1217         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1218         (__pthread_setaffinity_old): Likewise.
1219
1220 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
1221
1222         * allocatestack.c (_make_stacks_executable): Call
1223         _dl_make_stack_executable first.
1224
1225 2004-03-24  Roland McGrath  <roland@redhat.com>
1226
1227         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
1228         constraint instead of "0".
1229
1230 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
1231
1232         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1233         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
1234
1235         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
1236         code to avoid warning.
1237
1238 2004-03-24  Andreas Jaeger  <aj@suse.de>
1239
1240         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1241         (__pthread_attr_setaffinity_old): Remove const.
1242
1243 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
1244
1245         * sysdeps/unix/sysv/linux/smp.h: New file.
1246         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
1247         * init.c: Define __is_smp.
1248         (__pthread_initialize_minimal_internal): Call is_smp_system to
1249         initialize __is_smp.
1250         * pthreadP.h: Declare __is_smp.
1251         Define MAX_ADAPTIVE_COUNT is necessary.
1252         * pthread_mutex_init.c: Add comment regarding __spins field.
1253         * pthread_mutex_lock.c: Implement adaptive mutex type.
1254         * pthread_mutex_timedlock.c: Likewise.
1255         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1256         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
1257         Add __spins field.
1258         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1259         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1260         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1261         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1262         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1263         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1264         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1265         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
1266         lll_mutex_cond_trylock.
1267         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1268         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1269         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1270         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1271         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1272         Define BUSY_WAIT_NOP.
1273         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1274         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1275
1276         * tst-mutex5.c: Add support for testing adaptive mutexes.
1277         * tst-mutex7.c: Likewise.
1278         * tst-mutex5a.c: New file.
1279         * tst-mutex7a.c: New file.
1280         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
1281
1282         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1283         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
1284         vgettimeofday call might destroy the content.
1285
1286         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
1287         @pause in the loop.
1288
1289         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1290         No need to restrict type of ret.  Make it int.  Add comment.
1291
1292         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1293         Remove unnecessary setne instruction.
1294
1295 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
1296
1297         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1298         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
1299         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
1300         If realloc fails, break out of the loop.
1301
1302 2004-03-20  Andreas Jaeger  <aj@suse.de>
1303
1304         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1305         (__pthread_setaffinity_old): Fix interface.
1306         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1307         (__pthread_getaffinity_old): Likewise.
1308
1309         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1310         (__pthread_setaffinity_new): Remove duplicate declaration.
1311
1312 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1313
1314         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
1315         the return value to a safe register.
1316         (CDISABLE): Set the function argument correctly.
1317
1318 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1319
1320         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
1321         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
1322         Rewrite so that only one locked memory operation per round is needed.
1323         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
1324         (pthread_barrier_wait): After wakeup, release lock only when the
1325         last thread stopped using the barrier object.
1326         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1327         (__pthread_cond_wait): Don't store mutex address if the current
1328         value is ~0l.  Add correct cleanup support and unwind info.
1329         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1330         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1331         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
1332         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
1333         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1334         Add correct cleanup support and unwind info.
1335         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
1336         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
1337         information for syscall wrappers.
1338
1339 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
1340
1341         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
1342         cpusetsize field, remove next.
1343         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
1344         parameter for size of the CPU set.
1345         (pthread_setaffinity_np): Likewise.
1346         (pthread_attr_getaffinity_np): Likewise.
1347         (pthread_attr_setaffinity_np): Likewise.
1348         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
1349         interface change, keep compatibility code.
1350         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
1351         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
1352         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
1353         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
1354         __pthread_getaffinity_np.
1355         * Versions: Add version for changed interfaces.
1356         * tst-attr3.c: Adjust test for interface change.
1357         * pthread_getattr_np.c: Query the kernel about the affinity mask with
1358         increasing buffer sizes.
1359         * pthread_attr_destroy.c: Remove unused list handling.
1360         * pthread_attr_init.c: Likewise.
1361
1362 2004-03-17  Roland McGrath  <roland@redhat.com>
1363
1364         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
1365         first argument to clock_getres so we ever enable kernel timers.
1366
1367 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
1368
1369         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
1370
1371 2004-03-12  Richard Henderson  <rth@redhat.com>
1372
1373         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
1374         oldvalue from CENABLE to CDISABLE.
1375
1376 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
1377
1378         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
1379         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1380         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1381         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1382
1383 2004-03-11  Richard Henderson  <rth@redhat.com>
1384
1385         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
1386         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
1387         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
1388
1389 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1390
1391         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
1392         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
1393         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
1394
1395 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1396
1397         * forward.c (__pthread_cond_broadcast_2_0,
1398         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
1399         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
1400         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
1401
1402 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1403
1404         * sysdeps/sh/tcb-offsets.sym: Add PID.
1405         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
1406         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
1407
1408 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
1409
1410         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
1411         include <sysdep-cancel.h>, vfork is no cancellation point.
1412         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
1413         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
1414         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
1415
1416 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
1417
1418         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
1419         libc_hidden_def.
1420         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
1421         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
1422         Likewise.
1423         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
1424         Likewise.
1425         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
1426         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
1427         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
1428         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
1429         of DO_CALL_VIA_BREAK.  Work around a gas problem.
1430
1431         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
1432         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
1433         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
1434         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
1435         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
1436         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
1437
1438         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
1439         a local register for saving old PID.  Negate PID in parent upon exit.
1440
1441         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
1442         tcb-offsets.h.
1443         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1444         before syscall, set to the old value in the parent afterwards.
1445         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
1446         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
1447         tcb-offsets.h.
1448         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1449         before syscall, set to the old value in the parent afterwards.
1450         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
1451         * sysdeps/s390/tcb-offsets.sym: Add PID.
1452
1453         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
1454         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
1455         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
1456         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
1457         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
1458         * sysdeps/sparc/tcb-offsets.sym: Add PID.
1459
1460 2004-03-10  Andreas Schwab  <schwab@suse.de>
1461
1462         * sysdeps/ia64/tcb-offsets.sym: Add PID.
1463         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
1464         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
1465
1466 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
1467
1468         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
1469         * tst-cancel21.c (do_one_test): Likewise.
1470         Reported by Gordon Jin <gordon.jin@intel.com>.
1471
1472 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
1473
1474         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
1475         if non-zero and set to INT_MIN if zero.
1476         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
1477         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
1478         (SAVE_PID, RESTORE_PID): Define.
1479         (__vfork): Use it.
1480         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
1481         Use relative path to avoid including NPTL i386/vfork.S.
1482         (SAVE_PID, RESTORE_PID): Define.
1483         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
1484         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
1485         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
1486         tst-vfork2x.
1487         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
1488         * tst-vfork1.c: New test.
1489         * tst-vfork2.c: New test.
1490         * tst-vfork1x.c: New test.
1491         * tst-vfork2x.c: New test.
1492
1493 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
1494
1495         * sysdeps/i386/tcb-offsets.sym: Add PID.
1496         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1497         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
1498         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
1499
1500 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
1501
1502         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
1503
1504 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1505
1506         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1507         _rtld_global_ro.
1508
1509 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
1510
1511         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1512         _rtld_global_ro.
1513
1514         * tst-once4.c: Remove unnecessary macro definition.
1515
1516         * tst-mutex7.c (do_test): Limit thread stack size.
1517         * tst-once2.c (do_test): Likewise.
1518         * tst-tls3.c (do_test): Likewise.
1519         * tst-tls1.c (do_test): Likewise.
1520         * tst-signal3.c (do_test): Likewise.
1521         * tst-kill6.c (do_test): Likewise.
1522         * tst-key4.c (do_test): Likewise.
1523         * tst-join4.c (do_test): Likewise.
1524         * tst-fork1.c (do_test): Likewise.
1525         * tst-context1.c (do_test): Likewise.
1526         * tst-cond2.c (do_test): Likewise.
1527         * tst-cond10.c (do_test): Likewise.
1528         * tst-clock2.c (do_test): Likewise.
1529         * tst-cancel10.c (do_test): Likewise.
1530         * tst-basic2.c (do_test): Likewise.
1531         * tst-barrier4.c (do_test): Likewise.
1532
1533 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
1534
1535         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
1536
1537 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
1538
1539         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1540         (__pthread_cond_timedwait): Optimize wakeup test.
1541         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1542         (__pthread_cond_wait): Likewise.
1543         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1544         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1545         Likewise.
1546
1547 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
1548
1549         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1550         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
1551         the atomic instruction needed.
1552         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1553         (__lll_mutex_lock_wait): Likewise.
1554
1555 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
1556
1557         * Makefile (tests): Add tst-cond14 and tst-cond15.
1558         * tst-cond14.c: New file.
1559         * tst-cond15.c: New file.
1560
1561 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
1562
1563         * sysdeps/pthread/createthread.c (create_thread): Remove use of
1564         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
1565         needs to be implemented differently to be useful.
1566
1567 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
1568
1569         * pthread_attr_setschedparam.c: Don't test priority against limits
1570         here.  Set ATTR_FLAG_SCHED_SET flag.
1571         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
1572         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
1573         from parent thread to child.  If attribute is used and scheduling
1574         parameters are not inherited, copy parameters from attribute or
1575         compute them.  Check priority value.
1576         * pthread_getschedparam.c: If the parameters aren't known yet get
1577         them from the kernel.
1578         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
1579         ATTR_FLAG_POLICY_SET flag for thread.
1580         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
1581         and ATTR_FLAG_POLICY_SET.
1582
1583         * sysdeps/pthread/createthread.c: Use tgkill if possible.
1584
1585         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
1586         fail if stack address hasn't been set.  Just return 0.
1587
1588 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
1589
1590         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
1591         libpthread for the files in this list.
1592         (CFLAGS-tst-unload): Removed.
1593         * tst-unload.c (do_test): Don't use complete path for
1594         LIBPHREAD_SO.
1595
1596         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
1597         tst-_res1mod2.
1598
1599 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
1600
1601         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1602         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
1603         operation per round is needed.
1604         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1605         (__lll_mutex_lock_wait): Likewise.
1606
1607 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
1608
1609         * tst-cancel9.c (cleanup): Don't print to stderr.
1610
1611 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1612
1613         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
1614
1615 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1616
1617         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1618         (__syscall_error_handler2): Call CDISABLE.
1619         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1620         (__syscall_error_handler2): Call CDISABLE.
1621
1622         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1623         Release lock before the loop, don't reacquire it.
1624
1625         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
1626
1627 2004-02-19  Andreas Schwab  <schwab@suse.de>
1628
1629         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1630         Fix last change.
1631
1632 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
1633
1634         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1635         (pthread_barrier_wait): After wakeup, release lock only when the
1636         last thread stopped using the barrier object.
1637         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
1638         (pthread_barrier_wait): Likewise.
1639         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1640         Likewise.
1641         * Makefile (tests): Add tst-barrier4.
1642         * tst-barrier4.c: New file.
1643
1644         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1645         (__pthread_cond_timedwait): Perform timeout test while holding
1646         internal lock to prevent wakeup race.
1647         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1648         * sysdeps/pthread/pthread_cond_timedwait.c
1649         (__pthread_cond_timedwait): Likewise.
1650         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1651         (__pthread_cond_timedwait): Likewise.
1652
1653 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
1654
1655         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
1656         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
1657         * Makefile (tests): Add tst-rwlock13.
1658         * tst-rwlock13.c: New test.
1659
1660 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
1661
1662         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1663         (__condvar_tw_cleanup): Little optimization.
1664         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1665
1666 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
1667
1668         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
1669         libpthread as "lib" parameter to SHLIB_COMPAT.
1670         (__novmx_siglongjmp): Fix typo in function name.
1671         (__novmx_longjmp): Fix typo in function name.
1672
1673 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1674
1675         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
1676         __builtin_expect.
1677
1678         * sysdeps/generic/pt-longjmp.c: Moved to...
1679         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
1680
1681 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
1682
1683         * Makefile (libpthread-routines): Add pt-cleanup.
1684         * pt-longjmp.c: Removed.
1685         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1686         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1687         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1688         Version longjmp, siglongjmp for GLIBC_2.3.4.
1689         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1690
1691 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1692
1693         * sysdeps/pthread/pthread_cond_timedwait.c
1694         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1695         Reuse code.  Add __builtin_expects.
1696
1697         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1698         (__pthread_cond_timedwait): Get internal lock in case timeout has
1699         passed before the futex syscall.
1700         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1701
1702 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1703
1704         * allocatestack.c: Pretty printing.
1705
1706         * sysdeps/pthread/createthread.c (create_thread): Don't add
1707         CLONE_DETACHED bit if it is not necessary.
1708
1709 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1710
1711         * pthread_getattr_np.c: Include ldsodefs.h.
1712
1713 2004-01-16  Richard Henderson  <rth@redhat.com>
1714
1715         * allocatestack.c: Don't declare __libc_stack_end.
1716         * init.c (__pthread_initialize_minimal_internal): Likewise.
1717         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1718
1719 2004-01-15  Richard Henderson  <rth@redhat.com>
1720
1721         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1722         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1723         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1724         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1725         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1726         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1727         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1728         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1729
1730 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1731
1732         * init.c (pthread_functions): Make array const.
1733
1734 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1735
1736         * allocatestack.c (__make_stacks_executable): Change interface.
1737         Check parameters.  Pass parameter on to libc counterpart.
1738         * pthreadP.h: Change declaration.
1739
1740 2004-01-13  Richard Henderson  <rth@redhat.com>
1741
1742         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1743         prototype form.
1744         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1745         Likewise.
1746
1747         * sysdeps/alpha/Makefile: New file.
1748         * sysdeps/alpha/tcb-offsets.sym: New file.
1749         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1750         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
1751
1752         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
1753         on powerpc version.
1754
1755 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
1756
1757         * Makefile (tests): Add tst-backtrace1.
1758         * tst-backtrace1.c: New test.
1759
1760 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
1761
1762         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
1763         register as second parameter to the REGISTER macro.
1764         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
1765         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
1766         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
1767         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
1768         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
1769         of thread register as second parameter to REGISTER macro in 64 case.
1770
1771 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
1772
1773         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
1774         (CFLAGS-getpid.o): Defined.
1775         (CFLAGS-getpid.os): Defined.
1776
1777 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
1778
1779         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
1780         returned for main thread does not overlap with any other VMA.
1781         Patch by Jakub Jelinek.
1782
1783 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
1784
1785         * tst-raise1.c: Include stdio.h.
1786
1787 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
1788
1789         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
1790         setting with __ASSUME_TGKILL || defined __NR_tgkill.
1791         If pid is 0, set it to selftid.
1792         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
1793         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
1794         != 0, return self->tid without doing a syscall.
1795         * descr.h (struct pthread): Move pid field after tid.
1796
1797         * Makefile (tests): Add tst-raise1.
1798         * tst-raise1.c: New file.
1799
1800 2003-12-23  Roland McGrath  <roland@redhat.com>
1801
1802         * tst-oddstacklimit.c: New file.
1803         * Makefile (tests): Add it.
1804         (tst-oddstacklimit-ENV): New variable.
1805
1806         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
1807         value up to page size for __default_stacksize.
1808
1809 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
1810
1811         * Makefile (tests): Add tst-eintr5.
1812         * tst-eintr5.c: New file.
1813
1814         * eintr.c (eintr_source): Prevent sending signal to self.
1815
1816         * tst-eintr2.c (tf1): Improve error message.
1817
1818 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
1819
1820         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
1821         * sysdeps/unix/sysv/linux/getpid.c: New file.
1822         * pthread_cancel.c: Add comment explaining use of PID field.
1823         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
1824         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
1825         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
1826         temporarily to signal the field must not be relied on and updated
1827         by getpid().
1828         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
1829         temporarily negative.
1830         * sysdeps/unix/sysv/linux/raise.c: Likewise.
1831
1832 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
1833
1834         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
1835         (eintr_source): If ARG != NULL, use pthread_kill.
1836         * tst-eintr1.c: Adjust for this change.
1837         * tst-eintr2.c: Likewise.
1838         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
1839         * tst-eintr3.c: New file.
1840         * tst-eintr4.c: New file.
1841
1842 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
1843
1844         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
1845         if CANCELSTATE_BITMASK is set.
1846         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
1847         Likewise.
1848
1849         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
1850         (tests-reverse): Add tst-cancel23.
1851         * tst-cancel22.c: New test.
1852         * tst-cancel23.c: New test.
1853
1854 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
1855
1856         * tst-eintr1.c: Better error messages.
1857
1858         * Makefile (tests): Add tst-eintr2.
1859         * tst-eintr2.c: New file.
1860
1861 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
1862
1863         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
1864         (CFLAGS-tst-cancelx21.c): Set.
1865         * tst-cancel21.c: New test.
1866         * tst-cancelx21.c: New test.
1867
1868         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
1869         comparison operand.
1870         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
1871         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
1872         * pt-longjmp.c: Include jmpbuf-unwind.h.
1873         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
1874         _JMPBUF_UNWINDS.  Adjust compared pointers.
1875         * init.c (__pthread_initialize_minimal_internal): Initialize
1876         pd->stackblock_size.
1877         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
1878         * sysdeps/alpha/jmpbuf-unwind.h: New file.
1879         * sysdeps/i386/jmpbuf-unwind.h: New file.
1880         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
1881         * sysdeps/s390/jmpbuf-unwind.h: New file.
1882         * sysdeps/sh/jmpbuf-unwind.h: New file.
1883         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
1884         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
1885         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
1886         (_JMPBUF_CFA_UNWINDS): Remove.
1887         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
1888
1889 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
1890
1891         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
1892         (CFLAGS-tst-cancelx20.c): Set.
1893         * tst-cancel20.c: New test.
1894         * tst-cancelx20.c: New test.
1895
1896 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
1897
1898         * init.c (__pthread_initialize_minimal_internal): Don't treat
1899         architectures with separate register stack special here when
1900         computing default stack size.
1901
1902 2003-12-17  Roland McGrath  <roland@redhat.com>
1903
1904         * Makefile (tst-cancelx7-ARGS): New variable.
1905         Reportd by Greg Schafer <gschafer@zip.com.au>.
1906
1907 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
1908
1909         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
1910         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
1911         (tst-stack3-ENV): Set.
1912         ($(objpfx)tst-stack3-mem): New.
1913         * tst-stack3.c: New test.
1914
1915 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
1916
1917         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
1918         Add unwind directives.  Drop unused .regstk directive.
1919         (_fini_EPILOG_BEGINS): Add unwind directives.
1920
1921 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
1922
1923         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1924         Assume parameter is a pointer.
1925         (lll_futex_wake): Likewise.
1926         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
1927         Likewise.
1928         (lll_futex_wake): Likewise.
1929         Reported by Boris Hu.
1930         * sysdeps/unix/sysv/linux/unregister-atfork.c
1931         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
1932
1933         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
1934
1935 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
1936
1937         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
1938         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
1939         __rtld_lock_initialize for ld.so lock.
1940         Patch in part by Adam Li <adam.li@intel.com>.
1941
1942 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
1943
1944         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
1945         in $(gnulib).  Also, remove stale comment.
1946
1947 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
1948
1949         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
1950         advantage of new syscall stub and optimize accordingly.
1951
1952         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
1953         from SYS_futex, to match expectations of
1954         sysdep.h:DO_INLINE_SYSCALL.
1955         (lll_futex_clobbers): Remove.
1956         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
1957         (lll_futex_wake): Likewise.
1958         (lll_futex_requeue): Likewise.
1959         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
1960         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
1961         Jelinek).
1962         (__lll_mutex_lock): Likewise.
1963         (__lll_mutex_cond_lock): Likewise.
1964         (__lll_mutex_timed_lock): Likewise.
1965         (__lll_mutex_unlock): Likewise.
1966         (__lll_mutex_unlock_force): Likewise.
1967
1968         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
1969         comes before the include of <sysdep.h>.
1970         (THREAD_SELF_SYSINFO): New macro.
1971         (THREAD_SYSINFO): Likewise.
1972         (INIT_SYSINFO): New macro.
1973         (TLS_INIT_TP): Call INIT_SYSINFO.
1974
1975         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
1976
1977         * sysdeps/pthread/createthread.c (create_thread): Use
1978         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
1979         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
1980         THREAD_SELF_SYSINFO instead of open code.
1981         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
1982         (THREAD_SYSINFO): Likewise.
1983
1984         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
1985
1986         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
1987
1988 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
1989
1990         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
1991         instead of .init.  Patch by David Mosberger.
1992
1993 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
1994
1995         * sysdeps/pthread/configure.in: Remove broken declaration in C
1996         cleanup handling check.
1997
1998 2003-11-30  Andreas Jaeger  <aj@suse.de>
1999
2000         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
2001         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
2002         Likewise.
2003
2004 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
2005
2006         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
2007         * pthread_attr_destroy.c: Include shlib-compat.h.
2008         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
2009         is set in iattr->flags.
2010         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
2011
2012 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
2013
2014         * Makefile (distribute): Add tst-cleanup4aux.c.
2015
2016         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
2017         include.
2018
2019 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
2020
2021         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
2022         pthread_cond_signal.
2023
2024         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
2025         store mutex address if the current value is ~0l.
2026         * sysdeps/pthread/pthread_cond_timedwait.c
2027         (__pthread_cond_timedwait): Likewise.
2028         * sysdeps/pthread/pthread_cond_broadcast.c
2029         (__pthread_cond_broadcast): Don't use requeue for pshared
2030         condvars.
2031
2032         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2033         (__pthread_cond_wait): Don't store mutex address if the current
2034         value is ~0l.
2035         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2036         (__pthread_cond_timedwait): Likewise.
2037         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2038         (__pthread_cond_broadcast): Don't use requeue for pshared
2039         condvars.
2040
2041         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
2042         element with ~0l for pshared condvars, with NULL otherwise.
2043
2044         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2045         (__pthread_cond_wait): Don't store mutex address if the current
2046         value is ~0l.
2047         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2048         (__pthread_cond_timedwait): Likewise.
2049         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2050         (__pthread_cond_broadcast): Don't use requeue for pshared
2051         condvars.
2052
2053         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
2054         * tst-cond12.c: New file.
2055         * tst-cond13.c: New file.
2056
2057 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
2058
2059         * sysdeps/pthread/configure.in: Make missing forced unwind support
2060         fatal.
2061
2062 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
2063
2064         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
2065
2066 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
2067
2068         * Makefile: Add magic to clean up correctly.
2069
2070 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
2071
2072         * unwind.c (FRAME_LEFT): Define.
2073         (unwind_stop): Handle old style cleanups here.
2074         (__pthread_unwind): Handle old style cleanups only if
2075         !HAVE_FORCED_UNWIND.
2076         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
2077         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
2078         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
2079         ($(objpfx)tst-cleanupx4): Likewise.
2080         * tst-cleanup4.c: New test.
2081         * tst-cleanup4aux.c: New.
2082         * tst-cleanupx4.c: New test.
2083
2084 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
2085
2086         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
2087         lll_mutex_*lock macros to skip atomic operations on some archs.
2088
2089 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
2090
2091         * sysdeps/pthread/tst-timer.c (main): Initialize
2092         sigev2.sigev_value as well.
2093
2094 2003-10-15  Roland McGrath  <roland@redhat.com>
2095
2096         * sysdeps/pthread/configure.in: Barf if visibility attribute support
2097         is missing.
2098         * sysdeps/pthread/configure: Regenerated.
2099
2100 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2101
2102         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
2103         locking macros.  No distinction between normal and mutex locking
2104         anymore.
2105         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
2106         Merge bits from lowlevelmutex.S we still need.
2107         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
2108         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
2109         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
2110         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
2111         new mutex implementation.
2112         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
2113         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2114         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2115         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2116         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2117         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2118         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2119         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2120         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2121         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
2122         symbol for entry point to avoid cancellation.
2123
2124 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
2125
2126         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
2127         changes.
2128         (SAVE_OLDTYPE_0): Fix a typo.
2129
2130 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
2131
2132         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2133         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
2134
2135 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2136
2137         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
2138         correct offset.
2139
2140 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
2141
2142         * Makefile (tests): Add tst-cancel19.
2143         * tst-cancel19.c: New test.
2144
2145 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2146
2147         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
2148         restoring of the old cancellation type.
2149
2150 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
2151
2152         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
2153
2154 2003-09-27  Wolfram Gloger  <wg@malloc.de>
2155
2156         * sysdeps/pthread/malloc-machine.h: New file
2157
2158 2003-09-24  Roland McGrath  <roland@redhat.com>
2159
2160         * allocatestack.c (__make_stacks_executable): Don't ignore return
2161         value from _dl_make_stack_executable.
2162
2163 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
2164
2165         * allocatestack.c (__make_stacks_executable): Also change
2166         permission of the currently unused stacks.
2167
2168         * allocatestack.c (change_stack_perm): Split out from
2169         __make_stacks_executable.
2170         (allocate_stack): If the required permission changed between the time
2171         we started preparing the stack and queueing it, change the permission.
2172         (__make_stacks_executable): Call change_stack_perm.
2173
2174         * Makefile: Build tst-execstack-mod locally.
2175         * tst-execstack-mod.c: New file.
2176
2177 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
2178
2179         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
2180
2181 2003-09-23  Roland McGrath  <roland@redhat.com>
2182
2183         * tst-execstack.c: New file.
2184         * Makefile (tests): Add it.
2185         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
2186         (LDFLAGS-tst-execstack): New variable.
2187
2188         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
2189         whether to use PROT_EXEC for stack mmap.
2190         (__make_stacks_executable): New function.
2191         * pthreadP.h: Declare it.
2192         * init.c (__pthread_initialize_minimal_internal): Set
2193         GL(dl_make_stack_executable_hook) to that.
2194
2195 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2196
2197         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
2198         recommendation from AMD re avoidance of lock prefix.
2199
2200 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
2201
2202         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
2203         lll_futex_timed_wait instead of lll_futex_wait.
2204         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
2205         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
2206         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
2207         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
2208         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
2209         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
2210         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
2211         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
2212         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
2213         Completely revamp the locking macros.  No distinction between
2214         normal and mutex locking anymore.
2215         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2216         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
2217         __lll_lock_timedwait): Fix prototypes.
2218         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
2219         __lll_lock_timedwait): Likewise.
2220         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
2221         macros, add __builtin_expect.
2222         (lll_mutex_timedlock): Likewise.  Fix return value.
2223         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
2224         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
2225         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
2226         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
2227         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
2228         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
2229         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
2230         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
2231
2232 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2233
2234         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2235         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
2236         operation if possible.
2237
2238         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
2239         like jumping over the lock prefix.
2240
2241 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
2242
2243         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
2244         locking macros.  No distinction between normal and mutex locking
2245         anymore.
2246         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2247         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2248         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2249         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
2250         locking.  Merge bits from lowlevelmutex.S we still need.
2251         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2252         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2253         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
2254         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
2255         * Makefile (routines): Remove libc-lowlevelmutex.
2256         (libpthread-rountines): Remove lowlevelmutex.
2257         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
2258         for new mutex implementation.
2259         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2260         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2261         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2262         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2263         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2264         Likewise.
2265         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2266         Likewise.
2267         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2268         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2269         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
2270         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2271         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2272         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2273         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2274         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2275         Likewise.
2276         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2277         Likewise.
2278         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2279         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2280         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2281         Don't use requeue.
2282         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2283         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
2284
2285 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
2286
2287         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
2288         in parameters of asm with output parameters.
2289
2290         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
2291         type of DECR parameter to int.
2292         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
2293
2294 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
2295
2296         * tst-attr3.c (tf, do_test): Print stack start/end/size and
2297         guardsize for each thread.
2298
2299 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
2300
2301         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
2302         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2303         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
2304
2305         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
2306         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
2307         NULL.
2308         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
2309         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
2310         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2311         (pthread_getaffinity_np): Add hidden_def.
2312
2313         * Makefile (tests): Add tst-attr3.
2314         * tst-attr3.c: New test.
2315
2316         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
2317
2318 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
2319
2320         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
2321         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
2322
2323 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
2324
2325         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
2326         * tst-align.c: Include tst-stack-align.h.
2327         (tf, do_test): Use TEST_STACK_ALIGN macro.
2328
2329 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
2330
2331         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
2332         variable.
2333
2334 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
2335
2336         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
2337         stack-related values for the initial thread.
2338
2339 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
2340
2341         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
2342
2343 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
2344
2345         * pthread_mutex_lock.c: Minor code rearrangements.
2346
2347 2003-09-05  Roland McGrath  <roland@redhat.com>
2348
2349         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
2350         Instead, include ../nptl_db/db_info.c to do its magic.
2351         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
2352         (__pthread_pthread_key_2ndlevel_size): Likewise.
2353         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
2354         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
2355         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
2356         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
2357         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
2358         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
2359         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
2360         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
2361         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
2362         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
2363         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
2364         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
2365         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
2366         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
2367         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
2368         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
2369         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
2370
2371 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
2372
2373         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
2374         of pthread_t to be compatible with LT.
2375         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2376         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2377         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2378         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2379         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
2380         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2381         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2382
2383 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
2384
2385         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
2386
2387 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
2388
2389         * unwind-forcedunwind.c: Move to...
2390         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
2391         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
2392         * sysdeps/pthread/jmpbuf-unwind.h: New file.
2393         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
2394         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
2395         * unwind.c: Include jmpbuf-unwind.h.
2396         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
2397
2398 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
2399
2400         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
2401         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
2402         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
2403         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
2404         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2405         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
2406         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
2407         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
2408         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
2409         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
2410         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
2411         function.
2412         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
2413         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
2414         * Makefile (tests): Add tst-stack2.
2415         * tst-stack2.c: New test.
2416         * tst-stack1.c: Include limits.h and sys/param.h.
2417         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
2418
2419         * pthread_condattr_setpshared.c: Include errno.h.
2420         (pthread_condattr_setpshared): Return EINVAL if pshared
2421         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
2422
2423         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
2424         defined symbol for entry point to avoid cancellation.
2425         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2426         Likewise.
2427         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2428         Likewise.
2429         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2430         Likewise.
2431         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
2432         Likewise.
2433         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2434         Likewise.
2435         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
2436         __close_nocancel, __read_nocancel, __write_nocancel,
2437         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
2438         libpthread.so or librt.so, define to corresponding function
2439         without _nocancel suffix.
2440         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
2441         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
2442         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
2443
2444         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
2445
2446 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
2447
2448         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
2449         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
2450
2451         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
2452         in subsections has a symbol associated with it.
2453
2454         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
2455         defined symbol for entry point to avoid cancellation.
2456         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
2457
2458 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2459
2460         * Makefile (tests): Add tst-tls5.
2461         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
2462         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
2463         ($(objpfx)tst-tls5): New.
2464         ($(objpfx)tst-tls6.out): Likewise.
2465         (tests): Depend on $(objpfx)tst-tls6.out.
2466         * tst-tls3.c: Include stdint.h and pthreaddef.h.
2467         (do_test): Check pthread_self () return value alignment.
2468         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
2469         (tf): Check pthread_self () return value alignment.
2470         * tst-tls5.c: New test.
2471         * tst-tls5.h: New.
2472         * tst-tls5mod.c: New.
2473         * tst-tls5moda.c: New.
2474         * tst-tls5modb.c: New.
2475         * tst-tls5modc.c: New.
2476         * tst-tls5modd.c: New.
2477         * tst-tls5mode.c: New.
2478         * tst-tls5modf.c: New.
2479         * tst-tls6.sh: New test.
2480
2481         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
2482         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
2483         * init.c (pthread_functions): Initialize them.
2484         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
2485         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
2486         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
2487         pthread_cond_timedwait@@GLIBC_2.3.2.
2488
2489 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2490
2491         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
2492         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
2493         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
2494         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
2495         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
2496         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2497
2498         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
2499
2500         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
2501         _POSIX_THREAD_PRIORITY_SCHEDULING.
2502         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2503
2504 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
2505
2506         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
2507         nested function, use static inline function from libio.h.
2508         Code by Richard Henderson.
2509
2510         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
2511         weak.
2512
2513 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
2514
2515         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
2516         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
2517         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
2518         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
2519         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
2520         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
2521         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
2522         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
2523         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
2524         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
2525         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
2526         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
2527         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
2528         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
2529         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
2530         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
2531         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
2532         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
2533         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
2534         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
2535         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
2536         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
2537         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
2538         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
2539         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
2540         * sysdeps/sparc/tls.h: New file.
2541         * sysdeps/sparc/tcb-offsets.sym: New file.
2542         * sysdeps/sparc/Makefile: New file.
2543         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
2544         * init.c [__sparc__] (__NR_set_tid_address): Define.
2545
2546 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
2547
2548         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
2549         _IO_release_lock): Define.
2550
2551 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
2552
2553         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
2554         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
2555
2556 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
2557
2558         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
2559         (__pthread_cleanup_class): Add missing return types of member
2560         functions.
2561
2562 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
2563
2564         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2565         (lll_mutex_unlock_force): Add memory barrier between store and futex
2566         syscall.
2567
2568 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
2569
2570         * tst-cancel4.c (do_test): Also unlink tempfname and remove
2571         tempmsg in first loop.
2572
2573 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
2574
2575         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2576         _POSIX_THREAD_PRIORITY_SCHEDULING.
2577         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2578
2579 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2580
2581         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
2582         (__rtld_lock_default_lock_recursive,
2583         __rtld_lock_default_unlock_recursive): Define.
2584         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
2585         __rtld_lock_unlock_recursive): Define using
2586         GL(_dl_rtld_*lock_recursive).
2587         * init.c (__pthread_initialize_minimal_internal): Initialize
2588         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
2589         Lock GL(_dl_load_lock) the same number of times as
2590         GL(_dl_load_lock) using non-mt implementation was nested.
2591
2592         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
2593         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2594
2595 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
2596
2597         * tst-cancel17.c (do_test): Make len2 maximum of page size and
2598         PIPE_BUF.
2599
2600 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2601
2602         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2603
2604 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
2605
2606         * sysdeps/pthread/createthread.c (do_clone): Move error handling
2607         to first syscall error check.  Move syscall error check for tkill
2608         into __ASSUME_CLONE_STOPPED #ifdef.
2609
2610 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
2611
2612         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
2613         is not defined, do explicit synchronization.
2614         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
2615         is not defined also unlock pd->lock for non-debugging case in case
2616         it is necessary.
2617         * pthread_create.c (start_thread): Always get and release pd->lock
2618         if __ASSUME_CLONE_STOPPED is not defined.
2619         (start_thread_debug): Removed.  Adjust users.
2620         * allocatestack.c (allocate_stack): Always initialize lock if
2621         __ASSUME_CLONE_STOPPED is not defined.
2622         * Makefile (tests): Add tst-sched1.
2623         * tst-sched1.c: New file.
2624
2625         * sysdeps/pthread/createthread.c (do_clone): Only use
2626         sched_setschduler and pass correct parameters.
2627
2628 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2629
2630         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
2631         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
2632         PTHREAD_STACK_MIN in comments.
2633
2634 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2635
2636         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2637         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
2638         argument.
2639         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
2640         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
2641         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
2642         (__pthread_cleanup_upto): Fix prototype.
2643         (_longjmp_unwind): Adjust caller.
2644         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
2645         Change second argument to const struct pointer.
2646         * tst-sem8.c (main): Remove unused s2 and s3 variables.
2647         * tst-sem9.c (main): Likewise.
2648         * unwind.c: Include string.h for strlen prototype.
2649
2650 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
2651
2652         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2653         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
2654         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
2655         Define HAVE_CMOV.
2656         Patch by Nicholas Miell <nmiell@attbi.com>.
2657
2658 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
2659
2660         * init.c (__pthread_initialize_minimal_internal): Initialize
2661         GL(dl_init_static_tls).
2662         * pthreadP.h (__pthread_init_static_tls): New prototype.
2663         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
2664         New functions.
2665         * Makefile (tests): Add tst-tls4.
2666         (modules-names): Add tst-tls4moda and tst-tls4modb.
2667         ($(objpfx)tst-tls4): Link against libdl and libpthread.
2668         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
2669         tst-tls4modb.so.
2670         * tst-tls4.c: New file.
2671         * tst-tls4moda.c: New file.
2672         * tst-tls4modb.c: New file.
2673
2674 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
2675
2676         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
2677         before __timer_dealloc.
2678         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
2679         Don't call list_unlink.
2680
2681 2003-07-29  Roland McGrath  <roland@redhat.com>
2682
2683         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2684
2685 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2686
2687         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2688         Don't reuse struct aiocb A if it failed.
2689         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2690         not just one byte, as that does not block.
2691
2692 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2693
2694         * sysdeps/pthread/unwind-resume.c: New file.
2695         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2696         unwind-resume in csu subdir.
2697         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2698         exceptions.
2699         (librt-sysdep_routines, librt-shared-only-routines): Add
2700         rt-unwind-resume.
2701         * sysdeps/pthread/rt-unwind-resume.c: New file.
2702         * unwind-forcedunwind.c: New file.
2703         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2704         (libpthread-shared-only-routines): Likewise.
2705         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2706         * pthreadP.h (pthread_cancel_init): New prototype.
2707         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2708
2709         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2710         attr argument const struct pthread_attr *.
2711
2712         * res.c (__res_state): Return __resp.
2713         * descr.h: Include resolv.h.
2714         (struct pthread): Add res field.
2715         * pthread_create.c: Include resolv.h.
2716         (start_thread): Initialize __resp.
2717         * Makefile (tests): Add tst-_res1.
2718         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2719         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2720         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2721         libpthread.
2722         * tst-_res1.c: New file.
2723         * tst-_res1mod1.c: New file.
2724         * tst-_res1mod2.c: New file.
2725
2726 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2727
2728         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2729
2730         * Makefile: Define various *-no-z-defs variables for test DSOs
2731         which has undefined symbols.
2732
2733 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2734
2735         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2736         Retry if the stwcx fails to store once_control.
2737
2738 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2739
2740         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2741         pthread_attr_setaffinity.
2742         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2743         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2744         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2745         * pthread_attr_destroy.c: Free cpuset element if allocated.
2746         * pthread_create.c: Pass iattr as additional parameter to
2747         create_thread.
2748         * sysdeps/pthread/createthread.c: If attribute is provided and
2749         a new thread is created with affinity set or scheduling parameters,
2750         start thread with CLONE_STOPPED.
2751         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
2752         pthread_attr_setaffinity.
2753         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2754         cpuset element.
2755
2756 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
2757
2758         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2759
2760 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
2761
2762         * sysdeps/pthread/configure.in: Require CFI directives also for
2763         ppc and s390.
2764
2765 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
2766
2767         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2768         Add cfi directives.
2769
2770 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2771
2772         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
2773         CLEANUP_JMP_BUF.
2774         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
2775         registers as variables.  Call __pthread_mutex_unlock_usercnt.
2776         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2777         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
2778         not self pointer in __writer.  Compare with TID to determine
2779         deadlocks.
2780         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2781         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2782         Likewise.
2783         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2784         Likewise.
2785         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
2786         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
2787         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
2788         macros also when compiling librt.
2789
2790 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
2791
2792         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
2793         -fasynchronous-unwind-tables.
2794         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2795         (PSEUDO): Add cfi directives.
2796         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
2797         Likewise.
2798         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2799         Likewise.
2800
2801 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
2802
2803         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
2804         __pthread_unregister_cancel): Add prototypes and hidden_proto.
2805         * unwind.c (__pthread_unwind_next): Add hidden_def.
2806         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
2807         Likewise.
2808         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2809         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2810         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2811         Likewise.
2812         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
2813         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2814         Likewise.
2815         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
2816         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
2817         __pthread_unregister_cancel and __pthread_unwind_next.
2818
2819 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
2820
2821         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
2822         different symbol for the cancellation syscall wrapper and
2823         non-cancellation syscall wrapper.
2824         (PSEUDO_END): Define.
2825
2826 2003-07-05  Richard Henderson  <rth@redhat.com>
2827
2828         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
2829         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
2830         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
2831         return actual return value from the syscall, not 0.
2832
2833 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
2834
2835         * descr.h (struct pthread): Add pid field.
2836         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
2837         (__reclaim_stacks): Likewise.
2838         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
2839         also check for PID of the signal source.
2840         (__pthread_initialize_minimal_internal): Also initialize pid field
2841         of initial thread's descriptor.
2842         * pthread_cancel.c: Use tgkill instead of tkill if possible.
2843         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2844         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
2845         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2846         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2847
2848 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
2849
2850         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
2851         Fix use of parameter.
2852         (__libc_cleanup_pop): Likewise.
2853
2854 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
2855
2856         * init.c (sigcancel_handler): Change parameters to match handler
2857         for SA_SIGACTION.  Check signal number and code to recognize
2858         invalid invocations.
2859
2860 2003-07-03  Roland McGrath  <roland@redhat.com>
2861
2862         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
2863         Apply sizeof (struct pthread) bias to r13 value.
2864
2865 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
2866
2867         * sysdeps/pthread/configure.in: Require CFI directives.
2868
2869         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
2870         definition.
2871         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
2872         libpthread compilation.
2873         * unwind.c (__pthread_unwind): Add hidden_def.
2874         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2875
2876 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2877
2878         * libc-cancellation.c (__libc_cleanup_routine): Define.
2879         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
2880         (__pthread_cleanup_pop): Define.
2881
2882 2003-07-01  Richard Henderson  <rth@redhat.com>
2883
2884         * sysdeps/alpha/elf/pt-initfini.c: New file.
2885         * sysdeps/alpha/pthread_spin_lock.S: New file.
2886         * sysdeps/alpha/pthread_spin_trylock.S: New file.
2887         * sysdeps/alpha/pthreaddef.h: New file.
2888         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
2889         * sysdeps/alpha/tls.h: New file.
2890         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
2891         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
2892         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
2893         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
2894         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
2895         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
2896         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
2897         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
2898         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
2899         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2900
2901 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
2902
2903         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
2904         cleanup support and unwind info.
2905
2906 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
2907
2908         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2909         Use correct cleanup handler registration.  Add unwind info.
2910         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
2911         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
2912         * tst-once3.c: Add cleanup handler and check it is called.
2913         * tst-once4.c: Likewise.
2914         * tst-oncex3.c: New file.
2915         * tst-oncex4.c: New file.
2916         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2917
2918 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
2919
2920         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2921
2922 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
2923
2924         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
2925         (tf_msgsnd): Likewise.
2926
2927         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
2928         premature returns a bit more.
2929
2930 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
2931
2932         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
2933         definition to the front.
2934
2935         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
2936         the cleanup functions to make the names unique.  Fix dwarf opcode
2937         un unwind table.
2938         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
2939         functions to make the names unique.  Fix CFA offset for two blocks.
2940
2941 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
2942
2943         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
2944         missing closing braces.
2945         Patch by Christophe Saout <christophe@saout.de>.
2946
2947 2003-06-24  Roland McGrath  <roland@redhat.com>
2948
2949         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2950
2951 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
2952
2953         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
2954         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
2955
2956         * pthreadP.h: Declare __find_thread_by_id.
2957         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
2958         * pthread_clock_gettime.c: Allow using other thread's clock.
2959         * pthread_clock_settime.c: Likewise.
2960         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2961         * Makefile: Add rules to build and run tst-clock2.
2962         * tst-clock2.c: New file.
2963
2964 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
2965
2966         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
2967         to use exception-based cleanup handler.
2968         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2969
2970         * tst-cond8.c (ch): Announce that we are done.
2971
2972         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
2973
2974         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
2975         Also test aio_suspend with timeout value.
2976
2977 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
2978
2979         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
2980         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
2981         attribute_hidden.
2982
2983         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
2984         (__pthread_mutex_lock_internal): Likewise.
2985         (__pthread_mutex_unlock_internal): Likewise.
2986         (__pthread_mutex_unlock_usercnt): Declare.
2987         * pthread_mutex_destroy.c: Always fail if used in any way.
2988         * pthread_mutex_init.c: Update comment.
2989         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
2990         * pthread_mutex_timedlock.c: Adjust __nusers.
2991         * pthread_mutex_trylock.c: Adjust __nusers.
2992         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
2993         and public interfaces are wrapper with pass additional parameter.
2994         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
2995         parameter zero.
2996         * tst-mutex8.c: New file.
2997         * Makefile (tests): Add tst-mutex8.
2998         * sysdeps/pthread/pthread_cond_timedwait.c: Call
2999         __pthread_mutex_unlock_usercnt.
3000         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3001         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3002         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3003         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3004         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3005         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
3006         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3007         Add __nusers.
3008         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3009         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3010         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3011         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3012         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3013
3014         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
3015         * pthread_mutex_timedlock.c: Likewise.
3016         * pthread_mutex_trylock.c: Adjust __nusers.
3017         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
3018         * tst-mutex9.c: New file.
3019         * Makefile (tests): Add tst-mutex9.
3020         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
3021         * sysdeps/ia64/tls.h: Likewise.
3022         * sysdeps/powerpc/tls.h: Likewise.
3023         * sysdeps/s390/tls.h: Likewise.
3024         * sysdeps/sh/tls.h: Likewise.
3025         * sysdeps/x86_64/tls.h: Likewise.
3026         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3027         Change type of __owner.
3028         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3029         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3030         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3031         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3032         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3033
3034 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
3035
3036         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
3037         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
3038
3039         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
3040         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
3041         instead of nr to lll_futex_wake.  Only set errno and return -1
3042         if err < 0.
3043
3044         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
3045         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3046         return actual return value from the syscall, not 0.
3047
3048 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
3049
3050         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
3051         find a random value.
3052         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
3053         errno==EIDRM.
3054
3055         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
3056         compat_timer_settime.
3057         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
3058         compat_timer_gettime.
3059         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
3060         compat_timer_getoverrun.
3061         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
3062         compat_timer_delete.
3063
3064         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
3065         error-checking mutex detect busy mutexes.
3066
3067 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3068
3069         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
3070         Add ax to clobber list.
3071         (lll_mutex_cond_lock): Likewise.
3072         (lll_mutex_unlock): Likewise.
3073         (lll_lock): Likewise.
3074         (lll_unlock): Likewise.
3075
3076         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
3077         * tst-cancel18.c: New file.
3078         * tst-cancelx18.c: New file.
3079
3080         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
3081         and tcdrain.
3082
3083         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
3084         * tst-cancel17.c: New file.
3085         * tst-cancelx17.c: New file.
3086
3087         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
3088         * sysdeps/unix/sysv/linux/sigwait.c: New file.
3089         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
3090
3091         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
3092
3093 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
3094
3095         * sysdeps/pthread/createthread.c (create_thread): Set
3096         header.multiple_threads unconditionally.
3097         * allocatestack.c (allocate_stack): Likewise.
3098         * descr.h (struct pthread): Add header.multiple_threads
3099         unconditionally.
3100         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
3101         Define for librt.  #error if neither libpthread, libc nor librt.
3102         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
3103         Likewise.
3104         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
3105         CDISABLE): Likewise.
3106         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
3107         CDISABLE): Likewise.
3108         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
3109         CDISABLE): Likewise.
3110         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
3111         CDISABLE): Likewise.  Access header.multiple_threads outside of
3112         libc and libpthread.
3113         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
3114         Likewise.
3115         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
3116         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
3117
3118 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3119
3120         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
3121         Also test early cancellation before the thread reaches the cancellation
3122         point.
3123
3124         * Makefile: Compile forward.c with exceptions.
3125
3126         * sysdeps/unix/sysv/linux/sleep.c: New file.
3127
3128 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
3129
3130         * Makefile: Add CFLAGS definition to compile function wrappers
3131         duplicated from libc with exceptions.
3132         * tst-cancel4.c: Also check cancellation handlers.
3133
3134         * Makefile: Add rules to build and run tst-cancel16 and
3135         tst-cancelx16.  Add missing CFLAGS definitions.
3136         * tst-cancel16.c: New file.
3137         * tst-cancelx16.c: New file.
3138
3139 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
3140
3141         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3142         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
3143         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
3144         (DL_SYSINFO_IMPLEMENTATION): Likewise.
3145
3146         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
3147         (LIBC_CANCEL_RESET): Likewise.
3148         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
3149         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
3150         librt-cancellation.
3151         (CFLAGS-libcrt-cancellation.c): Define.
3152         * sysdeps/pthread/librt-cancellation.c: New file.
3153         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
3154         macros also when compiling librt.
3155         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3156         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3157         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3158         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3159         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3160         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3161         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3162
3163         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
3164         compat_timer_create.
3165
3166 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
3167
3168         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
3169
3170         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
3171         __register_atfork.
3172         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
3173         Add libc_hidden_def.
3174
3175 2003-06-13  Roland McGrath  <roland@redhat.com>
3176
3177         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
3178         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
3179
3180 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
3181
3182         * allocatestack.c (queue_stack): Always inline.
3183         * ptreadhP.h (__do_cancel): Likewise.
3184
3185 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
3186
3187         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
3188         a typo.
3189
3190 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
3191
3192         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3193         (__pthread_cond_signal): Remove incorrect second addition for
3194         cond_lock!=0.
3195
3196 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
3197
3198         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3199         (__pthread_cond_signal): Use correct futex pointer in
3200         __lll_mutex_lock_wait call.
3201
3202         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3203         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
3204
3205 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
3206
3207         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
3208         cancelable.
3209         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
3210         Likewise.
3211
3212         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
3213         hand-written CFI generation code.  Since ENTRY/END also initiated
3214         CFI frames this caused two CFI sets to be generated.
3215
3216 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
3217
3218         * cleanup_routine.c: New file.
3219         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
3220         * sysdeps/pthread/pthread.h: Add support for fully exception-based
3221         cleanup handling.
3222         * Makefile (libpthread-routines): Add cleanup_routine.
3223         Add more CFLAGS variables to compile with exceptions.  Add comments
3224         why which file needs unwind tables.
3225         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
3226         tests.
3227         * tst-cancelx1.c: New file.
3228         * tst-cancelx2.c: New file.
3229         * tst-cancelx3.c: New file.
3230         * tst-cancelx4.c: New file.
3231         * tst-cancelx5.c: New file.
3232         * tst-cancelx6.c: New file.
3233         * tst-cancelx7.c: New file.
3234         * tst-cancelx8.c: New file.
3235         * tst-cancelx9.c: New file.
3236         * tst-cancelx10.c: New file.
3237         * tst-cancelx11.c: New file.
3238         * tst-cancelx12.c: New file.
3239         * tst-cancelx13.c: New file.
3240         * tst-cancelx14.c: New file.
3241         * tst-cancelx15.c: New file.
3242         * tst-cleanupx0.c: New file.
3243         * tst-cleanupx0.expect: New file.
3244         * tst-cleanupx1.c: New file.
3245         * tst-cleanupx2.c: New file.
3246         * tst-cleanupx3.c: New file.
3247
3248         * tst-cleanup0.c: Make standard compliant.
3249         * tst-cleanup1.c: Likewise.
3250
3251         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
3252         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3253         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3254         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3255         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3256         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3257         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
3258         CLEANUP_JMP_BUF.
3259         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3260         * tst-cancel12.c: New file.
3261         * tst-cancel13.c: New file.
3262         * tst-cancel14.c: New file.
3263         * tst-cancel15.c: New file.
3264         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
3265         and tst-cancel15.
3266
3267         * tst-cancel1.c: Add some comments.
3268
3269         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
3270         timeout correctly.
3271
3272 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
3273
3274         * Makefile (CFLAGS-pthread_cancel.c): Define.
3275
3276 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
3277
3278         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
3279         Change type of __writer element to int.
3280         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3281         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3282         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3283         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3284         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3285         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
3286         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3287         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
3288         Compare with TID to determine deadlocks.
3289         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
3290         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3291         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
3292         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3293         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3294         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3295         Likewise.
3296         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3297         Likewise.
3298         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3299         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3300         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3301         Likewise.
3302         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3303         Likewise.
3304         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3305         * Makefile (tests): Add tst-rwlock12.
3306         * tst-rwlock12.c: New file.
3307
3308 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
3309
3310         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
3311         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
3312         Remove bogus hidden_proto.
3313         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
3314         Likewise.
3315         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
3316         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
3317         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
3318         ___lll_mutex_timedlock): Likewise.
3319
3320 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
3321
3322         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3323         (__pthread_cond_signal): Add some code to eventually handle
3324         cond_lock!=0.
3325
3326 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
3327
3328         * Makefile (tests): Add tst-exec4.
3329         (tst-exec4-ARGS): Define.
3330         * tst-exec4.c: New file.
3331
3332 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
3333
3334         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3335         Also fail if tv_nsec < 0.
3336         (__lll_timedwait_tid): Likewise.
3337         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
3338         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
3339         Likewise.
3340         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
3341         Likewise.
3342         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
3343         Likewise.
3344         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
3345         Likewise.
3346         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
3347         Likewise.
3348         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
3349         Likewise.
3350
3351         * Makefile (tests): Add tst-sem8 and tst-sem9.
3352         * tst-sem8.c: New file.
3353         * tst-sem9.c: New file.
3354         * sem_open.c: Fix creation of in_use record if the file exists but
3355         no internal record.
3356
3357         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
3358         definitions.
3359
3360         * sysdeps/pthread/timer_create.c (timer_create): In case
3361         evp==NULL, assign timer ID to sival_ptr.
3362
3363         * descr.h (struct pthread_unwind_buf): Change type of prev element to
3364         struct pthread_unwind_buf *.
3365         (struct pthread): Likewise for cleanup_jmp_buf element.
3366
3367         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
3368         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
3369         * unwind.c (__pthread_unwind_next): Likewise.
3370
3371 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
3372
3373         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3374         (lll_futex_timed_wait): Use int for futex value parameter.
3375         (lll_futex_wake): Likewise.
3376         (lll_futex_requeue): Likewise.
3377
3378         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3379         Replace one memory operation with one register operation.
3380
3381         * tst-join4.c (do_test): Fix error message.
3382
3383         * tst-rwlock6.c (do_test): Use correct format specifier.
3384
3385         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3386         (__lll_mutex_lock_wait): Replace one memory operation with one
3387         register operation.
3388         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
3389         (__lll_mutex_lock_wait): Likewise.
3390
3391         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3392         (__lll_mutex_cond_lock): Add one to value parameter of
3393         __lll_lock_wait to reflect reality in the futex syscall.
3394         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3395         (lll_mutex_cond_lock): Likewise.
3396
3397 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3398
3399         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
3400         New function.
3401         (lll_mutex_cond_lock): Define.
3402
3403 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
3404
3405         * Makefile (tests): Add tst-signal6.
3406         * tst-signal6.c: New file.
3407
3408         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
3409         (__lll_mutex_unlock_force): New function
3410         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3411
3412         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3413         (__lll_mutex_unlock_force): New function.
3414         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3415
3416         * tst-rwlock7.c (do_test): Use correct format specifier.
3417
3418         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
3419         Find break parameter in correct asm argument.
3420
3421 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
3422
3423         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
3424         Remove out4.
3425         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
3426         error occured.
3427         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3428         Add __mutex.
3429         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
3430         lll_futex_requeue, lll_mutex_unlock_force): Define.
3431
3432 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3433
3434         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3435         (pthread_cond_t): Add __mutex.
3436         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
3437         lll_futex_requeue, lll_mutex_unlock_force): Define.
3438
3439 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3440
3441         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
3442         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3443         Add __mutex field.
3444         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
3445         Define.
3446         (lll_futex_wait, lll_futex_wake): Define.
3447         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
3448         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
3449         FUTEX_REQUEUE instead of FUTEX_WAIT.
3450         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3451         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
3452         mutex which was used in condvar structure.  Call
3453         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
3454         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3455
3456         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
3457         include tcb-offsets.h.  Read wakeup value in locked region.
3458         Use the value of gbr register as THREAD_ID.
3459         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3460         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3461         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3462
3463         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
3464         macros.
3465
3466 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
3467
3468         * sysdeps/pthread/pthread_cond_broadcast.c
3469         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
3470
3471 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
3472
3473         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
3474         typo in register name.
3475         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
3476         correctly.  Actually use requeue.  Little optimization.
3477         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
3478         mutex address early.  Handle cancellation state as 32-bit value.
3479         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3480         Remove unnecessary label.
3481
3482 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
3483
3484         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
3485         instead of FUTEX_WAIT.
3486         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
3487         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3488         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3489         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3490         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3491         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
3492         used in condvar structure.  Call __pthread_mutex_cond_lock instead
3493         of __pthread_mutex_lock_internal.
3494         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3495         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3496         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3497         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
3498         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3499         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3500         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
3501         Add pthread_mutex_cond_lock.
3502         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
3503         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
3504         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
3505         lll_mutex_cond_lock.
3506         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3507         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3508         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3509         Add __mutex field.
3510         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3511         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3512
3513         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
3514         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3515
3516         * pthreadP.h: Declare __pthread_mutex_cond_lock.
3517         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
3518         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
3519         macro don't define aliases.
3520
3521         * cancellation.c: Remove __pthread_enable_asynccancel_2.
3522         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
3523         * sysdeps/pthread/pthread_cond_timedwait.c: Use
3524         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
3525         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3526         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3527         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3528         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3529         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3530
3531 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
3532
3533         * sem_open.c: Fix one endless loop.  Implement correct semantics
3534         wrt opening the same semaphore more then once.
3535         * sem_close.c: Adjust for sem_open change.
3536         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
3537         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
3538         * Makefile (tests): Add tst-sem7.
3539         * tst-sem7.c: New file.
3540
3541 2003-05-16  Roland McGrath  <roland@redhat.com>
3542
3543         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
3544         uninitialized variable braino.
3545
3546 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
3547
3548         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
3549         test for syscall availability.
3550
3551         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
3552         __no_posix_timers to -1 if the syscalls don't exist.
3553
3554         * pthread_join.c (pthread_join): Set tid field of the joined
3555         thread to -1.  This isn't necessary but helps to recognize some
3556         error conditions with almost no cost.
3557
3558         * allocatestack.c (FREE_P): Also negative values indicate an
3559         unused stack.
3560
3561         * unwind.c: Include <unistd.h>.
3562
3563 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
3564
3565         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
3566
3567 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
3568
3569         * Makefile (crti-objs, crtn-objs): New variables.
3570         (omit-deps, extra-objs): Add crtn.
3571         ($(objpfx)libpthread.so): Depend on both crti and crtn
3572         and links to them in multidir.
3573         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
3574
3575 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
3576
3577         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3578         (lll_mutex_unlock): Use atomic_exchange_rel.
3579
3580 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
3581
3582         * cond-perf.c (cons): Add missing locking around setting of alldone.
3583
3584 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
3585
3586         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
3587         related macros.
3588         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3589
3590 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
3591
3592         * tst-sem6.c: New file.
3593         * Makefile (tests): Add tst-sem6.
3594
3595         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
3596         Use atomic_exchange_rel instead of atomic_exchange.
3597         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
3598         Likewise.
3599
3600         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
3601         code for lll_futex_wait and lll_futex_wake in static apps.  Use
3602         vsyscall is possible.
3603
3604         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
3605         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
3606         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
3607         pthread_setaffinity_np.
3608         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
3609         and pthread_setaffinity_np.
3610         * Makefile (libpthread-routines): Add pthread_getaffinity and
3611         pthread_setaffinity.
3612
3613         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
3614         use it in case mmap to allocate the stack fails.
3615         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
3616         ARCH_MAP_FLAGS here.
3617         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
3618         ARCH_RETRY_MMAP.
3619
3620 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
3621
3622         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
3623         handler implementation.  It is now lockless in fork().
3624         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3625         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3626         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
3627         declare the __fork_*_lists.
3628         (struct fork_handler): Include pointers to all three functions.
3629         Add next, refcntr and need_signal elements.
3630         (__fork_handlers): New declaration.
3631         (__register_atfork_malloc): Remove declaration.
3632         (HAVE_register_atfork_malloc): Remove definition.
3633         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
3634         __pthread_child_handler variable.
3635         (__libc_pthread_init): Use __register_atfork instead of explicitly
3636         adding to the list.
3637         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
3638         and lll_futex_wake.
3639         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3640
3641         * unwind.c (unwind_cleanup): Print error message and then abort.  This
3642         function must never be reached.
3643
3644         * cond-perf.c: New file.
3645
3646 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
3647
3648         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
3649
3650 2003-05-04  Roland McGrath  <roland@redhat.com>
3651
3652         * Makefile ($(objpfx)../libc.so): New target.
3653
3654 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
3655
3656         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3657         (pthread_condattr_t): Size is only an int, don't use long for
3658         alignment.
3659         (pthread_mutexattr_t): Likewise.
3660         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3661         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3662         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3663
3664 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
3665
3666         * sysdeps/i386/tls.h: Define THREAD_ID.
3667         * sysdeps/ia64/tls.h: Likewise.
3668         * sysdeps/powerpc/tls.h: Likewise.
3669         * sysdeps/s390/tls.h: Likewise.
3670         * sysdeps/sh/tls.h: Likewise.
3671         * sysdeps/x86_64/tls.h: Likewise.
3672         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
3673         record ownership.
3674         * pthread_mutex_timedlock.c: Likewise.
3675         * pthread_mutex_trylock.c: Likewise.
3676         * pthread_mutex_unlock.c: Likewise.
3677         * pthread_rwlock_trywrlock.c: Likewise.
3678         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
3679         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3680         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3681         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3682
3683         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
3684         flag.
3685
3686 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3687
3688         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3689         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3690         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3691         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3692         Make __align long long instead of long.
3693         (pthread_rwlock_t): Formatting.
3694         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3695         (pthread_rwlock_t): Formatting.
3696         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3697         (pthread_cond_t): Make __align long long instead of long.
3698         (pthread_rwlock_t): Move __flags field to the same position as in
3699         linuxthreads.
3700
3701 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3702
3703         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3704         * tst-rwlock7.c (do_test): Likewise.
3705
3706 2003-04-26  Roland McGrath  <roland@redhat.com>
3707
3708         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3709
3710 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3711
3712         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3713         sizeof (struct pthread).
3714         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3715         1 struct pthread.
3716         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3717         to 0.
3718         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3719         struct pthread.
3720         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3721         to 32-bit bytes.
3722         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3723         tcbp.
3724         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3725         unneccessarily.
3726         (NO_TLS_OFFSET): Define.
3727         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3728         add TLS_TCB_SIZE unnecessarily.
3729
3730 2003-04-22  Roland McGrath  <roland@redhat.com>
3731
3732         * Makeconfig (shared-thread-library): Reverse link order to work
3733         around linker bug.
3734
3735 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3736
3737         * semaphore.h: Fix typo in comment.
3738
3739 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3740
3741         * sysdeps/pthread/sigfillset.c: New file.
3742
3743         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3744         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3745         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3746         * sysdeps/pthread/sigaction.c: Likewise.
3747         * sysdeps/pthread/sigprocmask.c: New file.
3748         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3749         __SIGRTMIN+1.
3750         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3751         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
3752         in this case.
3753
3754 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
3755
3756         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3757         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
3758
3759         * sysdeps/unix/sysv/linux/unregister-atfork.c
3760         (__unregister_atfork): Don't free memory not allocated dynamically.
3761
3762         * semaphore.h: Remove __THROW marker from cancellation points.
3763         * nptl/sysdeps/pthread/pthread.h: Likewise.
3764
3765 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
3766
3767         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
3768         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
3769         __THROW.
3770
3771 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
3772
3773         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
3774
3775 2003-04-15  Roland McGrath  <roland@redhat.com>
3776
3777         * forward.c (__pthread_unwind): Tweak to avoid warning.
3778
3779 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
3780
3781         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
3782
3783 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
3784
3785         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
3786         overflow CFA advance instructions.
3787         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3788
3789 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
3790
3791         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
3792         * sysdeps/i386/pthread_spin_lock.c: Likewise.
3793         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
3794         defined.
3795
3796         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
3797         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
3798         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
3799         DW_CFA_advance_loc for .Laddl-.Lsubl.
3800
3801 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
3802
3803         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
3804         position-independent unwind data for static libraries.
3805         Add missing unwind info.  Add comments.
3806
3807         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
3808         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3809         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3810         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3811
3812 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
3813
3814         * Makefile: Make sure all cancellation points are compiled with
3815         exception and asynchronous unwind tables.
3816
3817         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
3818         which mishandles loading of global object addresses in PIC.
3819         (THREAD_SETMEM_NC): Likewise.
3820
3821 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3822
3823         * pthread.h: Define new data structure for cleanup buffer.  Declare
3824         new cleanup handler interfaces.
3825         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
3826         (struct pthread): Add cleanup_jmp_buf pointer.  Define
3827         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
3828         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
3829         it.  Declare old cleanup handler installation functions.
3830         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
3831         handling.
3832         * cleanup_defer.c: Likewise.
3833         * cleanup_compat.c: New file.  Old cleanup code.
3834         * cleanup_def_compat.c: New file.  Old cleanup code.
3835         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
3836         if own thread descriptor.
3837         * unwind.c: New file.
3838         * forward.c: Add __pthread_unwind.
3839         * init.c (pthread_functions): Add __pthread_unwind.
3840         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
3841         Add ptr___pthread_unwind.
3842         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
3843         and unwind function.
3844         * Makefile (libpthread-routines): Add cleanup_compat,
3845         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
3846         table generation if necessary.
3847         * version.c: Record whether unwind support is compiled in.
3848         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
3849         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
3850         handler interfaces.
3851         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
3852         complication to generate unwind information for syscall wrappers.
3853         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3854         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3855         __cleanup_fct_attribute.
3856
3857         * Makefile: Add rules to build and run tst-cleanup0.
3858         * tst-cleanup0.c: New file.
3859         * tst-cleanup0.expect: New file.
3860
3861         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
3862         caller.  Optimize to avoid often unecessary local variable.
3863
3864 2003-04-11  Roland McGrath  <roland@redhat.com>
3865
3866         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
3867         sets variable `multidir'; include that.
3868         (generated): Add it.
3869         ($(objpfx)$(multidir)/crti.o): New target.
3870         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
3871
3872 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
3873
3874         * tst-attr2.c (do_test): Add cast to avoid warning.
3875         * tst-mutex4.c (do_test): Likewise.
3876
3877 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
3878
3879         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
3880         in child.
3881
3882 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
3883
3884         * Makefile (tests): Add tst-detach1.
3885         * tst-detach1.c: New file.
3886
3887 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
3888
3889         * sysdeps/pthread/pthread.h: Remove duplicate
3890         pthread_cleanup_{push,pop} definitions.
3891
3892         * tst-barrier2.c: Eliminate warnings.
3893         * tst-cancel4.c: Likewise.
3894         * tst-cond4.c: Likewise.
3895         * tst-cond6.c: Likewise.
3896         * tst-detach1.c: Likewise.
3897         * tst-rwlock4.c: Likewise.
3898         * tst-rwlock6.c: Likewise.
3899         * tst-rwlock7.c: Likewise.
3900         * tst-sem3.c: Likewise.
3901         * tst-spin2.c: Likewise.
3902         * tst-umask1.c: Likewise.
3903
3904 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
3905
3906         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
3907
3908 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
3909
3910         * descr.h (struct pthread): Move cancelhandling member to the front.
3911
3912 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
3913
3914         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
3915         malloc_parent, and malloc_child statically.
3916         (__register_atfork_malloc): New function.
3917         (free_mem): Don't free any of the malloc_* variables on the list.
3918         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
3919         Define HAVE_register_atfork_malloc.
3920
3921 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
3922
3923         * sysdeps/pthread/createthread.c (create_thread): Add some more
3924         comments explaining when to set multiple_threads and when not.
3925
3926         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3927         THREAD_ATOMIC_BIT_SET if not already defined.
3928         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
3929         THREAD_ATOMIC_BIT_SET:
3930         * sysdeps/x86_64/tls.h: Likewise.
3931         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
3932         THREAD_ATOMIC_CMPXCHG_VAL.
3933         (_pthread_cleanup_pop_restore): Likewise.
3934         * cancellation.c (__pthread_enable_asynccancel): Likewise.
3935         (__pthread_enable_asynccancel_2): Likewise.
3936         (__pthread_disable_asynccancel): Likewise.
3937         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3938         (__libc_disable_asynccancel): Likewise.
3939         * init.c (sigcancel_handler): Likewise.
3940         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
3941         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
3942
3943 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
3944
3945         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
3946         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
3947         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
3948         * Makefile (tests): Add tst-cancel11.
3949         * tst-cancel11.c: New file.
3950
3951 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
3952
3953         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
3954         round, not the first.  Use specific_used flag instead of local
3955         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
3956         (__free_tcb): Don't call deallocate_tsd here.
3957         (start_thread): Call deallocate_tsd here.
3958         * pthread_setspecific.c: Set specific_used flag really only when
3959         needed.
3960         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
3961         * tst-tsd3.c: New file.
3962         * tst-tsd4.c: New file.
3963
3964 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3965
3966         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
3967         Use atomic_exchange_and_add instead of __lll_add.
3968         (__lll_mutex_timedlock): Likewise.
3969         Patch by Ian Wienand.
3970
3971 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
3972
3973         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
3974         (SINGLE_THREAD_P): Fix typo.
3975         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
3976
3977 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
3978
3979         * Makefile (tests): Add tst-align.
3980         * tst-align.c: New file.
3981         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
3982
3983         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
3984         function correctly.
3985
3986         * tst-tsd2.c: Add casts to avoid warnings.
3987
3988 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
3989
3990         * descr.h (struct pthread): Move most often used elements to the front.
3991
3992 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
3993
3994         * Makefile (libpthread-routines): Add pthread_atfork.
3995         (libpthread-static-only-routines): Add pthread_atfork.
3996
3997 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3998
3999         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
4000         of TLS_DTV_AT_TP.
4001         (INSTALL_DTV): Add parens.
4002         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
4003         Use passed descr instead of THREAD_SELF.
4004         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
4005         (__lll_mutex_timedlock_wait): Correct expected value after
4006         spurious wakeup.
4007         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
4008         Release lock before waking up the waiters.
4009         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
4010         criteria.  Reorderstruct passed to cleanup handler.  Fix
4011         handling of cancellation and failung pthread_mutex_unlock call.
4012         Use __pthread_enable_asynccancel_2 instead of
4013         __pthread_enable_asynccancel.
4014         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4015         Return result of lock re-get if it fails.
4016         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
4017         for __pthread_cleanup_push.
4018         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
4019         completely broken rwlock implementation.
4020         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4021         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4022         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4023         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
4024         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4025         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
4026         versioned_symbol macro.
4027         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
4028         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4029
4030 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
4031
4032         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
4033         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
4034         and __helper_tid.
4035         (struct timer): Remove th and bar field.
4036         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
4037         debugging code.  Create only one helper thread.
4038         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
4039         helper thread.
4040         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4041         Renamed.  Define statically.  Use thread info from siginfo.
4042         (__helper_once): New variable.
4043         (__helper_tid): New variable.
4044         (__reset_helper_control): New function.
4045         (__start_helper_thread): New function.
4046
4047         * pthread_create.c (start_thread): Don't use setjmp inside
4048         __builtin_expect to work around gcc bug.
4049
4050         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
4051         timer_delete syscall fails, but not with ENOSYS, set
4052         __no_posix_timers.
4053
4054         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
4055         (timer_settime): Fix typo.
4056         * sysdeps/unix/sysv/linux/timer_getoverr.c
4057         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
4058
4059 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
4060
4061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
4062         offset of cleanupbuf.__prev.
4063
4064 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
4065
4066         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
4067         of included file.
4068
4069 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
4070
4071         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
4072         NULL provide default definition to syscall.
4073
4074 2003-03-25  Roland McGrath  <roland@redhat.com>
4075
4076         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
4077         (timer_id2ptr): Fix typo.
4078
4079 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
4080
4081         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
4082         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
4083         * sysdeps/ia64/pthreaddef.h: Likewise.
4084         * sysdeps/powerpc/pthreaddef.h: Likewise.
4085         * sysdeps/s390/pthreaddef.h: Likewise.
4086         * sysdeps/sh/pthreaddef.h: Likewise.
4087         * sysdeps/x86_64/pthreaddef.h: Likewise.
4088         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
4089         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
4090         being changed.
4091         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4092         SIGTIMER is not unblocked.
4093         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
4094         RT signal taken.
4095         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
4096         be send.
4097         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
4098         pass pointer through as ID.
4099         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
4100         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
4101         * sysdeps/unix/sysv/linux/timer_create.c: New file.
4102         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
4103         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
4104         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
4105         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
4106         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
4107         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
4108         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
4109         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
4110         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
4111         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
4112         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
4113         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
4114         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
4115         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
4116         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
4117         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
4118         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
4119         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
4120         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
4121         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
4122         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
4123         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
4124         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
4125         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
4126         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
4127         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
4128         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
4129         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
4130         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
4131         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
4132
4133         * pthreadP.h: Remove FRAME_LEFT definition.
4134         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
4135         already left frame.  Programs which have this problem are not POSIX
4136         compliant.
4137         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
4138
4139 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
4140
4141         * sysdeps/pthread/tst-timer.c: Check return values of the
4142         functions we test.
4143
4144 2003-03-23  Roland McGrath  <roland@redhat.com>
4145
4146         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
4147         * tst-tls3mod.c: Likewise.
4148         * tst-tls1.c: Likewise.
4149         * tst-tls2.c: Likewise.
4150
4151         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
4152         undefined behavior.
4153
4154         * tst-join5.c (tf1, tf2): Add a cast.
4155
4156         * Makeconfig (includes): Append -I$(..)nptl to this variable.
4157
4158         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
4159         Don't test anything.
4160         * tst-cond4.c: Likewise.
4161         * tst-cond6.c: Likewise.
4162         * tst-flock2.c: Likewise.
4163         * tst-mutex4.c: Likewise.
4164         * tst-rwlock4.c: Likewise.
4165         * tst-signal1.c: Likewise.
4166         * tst-spin2.c: Likewise.
4167         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
4168
4169         * tst-mutex4.c: Use test-skeleton.c.
4170         * tst-spin2.c: Likewise.
4171         * tst-sysconf.c: Likewise.
4172         * tst-barrier2.c: Likewise.
4173         * tst-cond4.c: Likewise.
4174         * tst-cond6.c: Likewise.
4175         * tst-rwlock4.c: Likewise.
4176         * tst-unload.c: Likewise.
4177         * tst-flock2.c (do_test): Use return instead of exit.
4178
4179 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
4180
4181         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
4182
4183 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
4184
4185         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4186         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
4187         instead of __lll_compare_and_swap.
4188         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4189         Likewise.
4190         Removed definition if __lll_compare_and_swap.
4191
4192         * cancellation.c: Adjust for new form of compare&exchange macros.
4193         * cleanup_defer.c: Likewise.
4194         * init.c: Likewise.
4195         * libc-cancellation.c: Likewise.
4196         * old_pthread_cond_broadcast.c: Likewise.
4197         * old_pthread_cond_signal.c: Likewise.
4198         * old_pthread_cond_timedwait.c: Likewise.
4199         * old_pthread_cond_wait.c: Likewise.
4200         * pthread_cancel.c: Likewise.
4201         * pthread_create.c: Likewise.
4202         * pthread_detach.c: Likewise.
4203         * pthread_join.c: Likewise.
4204         * pthread_key_delete.c: Likewise.
4205         * pthread_setcancelstate.c: Likewise.
4206         * pthread_setcanceltype.c: Likewise.
4207         * pthread_timedjoin.c: Likewise.
4208         * pthread_tryjoin.c: Likewise.
4209         * sysdeps/pthread/createthread.c: Likewise.
4210
4211 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
4212
4213         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
4214         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
4215         definitions.  Replace uses with calls to atomic_* functions.
4216         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
4217         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
4218         __lll_test_and_set calls with atomic_exchange_and_add and
4219         atomic_exchange calls respectively.
4220         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
4221         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
4222         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
4223         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
4224         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
4225         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
4226         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
4227
4228         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
4229         returns the old value.
4230
4231 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
4232
4233         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
4234         int for variable OLDVAL and correct inline assembler contraint.
4235         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
4236         type int for variable OLD.
4237
4238         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
4239         only for s390-32.
4240         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4241         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
4242         instead of multiple_threads field in the TCB.
4243
4244 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
4245
4246         * sysdeps/i386/i686/bits/atomic.h: Removed.
4247         * sysdeps/i386/i586/bits/atomic.h: Removed.
4248         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
4249         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
4250         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
4251         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
4252         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
4253         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
4254         * atomic.h: Removed.  Moved to glibc.
4255
4256         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
4257         support for clock selection.
4258
4259         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
4260         signalling waiters.
4261
4262 2003-03-18  Roland McGrath  <roland@redhat.com>
4263
4264         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4265         Add __lll_rel_instr first.  Add memory clobber.
4266         (lll_mutex_unlock): Use __lll_test_and_set.
4267         From Paul Mackerras <paulus@samba.org>.
4268
4269         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
4270         unconditionally.
4271         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4272         (SINGLE_THREAD_P):  Add `header.' prefix.
4273         From Paul Mackerras <paulus@samba.org>.
4274
4275         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
4276         pthread_timedjoin_np to ...
4277         (libpthread: GLIBC_2.3.3): ... here.
4278         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
4279
4280         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4281         Avoid shadowing VAL variable.
4282
4283         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4284         New macro.
4285
4286 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
4287
4288         * Makefile (tests): Add tst-cond11.
4289         * tst-cond11.c: New file.
4290
4291         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
4292         struct passed to cleanup handler to eliminate one more
4293         instruction.
4294         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4295
4296         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4297         (pthrad_cond_t): Replace __unused field with __clock.
4298
4299         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
4300         waken all waiters in cleanup handler.
4301         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4302         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4303
4304         * pthread_condattr_getclock.c: New file.
4305         * pthread_condattr_setclock.c: New file.
4306         * sysdeps/pthread/pthread.h: Declare these new functions.
4307         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
4308         * Makefile (libpthread-routines): Add the new functions.
4309         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
4310         Renamed field to value.  Document use of the bits.
4311         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
4312         change.
4313         * pthread_condattr_setpshared.c: Likewise.
4314         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
4315         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
4316         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4317         Add __clock field.
4318         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4319         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4320         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4321         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4322         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4323         Implement clock selection.
4324         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4325         * pthread-errnos.sym: Add ENOSYS.
4326         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4327         _POSIX_CLOCK_SELECTION.
4328         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4329
4330         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
4331         invalid .size directive.
4332
4333 2003-03-17  Roland McGrath  <roland@redhat.com>
4334
4335         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
4336         Formatting tweaks.
4337
4338 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4339
4340         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
4341         Use __lll_add instead of spelling it out.  Use protected symbol names.
4342         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
4343         Use __lll_add.
4344         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
4345         Renamed from lll_compare_and_swap.  Use new name where necessary.
4346         (__lll_add): Defined.
4347         (__lll_dec_if_positive): Defined.
4348         (__lll_test_and_set): Defined.
4349         * sysdeps/ia64/pthread_spin_init.c: Removed.
4350         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
4351         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
4352         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
4353         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
4354         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
4355         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
4356         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
4357         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
4358         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
4359         __sync_lock_release_si.
4360         Patch by Jakub Jelinek.
4361
4362         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
4363         Fix timeout handling.
4364         (__lll_timedwait_tid): Likewise.
4365         (lll_unlock_wake_cb): Wake up other waiters if necessary.
4366         Patch by Jakub Jelinek.
4367
4368         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
4369
4370 2003-03-17  Roland McGrath  <roland@redhat.com>
4371
4372         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
4373         * sysdeps/pthread/pthread_spin_init.c: New file.
4374         * sysdeps/pthread/pthread_spin_unlock.c: New file.
4375         * sysdeps/powerpc/Makefile: New file.
4376         * sysdeps/powerpc/pthread_spin_lock.c: New file.
4377         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
4378         * sysdeps/powerpc/pthreaddef.h: New file.
4379         * sysdeps/powerpc/tcb-offsets.sym: New file.
4380         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
4381         * sysdeps/powerpc/tls.h: New file.
4382         * sysdeps/powerpc/bits/atomic.h: New file.
4383         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
4384         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
4385         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
4386
4387         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
4388         * sysdeps/unix/sysv/linux/sem_post.c: New file.
4389         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
4390         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
4391         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
4392         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
4393         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
4394         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
4395         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
4396         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
4397         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
4398         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
4399         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
4400         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
4401         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
4402
4403         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
4404         not gettimeofday.
4405         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
4406         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4407         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
4408         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
4409         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4410
4411 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4412
4413         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
4414         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4415         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4416         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4417         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
4418
4419 2003-03-16  Roland McGrath  <roland@redhat.com>
4420
4421         * tst-fork4.c: Include <string.h>.
4422         * tst-signal2.c: Likewise.
4423         * tst-mutex5.c (do_test): exit -> return.
4424         * tst-mutex2.c: Include <stdlib.h>.
4425
4426 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
4427
4428         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4429         (__lll_mutex_timedlock_wait): Correct expected value after
4430         spurious wakeup.  Otherwise we would never wait again.
4431
4432         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
4433         zone versus inline asm stupidity.  Use correct instructions.
4434
4435         * tst-rwlock6.c: Add some more status output.
4436
4437 2003-03-15  Roland McGrath  <roland@redhat.com>
4438
4439         * sysdeps/pthread/configure.in: New file.
4440         * sysdeps/pthread/configure: New file (generated).
4441
4442 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4443
4444         * allocatestack.c (allocate_stack): Store the exact stack size of
4445         user allocated stacks.
4446
4447 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
4448
4449         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
4450         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
4451         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4452         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
4453         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
4454         Use `header.' prefix.
4455         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4456
4457 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4458
4459         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
4460         __builtin_frame_address, use stack pointer.
4461
4462         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
4463         instead of __builtin_frame_pointer.
4464
4465 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4466
4467         * tst-basic1.c (do_test): Add cast to avoid warning.
4468         * tst-basic2.c (do_test): Likewise.
4469
4470         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
4471         amount of stack correction.
4472
4473         * tst-fork4.c: Use test-skeleton.c.
4474
4475 2003-03-14  Roland McGrath  <roland@redhat.com>
4476
4477         * init.c: Fix typo "#eli" for "#else".
4478
4479 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
4480
4481         * allocatestack.c (__stack_user): Use hidden_data_def.
4482         * pthread_create.c (__pthread_keys): Likewise.
4483
4484         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
4485
4486 2003-03-14  Roland McGrath  <roland@redhat.com>
4487
4488         * tst-fork4.c: New file.
4489         * Makefile (tests): Add it.
4490
4491         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
4492         we always define the padding space.
4493         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
4494         stopped supporting its own extensions fully.
4495         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
4496         struct also called `header', so `header.multiple_threads' is the field
4497         name to use on all machines.
4498         * allocatestack.c (allocate_stack): Use `header.' prefix.
4499         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4500         * pthread_create.c (__pthread_create_2_1): Likewise.
4501         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
4502         (THREAD_SELF): Likewise.
4503         * sysdeps/x86_64/tls.h: Likewise.
4504         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4505         (SINGLE_THREAD_P): Likewise.
4506         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4507         (SINGLE_THREAD_P): Likewise.
4508         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4509         (SINGLE_THREAD_P): Likewise.
4510
4511         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
4512         value directly.
4513
4514 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4515
4516         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
4517         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
4518
4519         * pthread_create.c (start_thread): setjmp is expected to return 0.
4520
4521         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
4522         (THREAD_GETMEM_NC): Likewise.
4523
4524 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
4525
4526         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
4527         and the size of the stack which must be allocated is a multiple,
4528         allocate one more page.
4529         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
4530         MULTI_PAGE_ALIASING.
4531
4532 2003-03-13  Roland McGrath  <roland@redhat.com>
4533
4534         * pthread_create.c (start_thread): Set EXITING_BIT after the
4535         event-reporting (and destructors), not before.
4536
4537 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
4538
4539         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
4540         lll_futex_wake): Declare register variables as long int instead of
4541         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
4542         Make syscall arguments clobbered by the syscall.
4543         (lll_futex_wait): Define using lll_futex_timed_wait.
4544
4545         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
4546         to void *.
4547
4548         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
4549         PPID if [! NDEBUG].
4550
4551         * allocatestack.c (nptl_ncreated): Only declare if
4552         COLORING_INCREMENT != 0.
4553
4554         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
4555         (__libc_enable_asynccancel_2): Remove prototype.
4556
4557         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
4558         ctid to match kernel.
4559
4560 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4561
4562         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
4563         libc_multiple_threads.
4564         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
4565         __libc_multiple_threads to...
4566         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
4567
4568         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
4569         versioning.
4570         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4571         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4572
4573         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
4574         (__pthread_once_internal): Define.
4575
4576         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
4577         macros instead of .symver directly.
4578         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4579         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4580
4581         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
4582         * sysdeps/x86_64/tcb-offsets.sym: New file.
4583         * sysdeps/x86_64/Makefile: New file.
4584
4585         * sysdeps/i386/tcb-offsets.sym: Add SELF.
4586         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
4587         to access own pthread_t in TCB.
4588         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4589         Likewise.
4590         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4591         Likewise.
4592         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4593
4594 2003-03-12  Roland McGrath  <roland@redhat.com>
4595
4596         * pthread-errnos.sym: New file.
4597         * Makefile (gen-as-const-headers): New variable, list that file.
4598         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
4599         header <pthread-errnos.h> instead of defining errno values here.
4600         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4601         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4602         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4603         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4604         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4605         Likewise.
4606         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4607         Likewise.
4608         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4609         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4610         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4611         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4612         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4613         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4614         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4615         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4616         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4617         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4618         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4619         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
4620         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
4621         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
4622         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4623         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4624         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4625         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4626         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4627         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
4628         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4629         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
4630         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
4631         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
4632         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
4633         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4634         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4635
4636         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
4637         CLONE_CHILD_SETTID worked.
4638
4639 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4640
4641         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
4642         file.
4643         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
4644         file.
4645
4646         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4647         (pthread_cond_t): Add padding.
4648
4649         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
4650         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
4651         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
4652
4653         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
4654         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
4655         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
4656         (__pthread_rwlock_timedrdlock): Likewise.
4657         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
4658         (__pthread_rwlock_wrlock): Likewise.
4659         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
4660         (__pthread_rwlock_rdlock): Likewise.
4661
4662         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
4663
4664         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
4665         result of lock re-get if it fails.
4666
4667 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4668
4669         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
4670         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4671         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4672         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4673         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4674         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4675         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4676         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4677         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4678         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4679
4680         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
4681         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
4682
4683         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
4684         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
4685         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
4686         (create_thread): Likewise.
4687         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
4688         * init.c (__pthread_initialize_minimal_internal): Initialize
4689         __libc_multiple_threads_ptr if necessary.
4690         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
4691         __pthread_multiple_threads and __libc_multiple_threads_ptr.
4692         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
4693         __libc_multiple_threads.
4694         (__libc_pthread_init): Return pointer to __libc_pthread_init if
4695         necessary.
4696
4697         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
4698         (THREAD_SETMEM_NC): Likewise.
4699
4700         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
4701         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
4702         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
4703         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
4704
4705         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
4706         Eliminate one entire instruction.
4707
4708         * cancellation.c (__pthread_enable_asynccancel_2): New function.
4709         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
4710         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4711         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
4712         instead of __pthread_enable_asynccancel.
4713         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4714         (__pthread_cond_wait): Likewise.
4715         * sysdeps/pthread/pthread_cond_timedwait.c
4716         (__pthread_cond_timedwait): Likewise.
4717         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4718
4719         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4720         (__condvar_cleanup): Wake up all waiters in case we got signaled
4721         after being woken up but before disabling asynchronous
4722         cancellation.
4723         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4724         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4725         (__condvar_cleanup): Likewise.
4726
4727         * init.c (__NR_set_tid_address): If already defined, don't redefine.
4728         Make it an error if architecture has no #if case.  Add x86-64.
4729
4730         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
4731         pt-initfini.s generation.
4732
4733         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
4734         (TLS_INIT_TP): Fix typo.
4735
4736 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4737
4738         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
4739         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
4740
4741         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
4742         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4743         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
4744         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
4745         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
4746         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4747         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4748         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4749
4750 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4751
4752         * sysdeps/pthread/pthread_cond_timedwait.c
4753         (__pthread_cond_timedwait): Return the result of the final
4754         locking.  If it succeeds, the regular function return value.
4755
4756         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
4757         Return result of the final locking.
4758         * version.c (__nptl_main): Work around problems with the strange
4759         INTERNAL_SYSCALL macro on ppc32.
4760         * init.c (__pthread_initialize_minimal_internal): Unblock
4761         SIGCANCEL in case the parent blocked it.
4762         Reported by Paul Mackerras <paulus@samba.org>.
4763
4764         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
4765         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
4766         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
4767
4768 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4769
4770         * sysdeps/pthread/pthread_cond_timedwait.c
4771         (__pthread_cond_timedwait): Unlock and fail if
4772         __pthread_mutex_unlock_internal failed.
4773
4774         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
4775         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
4776         Use ARCH_CLONE.
4777         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
4778         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
4779         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
4780         ALLOCATE_STACK): New macros.
4781         (TLS_TPADJ): New macro.
4782         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
4783         (allocate_stack): Handle TLS_DTV_AT_TP and
4784         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
4785         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
4786         Don't set PD->self.
4787         * init.c [__ia64__] (__NR_set_tid_address): Define.
4788
4789         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
4790         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
4791         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
4792         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
4793         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
4794         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
4795         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
4796         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
4797         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
4798         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
4799         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
4800         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
4801         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
4802         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
4803         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
4804         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
4805         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
4806         * sysdeps/ia64/bits/atomic.h: New file.
4807         * sysdeps/ia64/Makefile: New file.
4808         * sysdeps/ia64/pthread_spin_init.c: New file.
4809         * sysdeps/ia64/pthread_spin_lock.c: New file.
4810         * sysdeps/ia64/pthread_spin_trylock.c: New file.
4811         * sysdeps/ia64/pthread_spin_unlock.c: New file.
4812         * sysdeps/ia64/pthreaddef.h: New file.
4813         * sysdeps/ia64/tcb-offsets.sym: New file.
4814         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
4815         * sysdeps/ia64/tls.h: New file.
4816
4817         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
4818         to syscall instead of no arguments.
4819
4820 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
4821
4822         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
4823         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
4824         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
4825         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
4826
4827         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
4828         unused code.
4829
4830         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
4831
4832         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4833         lowlevelbarrier.sym.
4834         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
4835         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
4836         Include lowlevelbarrier.h and don't define offsets locally.
4837         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
4838
4839         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4840         (__lll_mutex_lock_wait): Reverse order of first two parameters.
4841         (__lll_mutex_timedlock_wait): Likewise.
4842         (lll_mutex_lock): Adjust asm for that.
4843         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
4844         (lll_lock): Adjust asm for operand order change.
4845         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
4846         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
4847
4848         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
4849         Reverse order of parameters.
4850         (__lll_timedwait_tid): Remove regparms attribute.
4851         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
4852         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
4853
4854         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4855         (__lll_timedwait_tid): Remove one unnecessary instruction.
4856
4857         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
4858         __lll_mutex_timedlock_wait only for NOT_IN_libc.
4859         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
4860         lowlevelmutex.S.
4861
4862         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
4863         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
4864         for NOT_IN_libc.
4865         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
4866         lowlevellock.S.
4867
4868         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
4869         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
4870         for libc.so.
4871         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
4872         define LOCK here (if UP is not defined).  The actual code is in
4873         lowlevelmutex.S.
4874
4875         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
4876         LOCK is already defined.  Don't define lll_unlock_wake_cb and
4877         __lll_timedwait_tid for libc.so.
4878         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
4879         define LOCK here (if UP is not defined).  The actual code is in
4880         lowlevellock.S.
4881
4882         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
4883         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
4884         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
4885         instead of lowlevelsem.h.
4886         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4887         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4888         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4889
4890         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4891         lowlevelrwlock.sym.
4892         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
4893         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
4894         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
4895
4896         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
4897         register loading.
4898         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
4899         last changed.  D'oh.
4900
4901         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
4902
4903         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
4904         of __libc_locking_needed.
4905         (lll_trylock): Initialize %eax to zero.
4906
4907         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
4908         pthread_cond_t definition.
4909
4910 2003-03-10  Roland McGrath  <roland@redhat.com>
4911
4912         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
4913         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
4914         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
4915         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
4916         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
4917
4918         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
4919         Instead of setting PD->multiple_threads, set globals
4920         __pthread_multiple_threads and __libc_multiple_threads.
4921         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4922         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
4923         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
4924
4925         * descr.h (struct pthread): Conditionalize first member on
4926         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
4927         containing an anonymous tcbhead_t.  Move `list' member out.
4928         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
4929         * allocatestack.c: Remove use of `header.data.' prefix.
4930         * pthread_create.c: Likewise.
4931         * init.c (__pthread_initialize_minimal_internal): Likewise.
4932         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4933         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
4934         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
4935         * sysdeps/x86_64/tls.h: Likewise.
4936         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4937         (SINGLE_THREAD_P): Likewise.
4938         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4939         (SINGLE_THREAD_P): Likewise.
4940         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
4941         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
4942
4943 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
4944
4945         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
4946
4947         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
4948         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4949
4950         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
4951         leftovers from the ia32 code.
4952
4953         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
4954         memory load.
4955         (clear_once_control): Don't load %esi.
4956
4957         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
4958         handling.
4959
4960         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
4961
4962         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
4963         * sysdeps/unix/sysv/linux/createthread.c: ...here.
4964
4965         * Makefile (tests): Add tst-cond10.
4966         * tst-cond10.c: New file.
4967
4968 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
4969
4970         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
4971         * tst-signal3.c (do_test): Likewise.
4972         * tst-sem5.c (do_test): Likewise.
4973         * tst-kill6.c (do_test): Likewise.
4974         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
4975
4976         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
4977         of inc/dec.
4978         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
4979         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
4980         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4981         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4982         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4983         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4984         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4985         Likewise.
4986         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4987         Likewise.
4988         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4989         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4990         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4991         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4992         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4993         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
4994         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4995         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4996
4997         * allocatestack.c (allocate_stack): If mprotect() fails free the
4998         TLS memory.
4999
5000 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
5001
5002         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
5003
5004         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
5005         lll_wake_tid.  This was used only to work around kernel limits in
5006         the early days.
5007         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
5008         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
5009         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5010         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
5011
5012         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
5013         (__pthread_initialize_minimal_internal): Change initialization of
5014         __static_tls_align_m1 appropriately.
5015         * pthreadP.h (__static_tls_align_m1): Renamed from
5016         __static_tls_align.
5017         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
5018         instead of __static_tls_align-1.
5019
5020 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
5021
5022         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
5023
5024         * pthread_create.c: Define __pthread_keys using nocommon
5025         attribute, not by placing it explicitly in bss.
5026         Remove DEFINE_DEALLOC definition.  Not needed anymore.
5027
5028         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
5029         Use it in mmap call to allocate stacks.
5030
5031         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
5032
5033         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
5034         result of the thread function.
5035
5036 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
5037
5038         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
5039         version is just fine.
5040
5041         * sysdeps/unix/sysv/linux/libc_pthread_init.c
5042         (__pthread_child_handler): Renamed from pthread_child_handler,
5043         exported, and marked hidden.  Change all users.
5044         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
5045         free __pthread_child_handler from child list.
5046
5047 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5048
5049         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
5050
5051         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5052         Fix handling of cancellation and failing pthread_mutex_unlock call.
5053         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5054         (__pthread_cond_wait): Likewise.
5055
5056         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5057         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
5058         lll_futex_timed_wait call.
5059         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5060         (pthread_rwlock_timedwrlock): Likewise.
5061
5062         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
5063         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
5064         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
5065
5066         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
5067         check of lll_futex_wake return value.
5068
5069 2003-03-03  Roland McGrath  <roland@redhat.com>
5070
5071         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
5072
5073         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5074         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
5075         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
5076
5077 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
5078
5079         * sysdeps/pthread/timer_create.c (timer_create): Return correct
5080         error for CPU clocks.
5081
5082         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5083         _POSIX_MONOTONIC_CLOCK.
5084         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5085
5086         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
5087         recent kernels.
5088
5089 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5090
5091         * descr.h (struct pthread): Move cleanup field to the front.
5092
5093 2003-03-01  Roland McGrath  <roland@redhat.com>
5094
5095         * sem_open.c (sem_open): Braino fix.
5096
5097 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5098
5099         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
5100         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
5101         __pthread_cleanup_pop functionality.
5102         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5103
5104         * descr.h (struct pthread): Move tid field to the front now that
5105         it is often used.
5106
5107         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
5108         (__lll_mutex_timedlock_wait): Remove.
5109         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5110         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5111         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5112         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5113         (lll_unlock_wake_cb): Don't save and restore %esi.
5114         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5115         %esi.
5116         (__lll_timedwait_tid): Add alignment.
5117         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5118         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5119         %esi.
5120         (__lll_timedwait_tid): Removed.
5121         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5122         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
5123         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5124         (pthread_barrier_wait): Don't save, load, and restore %esi for
5125         last thread.
5126         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5127         (__pthread_cond_signal): Don't save, load, and restore %esi.
5128         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
5129         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
5130         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
5131         Don't save, load, and restore %esi.
5132
5133 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
5134
5135         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
5136         Release lock before waking up the waiters.
5137
5138         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
5139
5140         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
5141         (reader_thread): Likewise.
5142
5143         * sysdeps/pthread/pthread_rwlock_unlock.c
5144         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
5145         to wake up readers if there are none.
5146
5147         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
5148         Release internal lock before wake threads.
5149
5150 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
5151
5152         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
5153         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
5154         predefined.
5155         * tst-rwlock9.c: Likewise.
5156         * tst-rwlock10.c: New file.
5157         * tst-rwlock11.c: New file.
5158
5159         * Makefile (tests): Add tst-dlsym1.
5160         * tst-dlsym1.c: New file.
5161
5162         * init.c (__pthread_initialize_minimal_internal): Set
5163         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
5164         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
5165
5166 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
5167
5168         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
5169
5170         * tst-cond2.c: Fix sychronization with child.
5171
5172         * tst-rwlock8.c (reader_thread): Remove unused variable.
5173
5174         * Makefile: Add rules to build and run tst-tls3.
5175         * tst-tls3.c: New file.
5176         * tst-tls3mod.c: New file.
5177
5178         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
5179         * tst-rwlock8.c: New file.
5180         * tst-rwlock9.c: New file.
5181         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
5182         complete broken rwlock implementation.
5183         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5184         Likewise.
5185         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5186         Likewise.
5187         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5188         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5189         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
5190         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
5191         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5192         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
5193         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
5194
5195 2003-02-23  Roland McGrath  <roland@redhat.com>
5196
5197         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
5198
5199 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
5200
5201         * Makefile (tests): Add tst-context1.
5202         * tst-context1.c: New file.
5203
5204         * Makefile (tests): Add tst-tls1 and tst-tls2.
5205         * tst-tls1.c: New file.
5206         * tst-tls2.c: New file.
5207
5208         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
5209         for failed cmpxchg.
5210
5211         * pthread_create.c (start_thread): Set EXITING_BIT early.
5212
5213         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
5214         (THREAD_GETMEM_NC): Likewise.
5215
5216 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
5217
5218         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
5219         off 3 more bytes by using offset-less instructions when possible.
5220
5221         * Makefile: Add dependency for $(objpfx)version.d.
5222
5223         * eintr.c (eintr_source): Add unnecessary return but the compiler
5224         insists.
5225
5226         * tst-kill3.c: Include <unistd.h>.
5227
5228 2003-02-21  Roland McGrath  <roland@redhat.com>
5229
5230         * pthread_create.c (start_thread): Call __libc_thread_freeres.
5231
5232 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5233
5234         * Makefile (tests): Add tst-eintr1.
5235         (distribute): Add eintr.c.
5236         * tst-eintr1.c: New file.
5237         * eintr.c: New file.
5238
5239         * pthread_cancel.c (pthread_cancel): Use tkill directly.
5240
5241         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
5242         Disallow sending SIGCANCEL.
5243
5244         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
5245         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
5246         * tst-kill1.c: New file.
5247         * tst-kill2.c: New file.
5248         * tst-kill3.c: New file.
5249         * tst-kill5.c: New file.
5250         * tst-kill6.c: New file.
5251         * tst-basic7.c: Renamed to...
5252         * tst-kill4.c: ...this.
5253
5254 2003-02-21  Roland McGrath  <roland@redhat.com>
5255
5256         * Makefile (install-lib-ldscripts): New variable.
5257
5258 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5259
5260         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
5261         * pthread_cancel.c: Use INVALID_TD_P.
5262         * pthread_detach.c: Likewise.
5263         * pthread_getschedparam.c: Likewise.
5264         * pthread_setschedparam.c: Likewise.
5265         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
5266         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5267         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
5268         * pthread_timedjoin.c: Likewise.
5269
5270         * tst-basic7.c: Include <signal.h>.
5271
5272         * pthread_join.c (pthread_join): Limited checking for invalid
5273         descriptors.
5274         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
5275
5276 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
5277
5278         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
5279         beginning of the loop.  Clear the entire first block of TSD.
5280         * Makefile (tests): Add tst-key4.
5281         * tst-key4.c: New file.
5282
5283 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
5284
5285         * Makefile (tests): Add tst-basic7.
5286         * tst-basic7.c: New file.
5287
5288         * pthread_create.c (deallocate_tsd): Mark as internal_function.
5289         Add some more __builtin_expect.
5290
5291         * pthreadP.h: Define dummy version of DEBUGGING_P.
5292
5293 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
5294
5295         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
5296         _POSIX_THREAD_PRIORITY_SCHEDULING.
5297         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
5298         _XOPEN_REALTIME_THREADS.
5299         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
5300
5301         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
5302         kernel returns EINVAL for PID <= 0, work around it.
5303
5304         * Makefile (tests): Add tst-signal5.
5305         * tst-signal5.c: New file.
5306
5307         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
5308         and LOGIN_NAME_MAX.
5309
5310         * tst-cancel1.c (tf): Block all signals.
5311
5312         * Makefile (tests): Add tst-basic6.
5313         * tst-basic6.c: New file.
5314
5315         * tst-basic1.c: Add test for process ID.
5316
5317         * Makefile (tests): Add tst-cancel10.
5318         * tst-cancel10.c: New file.
5319
5320         * Makefile (tests): Add tst-signal4.
5321         * tst-signal4.c: New file.
5322
5323         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
5324         __sigismember instead of sigismember.  Add __builtin_expect.
5325
5326 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
5327
5328         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
5329         pthread_setcancelstate, and pthread_rwlock_setpshared.
5330
5331         * tst-cancel7.c (do_test): Make sure the pid file exists before
5332         canceling the thread.
5333
5334         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
5335         pthread_rwlock_timedrdlock tests.
5336         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
5337         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5338         Check for invalid tv_nsec field.
5339         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5340         Likewise.
5341
5342         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
5343         recursive mutex of overflow.
5344
5345         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
5346
5347         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
5348         going into an endless loop.
5349         * Makefile (tests): Add tst-cancel9.
5350         * tst-cancel9.c: New file.
5351
5352         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
5353
5354 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
5355
5356         * tst-mutex5.c (do_test): Add more timedlock tests.
5357
5358         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
5359         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
5360
5361         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
5362         use INLINE_SYSCALL.  Error number is returned, not -1.
5363
5364         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
5365         and __deallocate_stack with internal_function.
5366         * pthread_create.c: Adjust definitions appropriately.
5367         * allocatestack.c: Likewise.
5368
5369         * pthread_join.c: Add one more __builtin_expect.
5370         * pthread_timedjoin.c: Likewise.
5371
5372         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
5373         not data of sequence number does not match.
5374         Add one __builtin_expect.
5375
5376         * Makefile (tests): Add tst-clock1.
5377         * tst-clock1.c: New file.
5378
5379         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
5380         negative arguments.
5381         * Makefile (tests): Add tst-basic5.
5382         * tst-basic5.c: New file.
5383
5384 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
5385
5386         * Makefile (tests): Add tst-basic4.
5387         * tst-basic4.c: New file.
5388
5389         * pthreadP.h: Add declaraction for __nptl_nthreads.
5390         * pthread_create.c: Define __nptl_nthreads
5391         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
5392         after thread is done.  If then zero, call exit(0).
5393         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5394         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
5395         * init.c (pthread_functions): Initialize ptr_nthreads.
5396         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
5397         (__reclaim_stacks): Decrement __nptl_nthreads.
5398         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
5399         Define.
5400         * Makefile (tests): Add tst-basic3.
5401         * tst-basic3.c: New file.
5402
5403         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
5404         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
5405         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
5406         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
5407         if asynchronous canceling is enabled.
5408         * pthread_join.c (pthread_join): When recognizing circular joins,
5409         take into account the other thread might be already canceled.
5410         * Makefile (tests): Add tst-join5.
5411         * tst-join5.c: New file.
5412
5413         * Makefile (tests): Add tst-join4.
5414         * tst-join4.c: New file.
5415
5416 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5417
5418         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
5419
5420 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5421
5422         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
5423         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
5424         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
5425         warning.
5426         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
5427         to avoid warning.
5428         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
5429         error if lll_futex_wake failed.
5430
5431 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5432
5433         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
5434         handling of cancellation and failung pthread_mutex_unlock call.
5435         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5436         * Makefile (tests): Add tst-cond8 and tst-cond9.
5437         * tst-cond8.c: New file.
5438         * tst-cond9.c: New file.
5439
5440         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
5441
5442         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
5443         non-standard initializers with __USE_GNU.
5444
5445         * Makefile (tests): Add tst-cleanup3.
5446         * tst-cleanup3.c: New file.
5447
5448 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
5449
5450         * Makefile (tests): Add tst-attr1 and tst-attr2.
5451         * tst-attr1.c: New file.
5452         * tst-attr2.c: New file.
5453
5454         * Makefile: Add rules to build and run tst-atfork2 test.
5455         * tst-atfork2.c: New file.
5456         * tst-atfork2mod.c: New file.
5457
5458         * sysdeps/unix/sysv/linux/unregister-atfork.c
5459         (__unregister_atfork): Free the memory allocated for the handlers
5460         after removing them from the lists.
5461
5462         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
5463         cleanup function.
5464
5465         * tst-atfork1.c (do_test): Wait for the child we forked.
5466         Report error in child.
5467
5468         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
5469
5470         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
5471
5472 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
5473
5474         * Makefile (tests): Add tst-cancel8.
5475         * tst-cancel8.c: New file.
5476
5477         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
5478         clearing of control variable.
5479         * Makefile (tests): Add tst-once3 and tst-once4.
5480         * tst-once3.c: New file.
5481         * tst-once4.c: New file.
5482
5483 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
5484
5485         * sysdeps/sh/Makefile: New file.
5486         * sysdeps/sh/bits/atomic.h: New file.
5487         * sysdeps/sh/pthread_spin_init.c: New file.
5488         * sysdeps/sh/pthread_spin_lock.c: New file.
5489         * sysdeps/sh/pthread_spin_trylock.S: New file.
5490         * sysdeps/sh/pthread_spin_unlock.S: New file.
5491         * sysdeps/sh/pthreaddef.h: New file.
5492         * sysdeps/sh/tcb-offsets.sym: New file.
5493         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
5494         * sysdeps/sh/tls.h: New file.
5495         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
5496         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
5497         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
5498         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
5499         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
5500         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
5501         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
5502         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
5503         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
5504         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
5505         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
5506         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
5507         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
5508         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
5509         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
5510         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
5511         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
5512         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
5513         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
5514         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
5515         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
5516         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
5517         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
5518         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
5519         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
5520         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
5521         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
5522         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
5523         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
5524         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
5525
5526 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
5527
5528         * tst-cond2.c: Rearrange code to not rely on behavior undefined
5529         according to POSIX.
5530
5531         * tst-basic2.c (do_test): Lock mutex before creating the thread.
5532
5533 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
5534
5535         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
5536         (TLS_GET_FS): New #define.
5537         (TLS_SET_FS): New #define.
5538         Correct value of __NR_set_thread_area.
5539
5540         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
5541
5542 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
5543
5544         * Makefile (tests): Add tst-popen1.
5545         * tst-popen1.c: New file.
5546
5547         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
5548         but inactive generalization.
5549         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5550         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5551         Minor optimization, remove one instruction.
5552         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5553
5554 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5555
5556         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
5557
5558 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5559
5560         * init.c (__NR_set_tid_address): Add #ifdef for s390.
5561         * sysdeps/pthread/pthread_barrier_wait.c: New file.
5562         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
5563         * sysdeps/pthread/pthread_cond_signal.c: New file.
5564         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
5565         * sysdeps/pthread/pthread_cond_wait.c: New file.
5566         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
5567         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
5568         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
5569         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
5570         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
5571         * sysdeps/s390/Makefile: New file.
5572         * sysdeps/s390/bits/atomic.h: New file.
5573         * sysdeps/s390/pthread_spin_init.c: New file.
5574         * sysdeps/s390/pthread_spin_lock.c: New file.
5575         * sysdeps/s390/pthread_spin_trylock.c: New file.
5576         * sysdeps/s390/pthread_spin_unlock.c: New file.
5577         * sysdeps/s390/pthreaddef.h: New file.
5578         * sysdeps/s390/tcb-offsets.sym: New file.
5579         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
5580         * sysdeps/s390/tls.h: New file.
5581         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
5582         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
5583         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
5584         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
5585         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
5586         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
5587         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5588         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
5589         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
5590         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
5591         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
5592         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
5593         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
5594         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
5595         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
5596         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
5597         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
5598         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
5599         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
5600         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
5601         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
5602         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5603         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
5604
5605 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
5606
5607         * atomic.h: Add a couple more default implementations.
5608         (atomic_compare_and_exchange_acq): Use
5609         __arch_compare_and_exchange_32_acq in return value definition.  It
5610         always exists.
5611         (atomic_bit_set): Renamed from atomic_set_bit.
5612         Add missing atomic_ prefixes.
5613
5614         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
5615         thread library is available, use correct value to mark initialized
5616         once variable.
5617
5618 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
5619
5620         * allocatestack.c (allocate_stack): Use __getpagesize instead of
5621         __sysconf to determine pagesize.
5622
5623         * pthread_create.c: Include <atomic.h>.
5624         * allocatestack.c (allocate_stack): Implement coloring of the
5625         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
5626         size minus one.  Adjust users.
5627         * sysdeps/i386/i686/Makefile: New file.
5628
5629 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
5630
5631         * allocatestack.c: Improve comment throughout the file.
5632
5633         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5634         (__lll_lock_wait): Add branch prediction.
5635         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5636         (__lll_lock_wait): Likewise.
5637         (lll_unlock_wake_cb): Removed.
5638
5639 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
5640
5641         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
5642         _POSIX_THREAD_PRIORITY_SCHEDULING.
5643
5644 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
5645
5646         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5647         Fix return type of ptr___pthread_getspecific.
5648
5649 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
5650
5651         * Makefile (tests): Add tst-umask1.
5652         (tst-umask1-ARGS): Define.
5653         * tst-umask1.c: New file.
5654
5655 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
5656
5657         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
5658         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
5659         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
5660         pthread_rwlock_unlock.
5661         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
5662         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
5663         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
5664         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
5665         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5666         New file.
5667         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
5668         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5669         New file.
5670         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
5671         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
5672         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
5673         New file.
5674         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
5675         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
5676         New file.
5677         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
5678         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
5679         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
5680         New file.
5681         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
5682         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
5683         New file.
5684         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
5685
5686         * Makefile (libpthread-routines): Remove lowlevelcond and
5687         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
5688         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
5689         and pthread_cond_broadcast.
5690         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
5691         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
5692         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
5693         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
5694         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
5695         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
5696         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
5697         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
5698         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
5699         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
5700         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
5701         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
5702         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
5703         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
5704         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
5705         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
5706         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
5707         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
5708         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
5709         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
5710         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
5711         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
5712         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
5713         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
5714         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
5715         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
5716         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
5717         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
5718         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
5719         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
5720         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
5721
5722         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
5723         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
5724         of the code is moved to ...
5725         * sysdeps/pthread/createthread.c: ...here.  New file.
5726
5727 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
5728
5729         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
5730         (__new_sem_post): Clear %eax before returning.
5731         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
5732
5733         * Makefile (tests): Add tst-cleanup2.
5734         * tst-cleanup2.c: New file.
5735
5736         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
5737         Interpret first parameter correctly.
5738
5739 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
5740
5741         * Makefile (headers): Add bits/semaphore.h.
5742
5743 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
5744
5745         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
5746         if not SHARED.
5747
5748 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
5749
5750         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
5751         must be used and mapping failed.
5752         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
5753
5754         * Makefile (CFLAGS-pthread_self.os): Define this, not
5755         CFLAGS-pthread_self.c.
5756
5757 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5758
5759         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
5760         lll_unlock_wake_cb.
5761
5762         * Makefile (libpthread-routines): Add version.  Add rules to build
5763         version.os and banner.h.
5764         * version.c: New file.
5765
5766 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
5767
5768         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
5769         the alias unconditional.
5770         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
5771
5772 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
5773
5774         * Makefile (CFLAGS-pthread_self.c): New definition.
5775
5776 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5777
5778         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
5779         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
5780         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
5781         * init.c (__pthread_initialize_minimal_internal): Likewise.
5782
5783 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
5784
5785         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
5786
5787         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
5788         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5789         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5790         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
5791         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
5792         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
5793
5794 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
5795
5796         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
5797         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
5798         * tst-cancel-wrappers.sh: Remove all exceptions.
5799
5800 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
5801
5802         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
5803         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
5804
5805         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
5806         Use __libc_pthread_functions array if SHARED.
5807
5808         * pthreadP.h: Move pthread_cond_2_0_t definition to...
5809         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
5810
5811         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
5812         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
5813         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
5814         __libc_ptf_call instead of __libc_maybe_call.
5815         (PTF): New #define.
5816         (__libc_cleanup_region_start): Wrap function name with PTF call.
5817         (__libc_cleanup_region_end): Likewise.
5818         (__libc_cleanup_end): Likewise.
5819
5820         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
5821         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
5822         * pthread_key_create.c: Add __pthread_key_create_internal alias.
5823         * pthreadP.h: Add prototypes.
5824
5825         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
5826         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
5827         __pthread_rwlock_unlock aliases.
5828         * pthreadP.h: Add prototypes for new aliases.
5829
5830         * pthreadP.h (struct pthead_functions): Moved to...
5831         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
5832         * init.c (pthread_functions): Add initializers for new elements.
5833
5834         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
5835         __pthread_cleanup_pop_restore aliases.
5836         * pthreadP.h: Add prototypes.
5837
5838         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
5839         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
5840         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
5841         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
5842         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5843         * pthreadP.h: Adjust prototypes and callers.
5844
5845 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
5846
5847         * Makefile (tests): Add tst-cancel7.
5848         (tst-cancel7-ARGS): New variable.
5849         * tst-cancel7.c: New file.
5850
5851         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
5852         around gcc defficiencies.
5853         * old_pthread_cond_signal.c: Likewise.
5854         * old_pthread_cond_timedwait.c: Likewise.
5855         * old_pthread_cond_wait.c: Likewise.
5856
5857         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
5858
5859 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5860
5861         * Makefile (tests): Add tst-cond7.
5862         * tst-cond7.c: New file.
5863
5864         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5865         (condvar_cleanup): Get condvar address from the right place.
5866
5867         * atomic.h: Correct definitions of atomic_full_barrier,
5868         atomic_read_barrier, atomic_write_barrier.
5869
5870         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
5871         race-free.
5872         * old_pthread_cond_signal.c: Likewise.
5873         * old_pthread_cond_timedwait.c: Likewise.
5874         * old_pthread_cond_wait.c: Likewise.
5875
5876 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
5877
5878         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
5879
5880 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
5881
5882         * pthreadP.h (pthread_cond_2_0_t): New type.
5883         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
5884         Use new type for the 2.0 condvar function prototypes.
5885         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
5886         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
5887         parameter.
5888         * old_pthread_cond_destroy.c: Likewise.
5889         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
5890         * old_pthread_cond_signal.c: Likewise.
5891         * old_pthread_cond_timedwait.c: Likewise.
5892         * old_pthread_cond_wait.c: Likewise.
5893
5894         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
5895         (__pthread_cond_wait): Don't save cancellation mode and seq value
5896         in same location.
5897
5898         * herrno.c (__h_errno_location): Don't define as weak.
5899
5900 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5901
5902         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
5903         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
5904         and pthread_cond_wait.
5905         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
5906         Renamed to...
5907         (__pthread_cond_broadcast_2_0): ... this.
5908         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
5909         Renamed to...
5910         (__pthread_cond_destroy_2_0): ... this.
5911         * old_pthread_cond_init.c (__old_pthread_cond_init):
5912         Renamed to...
5913         (__pthread_cond_init_2_0): ... this.
5914         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
5915         Renamed to...
5916         (__pthread_cond_signal_2_0): ... this.
5917         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
5918         Renamed to...
5919         (__pthread_cond_wait_2_0): ... this.
5920         * pthread_cond_destroy.c: Include shlib-compat.h.
5921         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
5922         * pthread_cond_init.c: Include shlib-compat.h.
5923         (pthread_cond_init): Change strong_alias into versioned_symbol.
5924         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
5925         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
5926         fields.
5927         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
5928         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
5929         __pthread_cond_wait_2_0): New prototypes.
5930         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
5931         __old_pthread_cond_init, __old_pthread_cond_signal,
5932         __old_pthread_cond_wait): Removed.
5933         * init.c: Include shlib-compat.h.
5934         (pthread_functions): Guard ptr___pthread_attr_init_2_0
5935         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
5936         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
5937         ptr___pthread_cond_*_2_0 fields.
5938         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
5939         pthread_cond_*@GLIBC_2.0 compatibility symbols.
5940
5941         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
5942         LIBC_SIGACTION was not yet defined.
5943         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
5944         [!defined LIBC_SIGACTION] (__sigaction): New function and
5945         libc_hidden_weak.
5946         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
5947         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
5948
5949 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
5950
5951         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
5952
5953 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
5954
5955         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5956         New, larger type definition.
5957         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
5958         implementation.
5959         * Versions [libpthread]: Add definitions for new pthread_cond_*
5960         interfaces for version GLIBC_2.3.2.
5961         * pthread_cond_init.c: Update initialization for new type definition.
5962         * Makefile (libpthread-routines): Remove pthread_cond_wait,
5963         pthread_cond_timedwait, pthread_cond_signal, and
5964         pthread_cond_broadcast.  Add old_pthread_cond_init,
5965         old_pthread_cond_destroy, old_pthread_cond_wait,
5966         old_pthread_cond_timedwait, old_pthread_cond_signal, and
5967         old_pthread_cond_broadcast.
5968         * old_pthread_cond_broadcast.c: New file.
5969         * old_pthread_cond_destroy.c: New file.
5970         * old_pthread_cond_init.c: New file.
5971         * old_pthread_cond_signal.c: New file.
5972         * old_pthread_cond_timedwait.c: New file.
5973         * old_pthread_cond_wait.c: New file.
5974         * pthreadP.h: Add prototypes for the compatibility interfaces.
5975
5976         * pthread_cond_destroy.c: Don't include <errno.h>.
5977
5978 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
5979
5980         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
5981         unnecessary zero offset when addressing MUTEX.
5982
5983 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
5984
5985         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
5986         __register_atfork.
5987         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
5988         for __register_atfork.
5989
5990 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
5991
5992         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
5993         instead of ASSEMBLER test macro.
5994
5995         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
5996         __libc_current_sigrtmax): Add libc_hidden_def.
5997
5998         * sysdeps/pthread/list.h: Remove assert.h include.
5999
6000 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6001
6002         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
6003         __pthread_initialize_minimal_internal not
6004         __pthread_initialize_minimal.
6005
6006 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
6007
6008         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
6009         __pthread_initialize_minimal as hidden.
6010
6011         * init.c (__pthread_initialize_minimal_internal): Don't mark as
6012         constructor.
6013
6014 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6015
6016         * Makefile ($(inst_libdir)/libpthread.so): Depend on
6017         $(common-objpfx)format.lds, include that into the output script.
6018         Fix comment.
6019         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
6020
6021 2002-12-28  Andreas Jaeger  <aj@suse.de>
6022
6023         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
6024         nsec resolution changes.
6025         (xstat64_conv): Likewise.
6026         (xstat32_conv): Likewise.
6027         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
6028         struct kernel_stat.
6029         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
6030         structs stat and stat64.
6031         * time/time.h (__timespec_defined): Define for __USE_MISC.
6032         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
6033
6034 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
6035
6036         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
6037         argument.
6038         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
6039         (pthread_exit): Use strong_alias to avoid warnings.
6040         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
6041         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
6042         ptr___pthread_attr_init_2_*.
6043         * init.c (pthread_functions): Adjust.
6044
6045 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
6046
6047         * forward.c: Make all functions available by default again.  It
6048         caused too much trouble.
6049
6050         * pt-siglongjmp.c: Removed.
6051
6052 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
6053
6054         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
6055         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
6056         * sysdeps/i386/Makefile: New file.
6057         * sysdeps/i386/tcb-offsets.sym: New file.
6058         * sysdeps/pthread/tcb-offsets.h: New file.
6059         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6060         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
6061
6062         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
6063         __register_atfork...
6064         (GLIBC_2.3.2): ...here.
6065
6066 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6067
6068         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
6069         pthread_attr_setstackaddr with __attribute_deprecated__.
6070
6071 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6072
6073         * pt-system.c (system): Remove cancellation handling.
6074         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
6075         cancellation routines.
6076
6077 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6078
6079         * descr.h: Include <dl-sysdep.h>.
6080         (struct pthread): Move header.data.list to the back of the struct.
6081         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
6082         (MULTIPLE_THREADS_OFFSET): Adjust offset.
6083         (SYSINFO_OFFSEET): Likewise.
6084
6085 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6086
6087         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
6088         Define.
6089         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
6090         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
6091         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
6092         (USE_DL_SYSINFO): Undef.
6093
6094 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
6095
6096         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
6097         $(common-objpfx)libc.so.
6098         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
6099         it is bigger than pipe buffer size even on arches with bigger
6100         page size.
6101         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
6102
6103 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
6104
6105         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
6106         correct errno access for case that USE___THREAD is not defined.
6107
6108 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
6109
6110         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
6111         Patch by Marijn Ros <marijn@mad.scientist.com>.
6112
6113 2002-12-22  Roland McGrath  <roland@redhat.com>
6114
6115         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
6116
6117 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
6118
6119         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
6120
6121 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
6122
6123         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
6124         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
6125         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
6126
6127         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
6128         of int $0x80.
6129         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6130         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
6131         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
6132         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
6133         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
6134         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
6135         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
6136         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
6137
6138         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
6139         sysenter.
6140         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
6141
6142         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
6143
6144         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
6145         in new TCB.
6146         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
6147         that sysinfo is properly initialized.
6148         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
6149         to 1 only for ld.so.
6150
6151         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
6152         RTLD_CORRECT_DYNAMIC_WEAK.
6153
6154 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
6155
6156         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
6157         Use return 0 as 6th argument to FORWARD4.
6158         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
6159
6160 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6161
6162         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
6163         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
6164         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
6165         (INIT_SYSINFO): New #define.
6166         (TLS_TP_INIT): Use INIT_SYSINFO.
6167         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6168         At test to make sure SYSINFO_OFFSET value is correct.
6169         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
6170
6171 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
6172
6173         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
6174         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
6175         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
6176         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
6177         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
6178         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
6179         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
6180
6181 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6182
6183         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
6184         macro instead of using int $0x80 directly.
6185
6186         * sysdeps/pthread/bits/stdio-lock.h: New file.
6187         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
6188         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
6189         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
6190         * Makefile (routines): Add libc-lowlevelmutex.
6191
6192         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
6193         __i686.get_pc_thunk.dx.
6194
6195 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6196
6197         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
6198         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
6199         ($(objpfx)tst-cancel-wrappers.out): New rule.
6200         * tst-cancel-wrappers.sh: New test.
6201         * tst-locale1.c: Include signal.h.
6202         (uselocale): Test static linking of __libc_current_sigrt*.
6203
6204 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
6205
6206         * Makefile (tests): Add tst-cancel6.
6207         * tst-cancel6.c: New file
6208
6209 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6210
6211         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
6212         Define meaningfully for assembler as well.
6213         * pthreadP.h (struct pthread_functions): Remove
6214         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
6215         and ptr_pthread_attr_init_2_1 fields.
6216         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
6217         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
6218         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
6219         (FORWARD3): Define using FORWARD4.
6220         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
6221         versions.
6222         * pt-system.c: Remove duplicate stdlib.h include.
6223
6224 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
6225
6226         * sem_init.c: Define sem_init@GLIBC_2.0.
6227         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
6228         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
6229
6230         * flockfile.c: Moved to...
6231         * sysdeps/pthread/flockfile.c: ...here.  New file.
6232         * funlockfile.c: Moved to...
6233         * sysdeps/pthread/funlockfile.c: ...here.  New file.
6234         * ftrylockfile.c: Moved to...
6235         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
6236
6237 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
6238
6239         * libc-cancellation.c: Guard both function with
6240         #if !defined NOT_IN_libc.
6241         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
6242         automatically provided pthread wrappers.
6243         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
6244         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
6245         nor in libpthread.
6246         * pt-open.c: Removed.
6247         * pt-fcntl.c: Removed.
6248         * pt-fsync.c: Removed.
6249         * pt-lseek.c: Removed.
6250         * pt-msgrcv.c: Removed.
6251         * pt-msgsnd.c: Removed.
6252         * pt-msync.c: Removed.
6253         * pt-nanosleep.c: Removed.
6254         * pt-open64.c: Removed.
6255         * pt-pause.c: Removed.
6256         * pt-pread.c: Removed.
6257         * pt-pread64.c: Removed.
6258         * pt-pwrite.c: Removed.
6259         * pt-pwrite64.c: Removed.
6260         * pt-read.c: Removed.
6261         * pt-recv.c: Removed.
6262         * pt-recvfrom.c: Removed.
6263         * pt-recvmsg.c: Removed.
6264         * pt-send.c: Removed.
6265         * pt-sendto.c: Removed.
6266         * pt-sigtimedwait.c: Removed.
6267         * pt-sigwait.c: Removed.
6268         * pt-wait.c: Removed.
6269         * pt-waitpid.c: Removed.
6270         * pt-write.c: Removed.
6271         * pt-accept.c: Removed.
6272         * pt-close.c: Removed.
6273         * pt-connect.c: Removed.
6274         * pt-lseek64.c: Removed.
6275         * pt-sendmsg.c: Removed.
6276         * pt-tcdrain.c: Removed.
6277
6278 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
6279
6280         * init.c (__pthread_initialize_minimal_internal): Renamed from
6281         __pthread_initialize_minimal.  Make old name an alias.  This
6282         converts a normal relocation into a relative relocation.
6283
6284         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
6285
6286         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
6287         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
6288         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
6289         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
6290         pt-sigwaitinfo, pt-waitid, and pt-writev.
6291         * pt-creat.c: Removed.
6292         * pt-poll.c: Removed.
6293         * pt-pselect.c: Removed.
6294         * pt-readv.c: Removed.
6295         * pt-select.c: Removed.
6296         * pt-sigpause.c: Removed.
6297         * pt-sigsuspend.c: Removed.
6298         * pt-sigwaitinfo.c: Removed.
6299         * pt-waitid.c: Removed.
6300         * pt-writev.c: Removed.
6301
6302         * init.c (pthread_functions): New variable.
6303         (__pthread_initialize_minimal): Pass pointer to pthread_functions
6304         (or NULL) to __libc_pthread_init.
6305         * forward.c: Rewrite to use __libc:pthread_functions array to get
6306         function addresses.
6307         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
6308         prototype.
6309         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6310         Take new parameter.  Copy content of variable pointed to by it
6311         to __libc_pthread_init.
6312
6313         * pthreadP.h (struct pthread_functions): New type.
6314         (__libc_pthread_init): Declare.
6315
6316         * pthread_attr_destroy.c: Add namespace protected alias.
6317         * pthread_attr_getdetachstate.c: Likewise.
6318         * pthread_attr_getinheritsched.c: Likewise.
6319         * pthread_attr_getschedparam.c: Likewise.
6320         * pthread_attr_getschedpolicy.c: Likewise.
6321         * pthread_attr_getscope.c: Likewise.
6322         * pthread_attr_setdetachstate.c: Likewise.
6323         * pthread_attr_setinheritsched.c: Likewise.
6324         * pthread_attr_setschedparam.c: Likewise.
6325         * pthread_attr_setschedpolicy.c: Likewise.
6326         * pthread_attr_setscope.c: Likewise.
6327         * pthread_cond_broadcast.c: Likewise.
6328         * pthread_cond_destroy.c: Likewise.
6329         * pthread_cond_init.c: Likewise.
6330         * pthread_cond_signal.c: Likewise.
6331         * pthread_cond_wait.c: Likewise.
6332         * pthread_condattr_destroy.c: Likewise.
6333         * pthread_condattr_init.c: Likewise.
6334         * pthread_equal.c: Likewise.
6335         * pthread_exit.c: Likewise.
6336         * pthread_getschedparam.c: Likewise.
6337         * pthread_self.c: Likewise.
6338         * pthread_setcancelstate.c: Likewise.
6339         * pthread_setschedparam.c: Likewise.
6340         * pthread_mutex_destroy.c: Likewise.
6341         * pthread_mutex_init.c: Likewise.
6342         * pthreadP.h: Add prototypes for the aliases.
6343
6344         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
6345         multiple_threads member in correct TCB to 1.
6346
6347         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
6348         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
6349         member of thread decriptor, otherwise return unconditionally 1.
6350
6351 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6352
6353         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
6354         regular Linux version.  Remove file.
6355         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
6356         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
6357         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
6358         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
6359         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
6360         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
6361         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
6362         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
6363         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
6364         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
6365         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
6366         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
6367         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
6368         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
6369         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
6370         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
6371         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
6372         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
6373         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
6374         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
6375         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
6376         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
6377         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
6378         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
6379         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
6380         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
6381         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
6382         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
6383         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
6384         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
6385
6386 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6387
6388         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
6389         * sysdeps/unix/sysv/linux/open.c: Removed.
6390         * sysdeps/unix/sysv/linux/fsync.c: Removed.
6391         * sysdeps/unix/sysv/linux/lseek.c: Removed.
6392         * sysdeps/unix/sysv/linux/msync.c: Removed.
6393         * sysdeps/unix/sysv/linux/read.c: Removed.
6394         * sysdeps/unix/sysv/linux/close.c: Removed.
6395         * sysdeps/unix/sysv/linux/creat.c: Removed.
6396         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
6397         * sysdeps/unix/sysv/linux/pause.c: Removed.
6398         * sysdeps/unix/sysv/linux/select.c: Removed.
6399         * sysdeps/unix/sysv/linux/write.c: Removed.
6400
6401 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6402
6403         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
6404         element in TCB to see whether locking is needed.
6405
6406         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
6407         MULTIPLE_THREADS_OFFSET value is correct.
6408
6409         * sysdeps/unix/sysv/linux/close.c: New file.
6410         * sysdeps/unix/sysv/linux/connect.S: New file.
6411         * sysdeps/unix/sysv/linux/creat.c: New file.
6412         * sysdeps/unix/sysv/linux/fsync.c: New file.
6413         * sysdeps/unix/sysv/linux/llseek.c: New file.
6414         * sysdeps/unix/sysv/linux/lseek.c: New file.
6415         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
6416         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
6417         * sysdeps/unix/sysv/linux/msync.c: New file.
6418         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
6419         * sysdeps/unix/sysv/linux/open.c: New file.
6420         * sysdeps/unix/sysv/linux/open64.c: New file.
6421         * sysdeps/unix/sysv/linux/pause.c: New file.
6422         * sysdeps/unix/sysv/linux/poll.c: New file.
6423         * sysdeps/unix/sysv/linux/pread.c: New file.
6424         * sysdeps/unix/sysv/linux/pread64.c: New file.
6425         * sysdeps/unix/sysv/linux/pselect.c: New file.
6426         * sysdeps/unix/sysv/linux/pwrite.c: New file.
6427         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
6428         * sysdeps/unix/sysv/linux/readv.c: New file.
6429         * sysdeps/unix/sysv/linux/recv.S: New file.
6430         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
6431         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
6432         * sysdeps/unix/sysv/linux/select.c: New file.
6433         * sysdeps/unix/sysv/linux/send.S: New file.
6434         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
6435         * sysdeps/unix/sysv/linux/sendto.S: New file.
6436         * sysdeps/unix/sysv/linux/sigpause.c: New file.
6437         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
6438         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6439         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6440         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6441         * sysdeps/unix/sysv/linux/system.c: New file.
6442         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
6443         * sysdeps/unix/sysv/linux/wait.c: New file.
6444         * sysdeps/unix/sysv/linux/waitid.c: New file.
6445         * sysdeps/unix/sysv/linux/waitpid.c: New file.
6446         * sysdeps/unix/sysv/linux/writev.c: New file.
6447         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
6448
6449         * pt-readv.c: Fix comment.
6450
6451 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6452
6453         * tst-cleanup1.c: Include stdlib.h.
6454
6455         * tst-cancel5.c: New test.
6456         * Makefile (tests): Add tst-cancel5.
6457         (tst-cancel5): Link against libc.so libpthread.so in that order.
6458
6459 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
6460
6461         * forward.c (test_loaded): Prevent recursive calls.
6462
6463         * Makefile (routines): Add libc-cancellation.
6464         * libc-cancellation.c: New file.
6465         * descr.h (struct pthread): Add multiple_threads field.
6466         * allocatestack.c (allocate_stack): Initialize multiple_header field of
6467         new thread descriptor to 1.
6468         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
6469         Initialize multiple_thread field after successful thread creation.
6470         * cancellation.c (__do_cancel): Move to pthreadP.h.
6471         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
6472         (__pthread_disable_asynccancel): Add internal_function attribute.
6473         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
6474         * pthread_setcancelstate.c: Likewise.
6475         * pthread_setcanceltype.c: Likewise.
6476         * pthread_exit.c: Likewise.
6477         * pthreadP.h (CANCELLATION_P): Likewise.
6478         (__do_cancel): Define as static inline.
6479         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
6480         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
6481         declarations.
6482         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
6483         fields.  Define MULTIPLE_THREADS_OFFSET.
6484         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
6485         declaration.
6486         * sysdeps/unix/sysv/linux/accept.S: New file.
6487         * sysdeps/unix/sysv/linux/read.c: New file.
6488         * sysdeps/unix/sysv/linux/write.c: New file.
6489         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
6490         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
6491         initialization of __libc_locking_needed.
6492         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
6493         __libc_locking_needed, use multiple_threads field in TCB.
6494         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6495
6496 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6497
6498         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
6499         version.
6500         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
6501
6502         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
6503         access to __libc_locking_needed for PIC.
6504
6505 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
6506
6507         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
6508         declare for libc.so.
6509         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
6510         expression.
6511         (__libc_lock_lock): Put into statement expression.
6512         (__libc_lock_unlock): Remove trailing semicolon.
6513         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
6514
6515 2002-12-12  Roland McGrath  <roland@redhat.com>
6516
6517         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
6518         "m" constraint to refer to __libc_locking_needed.  Declare it here.
6519
6520 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6521
6522         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
6523         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
6524         Initialize __libc_locking_needed.
6525         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
6526         instead of __register_pthread_fork_handler.
6527         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
6528         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
6529         fork-gen with libc_pthread_init.
6530         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
6531         of __register_pthread_fork_handler.
6532         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
6533         of __register_pthread_fork_handler.
6534         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
6535         __libc_locking_needed to determine whether lock prefix can be avoided.
6536         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6537
6538 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
6539
6540         * Makefile (tests): Add tst-cleanup1.
6541         * tst-cleanup1.c: New file.
6542         * cancellation.c (__cleanup_thread): Removed.
6543         (__do_cancel): Remove call to __cleanup_thread.
6544         * pthreadP.h: Remove __cleanup_thread prorotype.
6545
6546         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6547         Remember function and argument even if cancellation handler
6548         function is not available.
6549         (__libc_cleanup_region_end): Execute registered function directly if
6550         pthread functions are not available.
6551         (__libc_cleanup_end): Likewise.
6552
6553         * init.c (__pthread_initialize_minimal): Fix initialization in
6554         static lib by preventing gcc from being too clever.
6555
6556 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
6557
6558         * init.c (__pthread_initialize_minimal): Remove unneccesary
6559         sigaddset call.
6560
6561         * Makefile (tests): We can run tst-locale2 now.
6562
6563 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
6564
6565         * Versions: Remove duplicated sigwait entry.
6566
6567 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
6568
6569         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
6570         inside libpthread.
6571
6572         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
6573
6574         * pthreadP.h: Declare __pthread_enable_asynccancel and
6575         __pthread_disable_asynccancel.
6576         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
6577         (CANCEL_RESET): Use __pthread_disable_asynccancel.
6578         * cancellation.c (__pthread_enable_asynccancel): New function.
6579         (__pthread_disable_asynccancel): New function.
6580         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
6581         * pt-close.c: Likewise.
6582         * pt-connect.c: Likewise.
6583         * pt-creat.c: Likewise.
6584         * pt-fcntl.c: Likewise.
6585         * pt-fsync.c: Likewise.
6586         * pt-lseek.c: Likewise.
6587         * pt-lseek64.c: Likewise.
6588         * pt-msgrcv.c: Likewise.
6589         * pt-msgsnd.c: Likewise.
6590         * pt-msync.c: Likewise.
6591         * pt-nanosleep.c: Likewise.
6592         * pt-open.c: Likewise.
6593         * pt-open64.c: Likewise.
6594         * pt-pause.c: Likewise.
6595         * pt-poll.c: Likewise.
6596         * pt-pread.c: Likewise.
6597         * pt-pread64.c: Likewise.
6598         * pt-pselect.c: Likewise.
6599         * pt-pwrite.c: Likewise.
6600         * pt-pwrite64.c: Likewise.
6601         * pt-read.c: Likewise.
6602         * pt-readv.c: Likewise.
6603         * pt-recv.c: Likewise.
6604         * pt-recvfrom.c: Likewise.
6605         * pt-recvmsg.c: Likewise.
6606         * pt-select.c: Likewise.
6607         * pt-send.c: Likewise.
6608         * pt-sendmsg.c: Likewise.
6609         * pt-sendto.c: Likewise.
6610         * pt-sigpause.c: Likewise.
6611         * pt-sigsuspend.c: Likewise.
6612         * pt-sigtimedwait.c: Likewise.
6613         * pt-sigwait.c: Likewise.
6614         * pt-sigwaitinfo.c: Likewise.
6615         * pt-system.c: Likewise.
6616         * pt-tcdrain.c: Likewise.
6617         * pt-wait.c: Likewise.
6618         * pt-waitid.c: Likewise.
6619         * pt-waitpid.c: Likewise.
6620         * pt-write.c: Likewise.
6621         * pt-writev.c: Likewise.
6622         * pthread_join.c: Likewise.
6623         * pthread_timedjoin.c: Likewise.
6624
6625         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
6626         (__xpg_sigpause): New function.
6627         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
6628
6629 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
6630
6631         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
6632
6633         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
6634         _GI_pthread_cleanup_pop to pthreadP.h.
6635
6636         * ftrylockfile.c: Use _IO_lock_trylock instead of
6637         pthread_mutex_trylock.
6638
6639         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
6640         (CANCEL_RESET): Likewise.
6641         (__pthread_setcanceltype_): Declare.
6642         (__pthread_mutex_lock_internal): Declare.
6643         (__pthread_mutex_unlock_internal): Declare.
6644         (__pthread_once_internal): Declare.
6645         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
6646         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
6647
6648         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
6649         and pthread_mutex_unlock.
6650         * pthread_cond_wait.c: Likewise.
6651         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
6652         * pthread_mutex_unlock.c: Likewise.
6653
6654         * pthread_setcanceltype.c: Add additional alias
6655         __pthread_setcanceltype.
6656
6657         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
6658         * sem_open.c (sem_open): Likewise.
6659         Use __libc_open, __libc_write, and __libc_close instead of
6660         open, write, and close respectively.
6661
6662         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
6663         Rewrite as statement expression since it must return a value.
6664
6665         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
6666         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
6667         __pthread_kill.
6668
6669         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
6670         alias __pthread_once_internal.
6671
6672         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
6673
6674 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
6675
6676         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
6677         * tst-stdio1.c: New file.
6678         * tst-stdio2.c: New file.
6679
6680         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
6681
6682         * Makefile (tests): Comment out tst-locale2 for now.
6683         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
6684
6685         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
6686         -D_IO_MTSAFE_IO.
6687         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
6688         Use _IO_lock_init instead of explicit assignment.
6689
6690         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
6691         Define __libc_lock_* and __libc_lock_recursive macros with
6692         lowlevellock macros, not pthread mutexes.
6693
6694         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
6695         of pthread_mutex_lock.
6696         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
6697         instead of pthread_mutex_unlock.
6698
6699 2002-12-06  Roland McGrath  <roland@redhat.com>
6700
6701         * allocatestack.c (__stack_user): Use uninitialized defn.
6702         * init.c (__pthread_initialize_minimal): Initialize it here.
6703
6704 2002-12-05  Roland McGrath  <roland@redhat.com>
6705
6706         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
6707         string.
6708         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
6709
6710         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
6711         missing & here too.
6712
6713 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
6714
6715         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6716         lowlevellock.
6717         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
6718         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
6719         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
6720         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
6721         for __libc_lock_* macros.
6722         * Makefile (routines): Add libc-lowlevellock.
6723
6724 2002-10-09  Roland McGrath  <roland@redhat.com>
6725
6726         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
6727         Under [__PIC__], call the function via the pointer fetched for
6728         comparison rather than a call by name that uses the PLT.
6729         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
6730         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
6731         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
6732         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
6733         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
6734
6735 2002-12-04  Roland McGrath  <roland@redhat.com>
6736
6737         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
6738
6739         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
6740         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
6741
6742         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
6743
6744 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6745
6746         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
6747         a completely opaque, non-integer type.
6748         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6749
6750 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
6751
6752         * sysdeps/i386/tls.h: Include stdlib.h.
6753         * sysdeps/x86_64/tls.h: Likewise.
6754
6755 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6756
6757         * Makefile (tests): Add tst-locale2.
6758         (tests-static): Likewise.
6759         * tst-locale2.c: New file.
6760
6761         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
6762         volatile and add memory clobbers to lock operations.
6763
6764 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
6765
6766         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
6767         * sysdeps/i386/i486/bits/atomic.h: New file.
6768         * sysdeps/i386/i586/bits/atomic.h: New file.
6769         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
6770         include i486 version.
6771         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
6772         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
6773         Patch by Marijn Ros <marijn@mad.scientist.com>.
6774
6775         * allocatestack.c (get_cached_stack): Don't crash if we first
6776         found a stack with a larger size then needed.
6777         Reported by Hui Huang <hui.huang@sun.com>.
6778
6779         * Makefile (tests): Add tst-sysconf.
6780         * tst-sysconf.c: New file.
6781
6782         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
6783         PTHREAD_THREADS_MAX.
6784
6785 2002-12-02  Roland McGrath  <roland@redhat.com>
6786
6787         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
6788         Declare using hidden_proto instead of attribute_hidden, so there are
6789         non-.hidden static symbols for gdb to find.
6790         (__pthread_keys): Likewise.
6791         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
6792         * allocatestack.c (__stack_user): Likewise.
6793         * pthread_create.c (__pthread_keys): Likewise.
6794         (__nptl_threads_events, __nptl_last_event): Make these static instead
6795         of hidden.
6796         * pthread_key_create.c (__pthread_pthread_keys_max,
6797         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
6798
6799 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
6800
6801         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
6802         statically.
6803         * tst-locale1.c: New file.
6804
6805         * pthread_cond_timedwait.c: Include <stdlib.h>.
6806
6807         * Makefile (tests): Add tst-fork2 and tst-fork3.
6808         * tst-fork2.c: New file.
6809         * tst-fork3.c: New file.
6810
6811 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
6812
6813         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
6814
6815         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
6816         require it to 200112L.
6817
6818         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
6819         instruction only if HAVE_CMOV is defined.
6820         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
6821
6822         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
6823
6824         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
6825
6826         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
6827
6828         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
6829
6830 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
6831
6832         * sysdeps/x86_64/bits/atomic.h: New file.
6833
6834         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
6835         16-bit operations.
6836
6837         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
6838         possible since gettid cannot fail.
6839
6840         * sysdeps/x86_64/pthreaddef.h: New file.
6841
6842         * sysdeps/i386/pthreaddef.h (gettid): Removed.
6843
6844         * sysdeps/x86_64/pthread_spin_init.c: New file.
6845         * sysdeps/x86_64/pthread_spin_lock.c: New file.
6846         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
6847         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
6848
6849         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
6850         Add missing lock prefix.  Minute optimization.
6851
6852         * tst-spin2.c (main): Also check successful trylock call.
6853
6854         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
6855         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
6856
6857         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
6858         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
6859
6860         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
6861         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
6862         value in case of an error.  Add support for INTERNAL_SYSCALL.
6863
6864         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
6865         value in case of an error.
6866
6867         * sysdeps/x86_64/tls.h: New file.
6868
6869 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6870
6871         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
6872         takes the array member name and the index as parameters.
6873         (THREAD_SETMEM_NC): Likewise.
6874         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
6875         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
6876         interfaces.
6877
6878         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
6879         to decide which code to use.
6880         (THREAD_SETMEM_NC): Likewise.
6881
6882         * allocatestack.c (queue_stack): Don't remove stack from list here.
6883         Do it in the caller.  Correct condition to prematurely terminate
6884         loop to free stacks.
6885         (__deallocate_stack): Remove stack from list here.
6886
6887 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
6888
6889         * Makefile (tests): Add tst-stack1.
6890         * tst-stack1.c: New file.
6891
6892         * allocatestack.c (allocate_stack): Initialize the TCB on a user
6893         provided stack.
6894
6895         * pthread_attr_getstack.c: Return bottom of the thread area.
6896
6897 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
6898
6899         * Makefile (libpthread-routines): Add pt-allocrtsig and
6900         pthread_kill_other_threads.
6901         * pt-allocrtsig.c: New file.
6902         * pthread_kill_other_threads.c: New file.
6903         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
6904         all three functions.
6905         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6906         allocrtsig.
6907         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
6908         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
6909         and __libc_allocate_rtsig_private.
6910         * Versions (libpthread): Export pthread_kill_other_threads_np,
6911         __libc_current_sigrtmin, and __libc_current_sigrtmax.
6912
6913 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
6914
6915         * allocatestack.c (allocate_stack): stackaddr in attribute points to
6916         the end of the stack.  Adjust computations.
6917         When mprotect call fails dequeue stack and free it.
6918         * pthread_attr_setstack.c: Store top of the stack in stackaddr
6919         attribute.
6920         * pthread_getattr_np.c: Likewise.
6921
6922         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
6923         surprises.
6924
6925 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
6926
6927         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
6928         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
6929
6930 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
6931
6932         * pthread_getspecific.c: Optimize access to first 2nd-level array.
6933         * pthread_setspecific.c: Likewise.
6934
6935 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
6936
6937         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
6938         definitions.  Get them from the official place.
6939         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
6940
6941         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
6942         Use new CLONE_ flags in clone() calls.
6943
6944         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
6945         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
6946
6947         * Versions: Add pthread_* functions for libc.
6948         * forward.c: New file.
6949
6950         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
6951         errno-loc.
6952         * herrno.c: New file.
6953         * res.c: New file.
6954
6955         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
6956         sem_trywait, and sem_timedwait.  Add herrno and res.
6957         * sem_init.c: Don't initialize lock and waiters members.
6958         * sem_open.c: Likewise.
6959         * sem_post.c: Removed.
6960         * sem_wait.c: Removed.
6961         * sem_trywait.c: Removed.
6962         * sem_timedwait.c: Removed.
6963         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
6964         Includes full implementations of sem_post, sem_wait, sem_trywait,
6965         and sem_timedwait.
6966         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
6967         for new implementation.
6968         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
6969         and waiters fields.
6970
6971         * tst-sem3.c: Improve error message.
6972         * tst-signal3.c: Likewise.
6973
6974         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
6975         to tell the kernel about the termination futex and to initialize tid
6976         member.  Don't initialize main_thread.
6977         * descr.h (struct pthread): Remove main_thread member.
6978         * cancelllation.c (__do_cancel): Remove code handling main thread.
6979         The main thread is not special anymore.
6980
6981         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
6982         size of the stacks to stack_cache_actsize.
6983
6984         * pt-readv.c: Add missing "defined".
6985         * pt-sigwait.c: Likewise.
6986         * pt-writev.c: Likewise.
6987
6988 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
6989
6990         * Versions: Export __connect from libpthread.
6991         Patch by Luca Barbieri <ldb@ldb.ods.org>.
6992
6993         * Makefile (libpthread-routines): Add pt-raise.
6994         * sysdeps/unix/sysv/linux/raise.c: New file.
6995         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
6996         * sysdeps/generic/pt-raise.c: New file.
6997
6998         * pthread_cond_init.c: Initialize all data elements of the condvar
6999         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7000
7001         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
7002         * pthread_create.c: Likewise.
7003
7004         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
7005         * tst-key1.c: New file.
7006         * tst-key2.c: New file.
7007         * tst-key3.c: New file.
7008
7009         * Versions: Export pthread_detach for version GLIBC_2.0.
7010         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
7011
7012 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
7013
7014         * pthread_key_create.c: Terminate search after an unused key was found.
7015         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7016
7017         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
7018         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7019
7020 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
7021
7022         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
7023         dynamic lookup for errno in PIC.
7024
7025         * allocatestack.c (get_cached_stack): Rearrange code slightly to
7026         release the stack lock as soon as possible.
7027         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
7028         the static TLS block.
7029         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
7030
7031         * cancellation.c: Renamed from cancelation.c.
7032         * Makefile: Adjust accordingly.
7033         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
7034         * cleanup_defer.c: Use CANCELLATION_P.
7035         * pthread_testcancel.c: Likewise.
7036         * descr.h: Fix spelling in comments.
7037         * init.c: Likewise.
7038         * pthread_getattr_np.c: Likewise.
7039         * pthread_getschedparam.c: Likewise.
7040         * pthread_setschedparam.c: Likewise.
7041         * Versions: Likewise.
7042
7043         * pt-pselect.c: New file.
7044         * Makefile (libpthread-routines): Add pt-pselect.
7045         * Versions: Add pselect.
7046
7047         * tst-cancel4.c: New file.
7048         * Makefile (tests): Add tst-cancel4.
7049
7050 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
7051
7052         * pthread_mutex_lock.c: Always record lock ownership.
7053         * pthread_mutex_timedlock.c: Likewise.
7054         * pthread_mutex_trylock.c: Likewise.
7055
7056         * pt-readv.c: New file.
7057         * pt-writev.c: New file.
7058         * pt-creat.c: New file.
7059         * pt-msgrcv.c: New file.
7060         * pt-msgsnd.c: New file.
7061         * pt-poll.c: New file.
7062         * pt-select.c: New file.
7063         * pt-sigpause.c: New file.
7064         * pt-sigsuspend.c: New file.
7065         * pt-sigwait.c: New file.
7066         * pt-sigwaitinfo.c: New file.
7067         * pt-waitid.c: New file.
7068         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
7069         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
7070         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
7071         * Versions: Add all the new functions.
7072
7073         * tst-exit1.c: New file.
7074         * Makefile (tests): Add tst-exit1.
7075
7076         * sem_timedwait.c: Minor optimization for more optimal fastpath.
7077
7078 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
7079
7080         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
7081
7082         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
7083         call.  pthread_join is an official cancellation point.
7084         * pthread_timedjoin.c: Likewise.
7085
7086         * pthread_cond_wait.c: Revert order in which internal lock are dropped
7087         and the condvar's mutex are retrieved.
7088         * pthread_cond_timedwait.c: Likewise.
7089         Reported by dice@saros.East.Sun.COM.
7090
7091 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
7092
7093         * pthreadP.h: Cut out all type definitions and move them...
7094         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
7095         * pthreadP.h: Include <internaltypes.h>.
7096
7097         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
7098         performance tweaks.
7099
7100         * sem_trywait.c: Shuffle #includes around to get right order.
7101         * sem_timedwait.c: Likewise.
7102         * sem_post.c: Likewise.
7103         * sem_wait.c: Likewise.
7104
7105         * nptl 0.3 released.
7106
7107         * Makefile (tests): Add tst-signal3.
7108         * tst-signal3.c: New file.
7109
7110 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
7111
7112         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
7113         the asms modify the sem object.
7114         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
7115
7116         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
7117         the actual members.
7118         * pthreadP.h (struct sem): New type.  Actual semaphore type.
7119         * semaphoreP.h: Include pthreadP.h.
7120         * sem_getvalue.c: Adjust to sem_t change.
7121         * sem_init.c: Likewise.
7122         * sem_open.c: Likewise.
7123         * sem_post.c: Likewise.
7124         * sem_timedwait.c: Likewise.
7125         * sem_trywait.c: Likewise.
7126         * sem_wait.c: Likewise.
7127
7128 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
7129
7130         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
7131         * tst-basic2.c: New file.
7132         * tst-exec1.c: New file.
7133         * tst-exec2.c: New file.
7134         * tst-exec3.c: New file.
7135
7136         * tst-fork1.c: Remove extra */.
7137
7138         * nptl 0.2 released.  The API for IA-32 is complete.