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