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