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