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