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