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