5f591b048777d2b9acec266d6b051c488b67e18a
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2013-02-21  Carlos O'Donell  <carlos@redhat.com>
2
3         * sysdeps/unix/sysv/linux/fork.c: Fix comment typo.
4
5 2013-02-18  Siddhesh Poyarekar  <siddhesh@redhat.com>
6
7         * sysdeps/pthread/tst-timer.c: Include stdlib.h for declaration
8         of exit.
9         * tst-barrier4.c: Likewise.
10         * tst-robust7.c: Likewise.
11
12         [BZ #14920]
13         * pthreadP.h (USE_REQUEUE_PI): New macro to check if mutex is
14         PI-aware.
15         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Use
16         PI-aware futex operations if available and mutex is PI-aware.
17         * pthread_cond_signal.c (__pthread_cond_signal): Likewise.
18         * nptl/pthread_cond_timedwait.c (__pthread_cond_timedwait):
19         Likewise.
20         * pthread_cond_wait.c (__condvar_cleanup): Adjust lock if
21         cancellation occurred just after futex returned successfully
22         from a PI operation with the mutex held.
23         (__pthread_cond_wait): Use PI-aware futex operations if
24         available and mutex is PI-aware.
25         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
26         (FUTEX_WAIT_REQUEUE_PI): Define.
27         (FUTEX_CMP_REQUEUE_PI): Likewise.
28         (lll_futex_wait_requeue_pi): Likewise.
29         (lll_futex_timed_wait_requeue_pi): Likewise.
30         (lll_futex_cmp_requeue_pi): Likewise.
31         * nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
32         (FUTEX_WAIT_REQUEUE_PI): Define.
33         (FUTEX_CMP_REQUEUE_PI): Likewise.
34         (lll_futex_wait_requeue_pi): Likewise.
35         (lll_futex_timed_wait_requeue_pi): Likewise.
36         (lll_futex_cmp_requeue_pi): Likewise.
37         * sysdeps/unix/sysv/linux/kernel-features.h: Define
38         __ASSUME_REQUEUE_PI for Linux version higher than 2.6.31.
39
40 2013-02-04  Andreas Schwab  <schwab@suse.de>
41
42         [BZ #14142]
43         * tst-cancel14.c: Include <sys/time.h>.
44         * tst-cancel15.c: Likewise.
45         * tst-mutex9.c: Include <stdint.h>, <stdlib.h> and <sys/time.h>.
46         * tst-stackguard1.c: Include <tls.h>
47
48 2013-01-16  Andreas Schwab  <schwab@suse.de>
49
50         [BZ #14327]
51         * sem_open.c (sem_open): Use __mktemp instead of mktemp.
52
53 2013-01-11  Carlos O'Donell  <codonell@redhat.com>
54
55         * allocatestack.c (allocate_stack): Add comment. Remove assert
56         on attr.
57
58 2013-01-11  H.J. Lu  <hongjiu.lu@intel.com>
59
60         * Makefile (tst-cancel7-ARGS: Replace $(host-built-program-cmd)
61         with $(host-test-program-cmd).
62         (tst-exec4-ARGS): Likewise.
63         (tst-stackguard1-ARGS): Likewise.
64         ($(objpfx)tst-tls6.out): Don't pass $(elf-objpfx) to tst-tls6.sh.
65         Replace $(rtld-installed-name) with $(test-via-rtld-prefix).
66         * tst-tls6.sh (elf_objpfx): Removed.
67         (rtld_installed_name): Renamed to ...
68         (test_via_rtld_prefix): This.
69         (tst_tls5): Prepend ${test_via_rtld_prefix}.
70
71 2013-01-02  Joseph Myers  <joseph@codesourcery.com>
72
73         * All files with FSF copyright notices: Update copyright dates
74         using scripts/update-copyrights.
75
76 2013-01-01  Joseph Myers  <joseph@codesourcery.com>
77
78         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Reformat
79         copyright notice.
80
81 2012-12-28  Andi Kleen  <ak@linux.intel.com>
82
83         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Convert
84         to prototype.
85         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock):
86         Likewise.
87
88 2012-12-27  David S. Miller  <davem@davemloft.net>
89
90         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
91         (lll_futex_timed_wait_bitset): New macro.
92
93 2012-12-27  Siddhesh Poyarekar  <siddhesh@redhat.com>
94
95         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (SYS_futex):
96         Remove definition.
97         (lll_futex_timed_wait): Replace assembly code with
98         INTERNAL_SYSCALL.
99         (lll_futex_timed_wait_bitset): Likewise.
100         (lll_futex_wake): Likewise.
101         (lll_futex_requeue): Likewise.
102         (lll_futex_wake_unlock): Likewise.
103
104 2012-12-08  Siddhesh Poyarekar  <siddhesh@redhat.com>
105
106         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind):
107         Declare LOCAL_VAR as char.
108
109 2012-12-04  Joseph Myers  <joseph@codesourcery.com>
110
111         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__old_sem_post):
112         Cast result of atomic_increment_val to (void) instead of storing
113         in otherwise-unused variable.
114
115 2012-12-03  Allan McRae  <allan@archlinux.org>
116
117         * Makefile (LDFLAGS-tst-cond24, LDFLAGS-tst-cond25): Remove.
118
119 2012-11-26  H.J. Lu  <hongjiu.lu@intel.com>
120
121         * unwind.c (__pthread_unwind): Pass address of unwind_cleanup
122         to THREAD_SETMEM.
123         * sysdeps/i386/tls.h: Include <libc-internal.h>.
124         (THREAD_SETMEM): Use cast_to_integer before casting to uint64_t.
125         (THREAD_SETMEM_NC): Likewise.
126         * sysdeps/x86_64/tls.h: Include <libc-internal.h>.
127         (THREAD_SETMEM): Use cast_to_integer before casting to uint64_t.
128         (THREAD_SETMEM_NC): Likewise.
129
130 2012-11-21  Joseph Myers  <joseph@codesourcery.com>
131
132         * sysdeps/unix/sysv/linux/sem_post.c (__old_sem_post): Cast result
133         of atomic_increment_val to (void) instead of storing in
134         otherwise-unused variable.
135
136         * pthread_cond_timedwait.c (__pthread_cond_timedwait)
137         [__NR_clock_gettime]: Cast result of INTERNAL_VSYSCALL to void
138         instead of storing in otherwise-unused variable.
139
140 2012-11-14  Marcus Shawcroft  <marcus.shawcroft@linaro.org>
141
142         * Makefile (CFLAGS-open.c, CFLAGS-open64.c, CFLAGS-pause.c)
143           (CFLAGS-recv.c, CFLAGS-send.c): Define.
144
145 2012-11-06  Chris Metcalf  <cmetcalf@tilera.com>
146
147         * tst-sem14.c (TIMEOUT): Set timeout to 10 seconds.
148         * tst-cond24.c (TIMEOUT): Increase from 10 to 20 seconds.
149
150 2012-11-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
151
152         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Time out
153         if absolute timeout is negative.
154         [__ASSUME_FUTEX_CLOCK_REALTIME &&
155         lll_futex_timed_wait_bitset]: Use lll_futex_timed_wait_bitset.
156         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
157         Likewise.
158         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
159         Likewise.
160         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
161         (__lll_robust_timedlock_wait): Likewise.
162         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
163         (lll_futex_timed_wait_bitset): New macro.
164         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
165         (lll_futex_timed_wait_bitset): Likewise.
166
167 2012-11-03  David S. Miller  <davem@davemloft.net>
168
169         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (BUSY_WAIT_NOP):
170         Add missing spaces.
171         (__cpu_relax): Likewise.
172
173 2012-11-02  H.J. Lu  <hongjiu.lu@intel.com>
174
175         * sysdeps/x86_64/tls.h: Don't include <xmmintrin.h>.
176         (__128bits): New struct typedef.
177         (tcbhead_t): Replace __m128 with __128bits.
178
179 2012-10-30  Aurelien Jarno  <aurelien@aurel32.net>
180             Joseph Myers  <joseph@codesourcery.com>
181
182         * Makefile (tst-cancel7-ARGS): Use exec in --command argument.
183
184 2012-10-28  David S. Miller  <davem@davemloft.net>
185
186         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (BUSY_WAIT_NOP):
187         Define when we have v9 instructions available.
188         * sysdeps/unix/sysv/linux/sparc/sparc64/cpu_relax.S: New file.
189         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/cpu_relax.S: New
190         file.
191         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/Makefile: New
192         file.
193         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: Add cpu_relax
194         to libpthread-routines.
195
196 2012-10-25  Roland McGrath  <roland@hack.frob.com>
197
198         * tst-cond-except.c (TEST_FUNCTION): New macro.
199
200 2012-10-25  Joseph Myers  <joseph@codesourcery.com>
201
202         * Makefile ($(objpfx)tst-tls6.out): Use $(BASH) not $(SHELL) to
203         run tst-tls6.sh.
204         * tst-tls6.sh: Use /bin/bash not /bin/sh.
205
206 2012-10-25  Roland McGrath  <roland@hack.frob.com>
207
208         * tst-basic2.c (do_test): Return RESULT, not always zero.
209
210         * tst-cond25.c: Include <stdint.h>
211         (waiter): Add casts to uintptr_t between casting integer<->pointer.
212         (timed_waiter): Likewise.
213         (do_test_wait): Likewise.
214         * tst-cond-except.c (thr): Likewise.
215         (do_test): Use prototype definition.
216
217 2012-10-24  Joseph Myers  <joseph@codesourcery.com>
218             Jim Blandy  <jimb@codesourcery.com>
219
220         * Makefile ($(objpfx)tst-tls6.out): Pass $(test-wrapper-env) to
221         tst-tls6.sh.
222         * tst-tls6.sh (test_wrapper_env): New variable.  Use it to run
223         programs with LD_PRELOAD set.
224
225 2012-10-24  Roland McGrath  <roland@hack.frob.com>
226
227         * Makefile ($(objpfx)tst-cond11, $(objpfx)tst-cond19): Targets removed.
228         ($(objpfx)tst-sem5, $(objpfx)tst-cancel18): Likewise.
229         ((objpfx)tst-cancelx18, $(objpfx)tst-clock2): Likewise.
230         ($(objpfx)tst-rwlock14): Likewise.
231
232 2012-10-24  Joseph Myers  <joseph@codesourcery.com>
233
234         * Makefile (tests): Remove tst-oddstacklimit.
235         (test-srcs): New variable.
236         (tst-oddstacklimit-ENV): Remove.
237         [$(run-built-tests) = yes] (tests): Depend on
238         $(objpfx)tst-oddstacklimit.out.
239         [$(run-built-tests) = yes] ($(objpfx)tst-oddstacklimit.out): New
240         target.
241         * tst-oddstacklimit.c: Do not include "tst-basic1.c".  Use
242         setrlimit before executing tst-basic1 test passed to --command.
243
244 2012-10-23  Joseph Myers  <joseph@codesourcery.com>
245
246         * Makefile [$(cross-compiling) = no]: Change condition to
247         [$(run-built-tests) = yes].
248
249 2012-10-23  Jim Blandy  <jimb@codesourcery.com>
250             Joseph Myers  <joseph@codesourcery.com>
251
252         * Makefile (tst-cancel7-ARGS): Use $(host-built-program-cmd).
253         (tst-exec4-ARGS): Likewise.
254         (tst-stackguard1-ARGS): Likewise.
255
256 2012-10-21  Jim Blandy  <jimb@codesourcery.com>
257             Joseph Myers  <joseph@codesourcery.com>
258
259         * Makefile ($(objpfx)tst-cancel-wrappers.out): Pass $(NM) to
260         tst-cancel-wrappers.sh.
261         * tst-cancel-wrappers.sh: Use nm program given as first argument,
262         not hardcoded "nm".
263
264 2012-10-17  Siddhesh Poyarekar  <siddhesh@redhat.com>
265
266         * tst-cond25.c (do_test_wait): Don't check for return value from
267         pthread_cancel.
268
269 2012-10-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
270
271         [BZ #14652]
272         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
273         (__condvar_tw_cleanup):  Adjust the mutex data structure if it
274         was locked by FUTEX_WAIT_REQUEUE_PI.
275         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait
276         (__condvar_w_cleanup): Likewise.
277         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
278         (__condvar_cleanup2): Likewise.
279         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
280         (__condvar_cleanup1): Likewise.
281
282 2012-10-10  Carlos O'Donell  <carlos@systemhalted.org>
283
284         * sysdeps/pthread/pthread.h [!(defined __GNUC__ &&
285         defined __EXCEPTIONS) && defined __USE_GNU]
286         (pthread_cleanup_push_defer_np): Fix formatting.
287
288 2012-10-10  Siddhesh Poyarekar  <siddhesh@redhat.com>
289
290         [BZ #14652]
291         * Makefile (tests): New test case tst-cond25.
292         (LDFLAGS-tst-cond25): Link tst-cond25 against librt.
293         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
294         (__condvar_tw_cleanup): Lock mutex only if we don't already
295         own it.
296         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
297         (__condvar_w_cleanup): Likewise.
298         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add TID_MASK.
299         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
300         (__condvar_cleanup2): Lock mutex only if we don't already
301         own it.
302         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
303         (__condvar_cleanup1): Likewise.
304         * tst-cond25.c: New test case.
305
306 2012-10-09  Roland McGrath  <roland@hack.frob.com>
307
308         * sysdeps/pthread/configure: Regenerated.
309         * sysdeps/x86_64/configure: Regenerated.
310
311 2012-10-05  David S. Miller  <davem@davemloft.net>
312
313         [BZ #14568]
314         * sysdeps/sparc/tls.h (DB_THREAD_SELF_INCLUDE): Delete.
315         (DB_THREAD_SELF): Use constants for the register offsets.  Correct
316         the case of a 64-bit debugger with a 32-bit inferior.
317
318 2012-10-05  H.J. Lu  <hongjiu.lu@intel.com>
319
320         [BZ #14557]
321         * Makefile (tests-static): Add tst-cancel24-static,
322         tst-cond8-static tst-mutex8-static, tst-mutexpi8-static,
323         tst-sem11-static and tst-sem12-static.
324         (tests): Likewise.
325         (LDLIBS-tst-cancel24-static): New macro.
326         * tst-cancel24-static.cc: New file.
327         * tst-cond8-static.c: Likewise.
328         * tst-mutex8-static.c: Likewise.
329         * tst-mutexpi8-static.c: Likewise.
330         * tst-sem11-static.c: Likewise.
331         * tst-sem12-static.c: Likewise.
332
333 2012-10-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
334
335         [BZ #14417]
336         * Makefile (tests): New test case tst-cond24.
337         (LDFLAGS-tst-cond24): Link tst-cond24 against librt.
338         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
339         (__pthread_cond_timedwait): Unlock mutex before going back to
340         wait in PI case.
341         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
342         (__pthread_cond_wait): Likewise.  Revert handling of EAGAIN
343         return from futex_wait.
344         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
345         (__pthread_cond_timedwait): Unlock mutex before going back to
346         wait in PI case.  Set requeue_pi flag only if wait returned 0.
347         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
348         (__pthread_cond_wait): Likewise.  Revert handling of EAGAIN
349         return from futex_wait.
350         * tst-cond24.c: New test case.
351
352 2012-10-04  Roland McGrath  <roland@hack.frob.com>
353
354         * pthread_create.c (start_thread): Use __madvise, not madvise.
355
356 2012-10-02  H.J. Lu  <hongjiu.lu@intel.com>
357
358         * sysdeps/i386/tls.h: Update copyright years.
359
360 2012-10-02  Siddhesh Poyarekar  <siddhesh@redhat.com>
361
362         * pthread_create.c (start_thread): Fix clone flag name in
363         comment to CLONE_CHILD_CLEARTID.
364         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
365         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
366         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
367         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
368         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
369         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
370
371 2012-10-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
372
373         [BZ #14477]
374         * Makefile (tests): Add tst-cond-except.
375         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
376         (__pthread_cond_timedwait): Mark instructions where %ebx is
377         incremented in PI case.
378         (.gcc_except_table): Add entry to jump to __condvar_tw_cleanup2
379         for the marked PI case instructions.
380         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
381         (__pthread_cond_wait): Mark instructions where %ebx is
382         incremented in PI case.
383         (.gcc_except_table): Add entry to jump to __condvar_w_cleanup2
384         for the marked PI case instructions.
385         * tst-cond-except.c: New test case.
386
387 2012-09-24  Dmitry V. Levin  <ldv@altlinux.org>
388
389         * tst-tls6.sh: Add "set -e".
390         * Makefile: Do not specify -e option when running testsuite
391         shell scripts.
392
393         * tst-tls6.sh: Add copyright header.
394
395 2012-09-24  H.J. Lu  <hongjiu.lu@intel.com>
396
397         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Add "()" when casting
398         to uint64_t for 64-bit store.
399         (THREAD_SETMEM_NC): Likewise.
400
401 2012-09-19  H.J. Lu  <hongjiu.lu@intel.com>
402
403         * sysdeps/i386/tls.h (THREAD_SETMEM): Cast to uint64_t for
404         64-bit store.
405         (THREAD_SETMEM_NC): Likewise.
406
407 2012-09-14  Jeff Law  <law@redhat.com>
408
409         [BZ #14583]
410         * sysdeps/pthread/pthread.h: Fix prototype of __sigsetjmp.
411
412 2012-09-13  H.J. Lu  <hongjiu.lu@intel.com>
413
414         [BZ #14576]
415         * sysdeps/pthread/bits/libc-lockP.h (__rtld_lock_init_recursive):
416         Removed.
417
418 2012-09-07  H.J. Lu  <hongjiu.lu@intel.com>
419
420         * Makefile (LDFLAGS-tst-cancel24): Renamed to ...
421         (LDLIBS-tst-cancel24): This.
422
423 2012-09-06  H.J. Lu  <hongjiu.lu@intel.com>
424
425         [BZ #14545]
426         * Makefile (tests-static): Add tst-cancel21-static.
427         (tests): Likewise.
428         * tst-cancel21-static.c: New file.
429
430 2012-09-01  Joseph Myers  <joseph@codesourcery.com>
431
432         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
433         [!__ASSUME_POSIX_CPU_TIMERS]: Remove conditional code.
434         [__NR_clock_getres]: Make code unconditional.
435         (pthread_getcpuclockid): Remove code left unreachable by removal
436         of conditionals.
437
438 2012-08-31  Joseph Myers  <joseph@codesourcery.com>
439
440         [BZ #14532]
441         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Use
442         atomic_compare_and_exchange_bool_rel.
443         * tst-sem14.c: New file.
444         * Makefile (tests): Add tst-sem14.
445
446 2012-08-15  Roland McGrath  <roland@hack.frob.com>
447
448         * Makefile (CFLAGS-flockfile.c): Use $(libio-mtsafe) instead
449         of -D_IO_MTSAFE_IO.
450         (CFLAGS-ftrylockfile.c, CFLAGS-funlockfile.c): Likewise.
451         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-fork.c): Likewise.
452
453 2012-08-16  Joseph Myers  <joseph@codesourcery.com>
454
455         * pthread_cond_timedwait.c (__pthread_cond_timedwait)
456         [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
457         * pthread_condattr_setclock.c (pthread_condattr_setclock)
458         [!__ASSUME_POSIX_TIMERS]: Likewise.
459         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
460         (__pthread_cond_timedwait) [!__ASSUME_POSIX_TIMERS]: Likewise.
461         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
462         [!__ASSUME_POSIX_TIMERS]: Likewise.
463         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
464         (__pthread_cond_timedwait) [!__ASSUME_POSIX_TIMERS]: Likewise.
465         * sysdeps/unix/sysv/linux/timer_create.c [__NR_timer_create]: Make
466         code unconditional.
467         [!__NR-timer_create]: Remove conditional code.
468         (timer_create) [!__ASSUME_POSIX_TIMERS]: Likewise.
469         * sysdeps/unix/sysv/linux/timer_delete.c [__NR_timer_delete]: Make
470         code unconditional.
471         [!__NR_timer_delete]: Remove conditional code.
472         (timer_delete) [!__ASSUME_POSIX_TIMERS]: Likewise.
473         * sysdeps/unix/sysv/linux/timer_getoverr.c
474         [__NR_timer_getoverrun]: Make code unconditional.
475         [!__NR_timer_getoverrun]: Remove conditional code.
476         (timer_getoverrun) [!__ASSUME_POSIX_TIMERS]: Likewise.
477         * sysdeps/unix/sysv/linux/timer_gettime.c [__NR_timer_gettime]:
478         Make code unconditional.
479         [!__NR_timer_gettime]: Remove conditional code.
480         (timer_gettime) [!__ASSUME_POSIX_TIMERS]: Likewise.
481         * sysdeps/unix/sysv/linux/timer_routines.c [__NR_timer_create]:
482         Make code unconditional.
483         [!__ASSUME_POSIX_TIMERS]: Remove conditional code.
484         * sysdeps/unix/sysv/linux/timer_settime.c [__NR_timer_settime]:
485         Make code unconditional.
486         [!__NR_timer_settime]: Remove conditional code.
487         (timer_settime) [!__ASSUME_POSIX_TIMERS]: Likewise.
488         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
489         (__pthread_cond_timedwait) [!__ASSUME_POSIX_TIMERS]: Remove
490         conditional code.
491
492 2012-08-15  Tom de Vries  <vries@codesourcery.com>
493             Maxim Kuvyrkov  <maxim@codesourcery.com>
494
495         * sysdeps/pthread/bits/libc-lockP.h (__libc_lock_lock)
496         (__libc_lock_trylock): Allow pre-existing definitions.
497
498 2012-08-15  Maxim Kuvyrkov  <maxim@codesourcery.com>
499
500         * pthread_spin_lock.c: New file.
501         * pthread_spin_trylock.c: New file.
502
503 2012-08-08  Joseph Myers  <joseph@codesourcery.com>
504
505         * allocatestack.c (setxid_signal_thread) [__ASSUME_TGKILL]: Make
506         code unconditional.
507         (setxid_signal_thread) [!__ASSUME_TGKILL]: Remove conditional code.
508         * pthread_cancel.c (pthread_cancel) [__ASSUME_TGKILL]: Make code
509         unconditional.
510         (pthread_cancel) [!__ASSUME_TGKILL]: Remove conditional code.
511         * sysdeps/pthread/createthread.c (do_clone) [__ASSUME_TGKILL]:
512         Make code unconditional.
513         (do_clone) [!__ASSUME_TGKILL]: Remove conditional code.
514         * sysdeps/unix/sysv/linux/pt-raise.c (raise) [__ASSUME_TGKILL ||
515         __NR_tgkill]: Make code unconditional.
516         (raise) [__ASSUME_TGKILL]: Likewise.
517         (raise) [!__ASSUME_TGKILL]: Remove conditional code.
518         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill)
519         [__ASSUME_TGKILL]: Make code unconditional.
520         (__pthread_kill) [!__ASSUME_TGKILL]: Remove conditional code.
521         * sysdeps/unix/sysv/linux/raise.c (raise) [__ASSUME_TGKILL ||
522         __NR_tgkill]: Make code unconditional.
523         (raise) [__ASSUME_TGKILL]: Likewise.
524         (raise) [!__ASSUME_TGKILL]: Remove conditional code.
525
526 2012-08-07  Joseph Myers  <joseph@codesourcery.com>
527
528         * sysdeps/pthread/createthread.c (create_thread)
529         [!__ASSUME_NO_CLONE_DETACHED]: Remove conditional code.
530
531 2012-08-03  Joseph Myers  <joseph@codesourcery.com>
532
533         * nptl-init.c (sigcancel_handler) [__ASSUME_CORRECT_SI_PID]: Make
534         code unconditional.
535         (sighandler_setxid) [__ASSUME_CORRECT_SI_PID]: Likewise.
536
537 2012-07-28  Siddhesh Poyarekar  <siddhesh@redhat.com>
538
539         * tst-pthread-getattr.c (MAX_STACK_SIZE): New macro.
540         (pagesize): New static variable.
541         (allocate_and_test): Return MEM.  Rename parameter to TARGET.
542         (check_stack_top): New local variables MEM and PAGEMASK.  Cap
543         stack size to MAX_STACK_SIZE.  Call allocate_and_test for
544         halfway up the stack top page.  Verify that the top page was
545         written into.
546         (do_test): Get pagesize using sysconf.
547
548 2012-07-25  Andreas Schwab  <schwab@linux-m68k.org>
549
550         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Remove pseudo_end
551         label.
552         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Likewise.
553         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO):
554         Likewise.
555
556 2012-07-25  Siddhesh Poyarekar  <siddhesh@redhat.com>
557
558         * tst-pthread-getattr.c: Revert last change.
559
560 2012-07-20  Siddhesh Poyarekar  <siddhesh@redhat.com>
561
562         * tst-pthread-getattr.c (MAX_STACK_SIZE): New max cap for stack
563         size.
564         (_MIN): New macro.
565         (allocate_and_test): Return STACKADDR.  Access STACKADDR instead
566         of MEM to test.
567         (check_stack_top): Read valued written into STACKADDR in
568         allocate_and_test.  Cap stack size to MAX_STACK_SIZE.
569
570 2012-07-19  Siddhesh Poyarekar  <siddhesh@redhat.com>
571
572         * nptl-init.c (sighandler_setxid): Fix the comment that
573         describes it.
574
575 2012-06-23  Thomas Schwinge  <thomas@codesourcery.com>
576
577         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
578         (__lll_robust_timedlock_wait): Simplify CFI directives.
579
580 2012-06-20  Siddhesh Poyarekar  <siddhesh@redhat.com>
581
582         [BZ #12416]
583         * Makefile (tests): Add test case.
584         * pthread_getattr_np.c (pthread_getattr_np): Deduct pages below
585         the __libc_stack_end page from stacksize.  Truncate stacksize to
586         make it page aligned when it is computed from RLIMIT_STACK.
587         * tst-pthread-getattr.c: New test case. Verify that stackaddr is
588         accessible.
589
590 2012-06-07  Carlos Sánchez de La Lama  <csanchezdll@gmail.com>
591
592         [BZ #14205]
593         * sysdeps/sparc/sparc32/pthread_spin_lock.S: Do not use v9
594         branches.
595
596 2012-06-04  Siddhesh Poyarekar  <siddhesh@redhat.com>
597             Jakub Jelinek  <jakub@redhat.com>
598
599         [BZ #14188]
600         * sysdeps/pthread/pthread.h
601         [!(defined __GNUC__ && defined __EXCEPTIONS)]
602         (pthread_cleanup_push, pthread_cleanup_push_defer_np): Use
603         __libc_unlikely instead of __builtin_expect.
604
605 2012-05-30  H.J. Lu  <hongjiu.lu@intel.com>
606
607         [BZ #14117]
608         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Removed.
609         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
610         * sysdeps/unix/sysv/linux/i386/Implies: New file.
611         * sysdeps/unix/sysv/linux/x86_64/Implies: Likewise.
612         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Renamed
613         to ...
614         * sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h: This.
615         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Renamed
616         to ...
617         * sysdeps/unix/sysv/linux/x86/bits/semaphore.h: This.
618
619 2012-05-30  Andreas Schwab  <schwab@linux-m68k.org>
620
621         [BZ #14132]
622         * nptl-init.c (pthread_functions): Remove use of INTUSE and
623         _internal aliases.
624         (__pthread_initialize_minimal_internal): Likewise.
625         * sem_open.c: Likewise.
626         * sem_unlink.c: Likewise.
627         * pthreadP.h: Replace _internal aliases by hidden_proto
628         declarations.
629         * pthread_getspecific.c: Replace _internal alias by hidden_def.
630         * pthread_key_create.c: Likewise.
631         * pthread_mutex_destroy.c: Likewise.
632         * pthread_mutex_init.c: Likewise.
633         * pthread_mutex_lock.c: Likewise.
634         * pthread_mutex_unlock.c: Likewise.
635         * pthread_once.c: Likewise.
636         * pthread_rwlock_rdlock.c: Likewise.
637         * pthread_rwlock_unlock.c: Likewise.
638         * pthread_rwlock_wrlock.c: Likewise.
639         * pthread_setspecific.c: Likewise.
640         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
641         Likewise.
642         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
643         Likewise.
644         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
645         Likewise.
646         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
647         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
648         * sysdeps/unix/sysv/linux/s390/pthread_once.c: Likewise.
649         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Likewise.
650         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
651         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
652         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
653         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
654         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
655         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
656         Likewise.
657         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
658         Likewise.
659         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
660         Likewise.
661
662 2012-05-27  Chung-Lin Tang  <cltang@codesourcery.com>
663
664         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO, LOAD_ARGS_1)
665         (LOAD_ARGS_2 ,LOAD_ARGS_3 ,LOAD_ARGS_4): Add CFI restores.
666
667         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_lock_wait_private)
668         (__lll_lock_wait, __lll_timedlock_wait, __lll_timedwait_tid): Add CFI
669         directives.
670         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
671         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Likewise.
672         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
673         (pthread_barrier_wait): Likewise.
674         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
675         (__pthread_cond_broadcast): Likewise.
676         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
677         (__pthread_cond_signal): Likewise.
678         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
679         (__pthread_cond_timedwait): Likewise.
680         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S (__pthread_cond_wait):
681         Likewise.
682         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S
683         (__pthread_rwlock_rdlock): Likewise.
684         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
685         (pthread_rwlock_timedrdlock): Likewise.
686         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
687         (pthread_rwlock_timedwrlock): Likewise.
688         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
689         (__pthread_rwlock_unlock): Likewise.
690         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S
691         (__pthread_rwlock_wrlock): Likewise.
692         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post): Likewise.
693         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait): Likewise.
694         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
695         Likewise.
696         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
697
698 2012-05-26  Siddhesh Poyarekar  <siddhesh@redhat.com>
699
700         [BZ #12416]
701         * nptl/pthread_getattr_np.c (pthread_getattr_np): Use
702         __libc_stack_end rounded to the end of containing page as the
703         real stack end.
704
705 2012-05-25  Rayson Ho  <rho@redhat.com>
706
707         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Low-level SystemTap
708         probes for i386.
709         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
710         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
711         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
712         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
713         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
714         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
715         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
716         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
717
718 2012-05-25  Rayson Ho  <rho@redhat.com>
719             Roland McGrath  <roland@hack.frob.com>
720
721         * DESIGN-systemtap-probes.txt: New file.
722         * pthread_cond_broadcast.c: SystemTap probes.
723         * pthread_cond_init.c: Likewise.
724         * pthread_cond_signal.c: Likewise.
725         * pthread_cond_wait.c: Likewise.
726         * pthread_cond_destroy.c: Likewise.
727         * pthread_create.c: Likewise.
728         * pthread_join.c: Likewise.
729         * pthread_mutex_destroy.c: Likewise.
730         * pthread_mutex_init.c: Likewise.
731         * pthread_mutex_lock.c: Likewise.
732         * pthread_mutex_timedlock.c: Likewise.
733         * pthread_mutex_unlock.c: Likewise.
734         * pthread_rwlock_destroy.c: Likewise.
735         * pthread_rwlock_rdlock.c: Likewise.
736         * pthread_rwlock_unlock.c: Likewise.
737         * pthread_rwlock_wrlock.c: Likewise.
738         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
739         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
740         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
741         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
742         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
743         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
744         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
745         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
746
747 2012-05-24  Roland McGrath  <roland@hack.frob.com>
748
749         * pthread_create.c (start_thread): Define pthread_start LIBC_PROBE.
750
751 2012-05-17  Andreas Jaeger  <aj@suse.de>
752
753         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
754         (HAVE_DL_DISCOVER_OSVERSION): Don't declare _dl_discover_osversion
755         only for older kernels.
756
757 2012-05-15  Joseph Myers  <joseph@codesourcery.com>
758
759         * pthreadP.h [!__NR_set_robust_list] (__NR_set_robust_list): Do
760         not define.
761
762 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
763
764         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_lock): Load
765         futex pointer into RDI_LP.  Use RSP_LP to operate on stack.
766         (lll_robust_lock): Likewise.
767         (lll_cond_lock): Likewise.
768         (lll_robust_cond_lock): Likewise.
769         (lll_timedlock): Likewise.
770         (lll_robust_timedlock): Likewise.
771         (lll_unlock): Likewise.
772         (lll_robust_unlock): Likewise.
773
774 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
775
776         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use
777         LP_OP(cmp) and RCX_LP on dep_mutex pointer.
778
779 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
780
781         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Use LP_OP(op)
782         on NWAITERS.
783         (__gcc_personality_v0): Replace 8-byte data alignment with
784         LP_SIZE alignment and .quad with ASM_ADDR.
785
786 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
787
788         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Use LP_OP(op)
789         on NWAITERS.
790         (__gcc_personality_v0): Replace 8-byte data alignment with
791         LP_SIZE alignment and .quad with ASM_ADDR.
792
793 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
794
795         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Use LP_OP(cmp) on
796         NWAITERS, which is unsigned long int.
797
798 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
799
800         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
801         (__gcc_personality_v0): Replace 8-byte data alignment with
802         LP_SIZE alignment and .quad with ASM_ADDR.
803
804 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
805
806         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Use
807         LP_OP(cmp), RSI_LP and R8_LP on dep_mutex pointer.  Load
808         __vdso_clock_gettime pointer into RAX_LP.
809         (__gcc_personality_v0): Replace 8-byte data alignment with
810         LP_SIZE alignment and .quad with ASM_ADDR.
811
812 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
813
814         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Use
815         LP_OP(cmp), RSI_LP and R8_LP on dep_mutex pointer.  Load
816         __vdso_clock_gettime pointer into RAX_LP.
817         (__gcc_personality_v0): Replace 8-byte data alignment with
818         LP_SIZE alignment and .quad with ASM_ADDR.
819
820 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
821
822         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Use
823         LP_OP(cmp) and R8_LP on dep_mutex pointer.
824
825 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
826
827         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Use LP_OP(mov)
828         to update pointer in memory.  Load pointer into RDI_LP.
829
830 2012-05-15  H.J. Lu  <hongjiu.lu@intel.com>
831
832         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
833         (LLL_STUB_UNWIND_INFO_START): Align label to LP_SIZE instead
834         of 8.
835         (LLL_STUB_UNWIND_INFO_END): Likewise.
836         (lll_timedlock): Load timeout pointer into RDX_LP.
837         (lll_robust_timedlock): Likewise.
838
839 2012-05-15  Siddhesh Poyarekar  <siddhesh@redhat.com>
840             Jakub Jelinek  <jakub@redhat.com>
841
842         [BZ #13613]
843         * Makefile (tests): Add test cases.
844         * descr.h (struct pthread): Add a comment describing multiple_threads.
845         * pthreadP.h (__pthread_multiple_threads): Expand comment to include
846         single-process case.
847         * pthread_cancel.c (pthread_cancel): Enable multiple_threads
848         before setting cancelstate of the thread.
849         * sysdeps/unix/sysv/linux/libc_multiple_threads.c
850         (__libc_multiple_threads): Add explanatory comment.
851         * tst-cancel-self-cancelstate.c: New test case.
852         * tst-cancel-self-canceltype.c: Likewise.
853         * tst-cancel-self-cleanup.c: Supporting file for test cases.
854         * tst-cancel-self-testcancel.c: New test case.
855         * tst-cancel-self.c: Likewise.
856         * vars.c: Expand comment to include single-process case.
857
858 2012-05-14  H.J. Lu  <hongjiu.lu@intel.com>
859
860         * sysdeps/x86_64/tls.h: Don't include <bits/wordsize.h>.
861         (tcbhead_t): Remove __x86_64__ check.  Align rtld_savespace_sse
862         to 32 bytes.
863
864 2012-05-14  H.J. Lu  <hongjiu.lu@intel.com>
865
866         * sysdeps/pthread/pthread.h (__PTHREAD_RWLOCK_INT_FLAGS_SHARED):
867         New.
868         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Check
869         __PTHREAD_RWLOCK_INT_FLAGS_SHARED instead of __WORDSIZE.
870
871 2012-05-14  H.J. Lu  <hongjiu.lu@intel.com>
872
873         * shlib-versions: Move x86_64-.*-linux.* entry to ...
874         * sysdeps/x86_64/64/shlib-versions: Here.  New file.
875         * sysdeps/x86_64/x32/shlib-versions: New file.
876
877 2012-05-14  H.J. Lu  <hongjiu.lu@intel.com>
878
879         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Define x32
880         __SIZEOF_PTHREAD_XXX_T.
881         (__pthread_internal_list): Check __x86_64__ instead of __WORDSIZE.
882         (pthread_mutex_t): Likewise.
883         (pthread_rwlock_t): Likewise.
884         (__PTHREAD_RWLOCK_INT_FLAGS_SHARED): New.  Defined if __x86_64__
885         is defined.
886
887 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
888
889         * sysdeps/x86_64/x32/tls.h: New file.
890
891 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
892
893         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Use uint64_t on 64-bit
894         integer.
895         (THREAD_SETMEM_NC): Likewise.
896
897 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
898
899         * sysdeps/x86_64/tls.h (THREAD_SELF): Replace movq/%q0 with
900         mov/%0.
901
902 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
903
904         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
905         (__cleanup_fct_attribute): Check __x86_64__ instead of
906         __WORDSIZE.
907
908 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
909
910         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER): Check
911         __PTHREAD_MUTEX_HAVE_PREV instead of __WORDSIZE.
912         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Likewise.
913         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
914         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
915
916 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
917
918         * pthread_create.c (start_thread): Check __PTHREAD_MUTEX_HAVE_PREV
919         instead of __WORDSIZE.
920
921 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
922
923         [BZ #3748]
924         * sysdeps/pthread/bits/libc-lockP.h (__libc_once_get): New macro.
925
926 2012-05-09  Chung-Lin Tang  <cltang@codesourcery.com>
927
928         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
929         (__pthread_cond_timedwait): Use CFI directives.
930         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
931         (__pthread_cond_wait): Likewise.
932         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait): Likewise.
933         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
934
935 2012-05-03  David S. Miller  <davem@davemloft.net>
936
937         * sysdeps/sparc/sparc64/pthread_spin_unlock.S: Fix thinko, we
938         always have to return 0, especially for the pthread_spin_init
939         alias.
940         * sysdeps/sparc/sparc32/pthread_spin_lock.S: Add missing trailing
941         newline.
942         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.S: Likewise.
943         * sysdeps/sparc/sparc64/pthread_spin_lock.S: Likewise.
944
945 2012-05-02  David S. Miller  <davem@davemloft.net>
946
947         * sysdeps/sparc/sparc64/pthread_spin_lock.S: New.
948         * sysdeps/sparc/sparc64/pthread_spin_lock.c: Delete.
949         * sysdeps/sparc/sparc64/pthread_spin_unlock.S: New.
950         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: Delete.
951         * sysdeps/sparc/sparc64/pthread_spin_trylock.S: New.
952         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: Delete.
953         * sysdeps/sparc/sparc64/pthread_spin_init.c: New.
954         * sysdeps/sparc/sparc32/pthread_spin_lock.S: New.
955         * sysdeps/sparc/sparc32/pthread_spin_lock.c: Delete.
956         * sysdeps/sparc/sparc32/pthread_spin_trylock.S: New.
957         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: Delete.
958         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.S: New.
959         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: Delete.
960         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.S: New.
961         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: Delete.
962         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.S: New.
963         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: Delete.
964         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_init.c: New.
965
966 2012-05-02  Allan McRae  <allan@archlinux.org>
967
968         * Makefile: (LDFLAGS-tst-tls5): Use $(no-as-needed).
969         (LDFLAGS-tst-cancel24): Likewise.
970
971 2012-05-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
972
973         * sysdeps/i386/pthread_spin_lock.S: New.
974         * sysdeps/i386/pthread_spin_lock.c: Delete.
975         * sysdeps/x86_64/pthread_spin_lock.S: New.
976         * sysdeps/x86_64/pthread_spin_lock.c: Delete.
977
978 2012-04-28  Andreas Schwab  <schwab@linux-m68k.org>
979
980         * Makefile ($(objpfx)tst-stack3-mem, $(objpfx)tst-tls6.out): Don't
981         run when cross-compiling.
982
983 2012-04-26  Siddhesh Poyarekar  <siddhesh@redhat.com>
984
985         * sysdeps/pthread/unwind-forcedunwind.c: Include gnu/lib-names.h
986         instead of libgcc_s.h.
987
988 2012-04-20  Paul Pluzhnikov  <ppluzhnikov@google.com>
989
990         * sysdeps/x86_64/tls.h (TLS_GET_FS, TLS_SET_FS): Delete.
991
992 2012-03-27  David S. Miller  <davem@davemloft.net>
993
994         * tst-cond16.c (do_test): Use a thread stack size which is either
995         PTHREAD_STACK_MIN or the page size, whichever is larger.
996         * tst-cond18.c (do_test): Likewise.
997
998 2012-03-19  H.J. Lu  <hongjiu.lu@intel.com>
999
1000         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Use
1001         register char * __asm__("rsp") to get stack frame.
1002
1003 2012-03-19  H.J. Lu  <hongjiu.lu@intel.com>
1004
1005         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (SYS_futex): Use
1006         __NR_futex directly.
1007
1008 2012-03-19  H.J. Lu  <hongjiu.lu@intel.com>
1009
1010         * unwind.c (unwind_stop): Cast _Unwind_GetCFA return to
1011         _Unwind_Ptr first.
1012
1013 2012-03-16  David S. Miller  <davem@davemloft.net>
1014
1015         [BZ #13844]
1016         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: Include using <..>
1017         instead of "...".
1018         * sysdeps/unix/sysv/linux/sparc/sparc32/libc-lowlevellock.c:
1019         Delete, not needed.
1020
1021 2012-03-15  David S. Miller  <davem@davemloft.net>
1022
1023         [BZ #13844]
1024         * sysdeps/unix/sysv/linux/sparc/sparc32/libc-lowlevellock.c: New file.
1025
1026 2012-03-09  Paul Eggert  <eggert@cs.ucla.edu>
1027
1028         [BZ #13673]
1029         * pt-crti.S: Replace FSF snail mail address with URL.
1030
1031 2012-03-09  Joseph Myers  <joseph@codesourcery.com>
1032
1033         * sysdeps/pthread/pthread.h (__need_clockid_t, __need_timespec):
1034         Do not define before including <time.h>.
1035
1036 2012-03-08  David S. Miller  <davem@davemloft.net>
1037
1038         * sysdeps/unix/sysv/linux/sparc/sem_post.c: Update copyright year.
1039
1040 2012-03-08  Thomas Schwinge  <thomas@codesourcery.com>
1041
1042         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
1043         Check for timestamp before the Epoch.
1044
1045         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait): Fix
1046         updating nwaiters.
1047
1048         * tst-sem13.c (do_test): Add another test case.
1049         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1050         Fix updating nwaiters.
1051
1052 2012-03-07  Joseph Myers  <joseph@codesourcery.com>
1053
1054         [BZ #10545]
1055         * sysdeps/pthread/configure.in (libc_cv_forced_unwind): Change
1056         link test to a compile test.
1057         (libc_cv_c_cleanup): Likewise.  Declare puts rather than including
1058         <stdio.h>.
1059         * sysdeps/pthread/configure: Regenerated.
1060
1061 2012-03-07  Ulrich Drepper  <drepper@gmail.com>
1062
1063         * Makefile (distribute): Remove variable.
1064
1065 2012-01-23  Thomas Schwinge  <thomas@codesourcery.com>
1066
1067         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Get rid of
1068         superfluous assignment.
1069         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c (sem_timedwait):
1070         Likewise.
1071         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
1072         (sem_timedwait): Likewise.
1073
1074 2012-03-06  Ulrich Drepper  <drepper@gmail.com>
1075
1076         * sysdeps/pthread/bits/libc-lock.h: Move information not needed in
1077         installed headers to...
1078         * sysdeps/pthread/bits/libc-lockP.h: ...here.  New file.
1079
1080 2012-03-06  David S. Miller  <davem@davemloft.net>
1081
1082         * sysdeps/unix/sysv/linux/sparc/sem_post.c (__new_sem_post): Use
1083         atomic_increment and remove unused local variable.
1084         (__old_sem_post): Likewise.
1085
1086 2012-02-27  David S. Miller  <davem@davemloft.net>
1087
1088         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Don't refer to
1089         non-existing __pthread_attr.
1090         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1091         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1092         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1093         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1094         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1095
1096 2012-02-26  Ulrich Drepper  <drepper@gmail.com>
1097
1098         * sysdeps/pthread/pthread.h: Define __need_clockid_t for __USE_XOPEN2K.
1099
1100         * sysdeps/pthread/pthread.h: Define __need_timespec before including
1101         <time.h>.
1102         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Name pthread_attr_t
1103         union.
1104         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1105         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1106         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1107         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1108         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1109
1110 2012-02-21  Joseph Myers  <joseph@codesourcery.com>
1111
1112         [BZ #13695]
1113         * Makefile (generated): Remove crti.S, crtn.S, defs.h and
1114         pt-initfini.s.
1115         [crti.S not in sysdirs] (omit-deps): Do not append.
1116         [crti.S not in sysdirs] (CFLAGS-pt-initfini.s): Remove variable.
1117         [crti.S not in sysdirs] (pt-initfini.c): Remove vpath directive.
1118         [crti.S not in sysdirs] ($(objpfx)crti.S): Remove rule.
1119         [crti.S not in sysdirs] ($(objpfx)crtn.S): Likewise.
1120         [crti.S not in sysdirs] ($(objpfx)defs.h): Likewise.
1121         [crti.S not in sysdirs] ($(objpfx)crti.o): Likewise.
1122         [crti.S not in sysdirs] ($(objpfx)crtn.o): Likewise.
1123         [crti.S in sysdirs] (extra-objs): Append unconditionally.
1124         [crti.S in sysdirs] ($(objpfx)crti.o): Define rule
1125         unconditionally.
1126         * sysdeps/pthread/pt-initfini.c: Remove file.
1127
1128 2012-02-16  Richard Henderson  <rth@twiddle.net>
1129
1130         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: Remove file.
1131         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: Remove file.
1132
1133 2012-02-15  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1134
1135         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: Remove file.
1136
1137 2012-02-16  David S. Miller  <davem@davemloft.net>
1138
1139         * sysdeps/sparc/Makefile: Add -fPIC when building pt-crti.S and crtn.S
1140
1141 2012-02-15  Marek Polacek  <polacek@redhat.com>
1142
1143         * sysdeps/unix/sysv/linux/x86_64/Makefile: Remove file.
1144
1145 2012-02-09  Paul Eggert  <eggert@cs.ucla.edu>
1146
1147         Replace FSF snail mail address with URLs, as per GNU coding standards.
1148
1149 2012-02-08  Andreas Schwab  <schwab@linux-m68k.org>
1150
1151         * Makefile (extra-objs) [crti.S in sysdirs]: Add pt-crti.o.
1152
1153 2012-02-08  Joseph Myers  <joseph@codesourcery.com>
1154
1155         Support crti.S and crtn.S provided directly by architectures.
1156         * Makefile [crti.S in sysdirs] (omit-deps): Do not append.
1157         [crti.S in sysdirs] (CFLAGS-pt-initfini.s): Do not define variable.
1158         [crti.S in sysdirs] ($(objpfx)pt-initfini.s): Disable rule.
1159         [crti.S in sysdirs] ($(objpfx)crti.S): Likewise.
1160         [crti.S in sysdirs] ($(objpfx)crtn.S): Likewise.
1161         [crti.S in sysdirs] ($(objpfx)defs.h): Likewise.
1162         [crti.S in sysdirs] ($(objpfx)crti.o): Likewise.
1163         [crti.S in sysdirs] ($(objpfx)crtn.o): Likewise.
1164         [crti.S in sysdirs] (pt-initfini.c): Remove vpath directive.
1165         [crti.S in sysdirs] ($(objpfx)crti.o): New rule.
1166         * pt-crti.S: New file.
1167         * sysdeps/unix/sysv/linux/i386/Makefile: Remove file.
1168
1169 2012-02-03  Joseph Myers  <joseph@codesourcery.com>
1170
1171         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
1172         macros for PIC register setup.
1173         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1174         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1175         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
1176         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1177         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1178
1179 2012-01-11  Marek Polacek  <polacek@redhat.com>
1180
1181         * forward.c (FORWARD_NORETURN): Define macro.
1182         (__pthread_unwind): Use FORWARD_NORETURN macro to avoid warning.
1183         (__pthread_exit): Likewise.
1184
1185 2012-01-10  Ulrich Drepper  <drepper@gmail.com>
1186
1187         * sysdeps/pthread/pthread.h: Add const attribute to pthread_equal.
1188
1189         * pthreadP.h: Add noreturn to __pthread_exit.
1190         * sysdeps/pthread/pthread-functions.h: Likewise for ptr___pthread_exit.
1191
1192 2011-12-30  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
1193
1194         * sysdeps/unix/sysv/linux/aio_misc.h (__aio_create_helper_thread):
1195         Call pthread_attr_setstacksize() with result of
1196         __pthread_get_minstack() to account for application TLS usage.
1197
1198 2012-01-08  Marek Polacek  <polacek@redhat.com>
1199
1200         * sysdeps/unix/sysv/linux/mq_notify.c: Include <nptl/pthreadP.h>.
1201
1202 2012-01-07  Ulrich Drepper  <drepper@gmail.com>
1203
1204         [BZ #13553]
1205         * pthreadP.h: Use const instead of __const.
1206         * semaphore.h: Likewise.
1207         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1208         * sysdeps/pthread/bits/sigthread.h: Likewise.
1209         * sysdeps/pthread/pthread.h: Likewise.
1210
1211         * Makefile: Remove elf=yes test, only ELF is supported.
1212
1213         * shlib-versions: Remove entries for ports architectures.
1214
1215         In case anyone cares, the IA-64 architecture could move to ports.
1216         * sysdeps/ia64/*: Removed.
1217         * sysdeps/unix/sysv/linux/ia64/*: Removed.
1218
1219 2011-12-22  Ulrich Drepper  <drepper@gmail.com>
1220
1221         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread): Use
1222         __pthread_get_minstack.
1223         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Likewise.
1224
1225         [BZ #13088]
1226         * sysdeps/unix/sysv/linux/timer_routines.c: Get minimum stack size
1227         through __pthread_get_minstack.
1228         * nptl-init.c (__pthread_initialize_minimal_internal): Get page size
1229         directly from _rtld_global_ro.
1230         (__pthread_get_minstack): New function.
1231         * pthreadP.h: Declare __pthread_get_minstack.
1232         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_get_minstack.
1233
1234 2011-12-21  Ulrich Drepper  <drepper@gmail.com>
1235
1236         [BZ #13515]
1237         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
1238         Correct reading name from file.
1239
1240 2011-12-14  Carlos O'Donell  <carlos@systemhalted.org>
1241
1242         * allocatestack.c (allocate_stack): Return errno on failure.
1243
1244 2011-12-14  Jeff Law  <law@redhat.com>
1245
1246         [BZ #5245]
1247         * pthread_create.c (__pthread_create_2_1): Translate ENOMEM to EAGAIN.
1248
1249 2011-11-28  Andreas Schwab  <schwab@redhat.com>
1250
1251         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Handle
1252         EAGAIN from FUTEX_WAIT_REQUEUE_PI.
1253         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1254
1255 2011-11-15  Ulrich Drepper  <drepper@gmail.com>
1256
1257         * pthread_getattr_np.c (pthread_getattr_np): Set FD_CLOEXEC for
1258         /proc/self/maps.
1259
1260 2011-10-29  Ulrich Drepper  <drepper@gmail.com>
1261
1262         [BZ #13358]
1263         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1264         (__pthread_cond_timedwait): Initialize %r15 correctly also for code
1265         path for kernels with FUTEX_CLOCK_REALTIME.
1266         Debugged by H.J. Lu <hjl.tools@gmail.com>.
1267
1268 2011-10-27  Andreas Schwab  <schwab@redhat.com>
1269
1270         [BZ #13344]
1271         * sysdeps/pthread/pthread.h: Use __THREADNL instead of __THREAD
1272         for memory synchronization functions.
1273         * semaphore.h: Likewise.
1274
1275 2011-10-24  Ulrich Drepper  <drepper@gmail.com>
1276
1277         * tst-cancel7.c: Avoid warning.
1278         * tst-mutex6.c: Likewise.
1279         * tst-mutex9.c: Likewise.
1280         * tst-mutexpi6.c: Likewise.
1281
1282 2011-10-23  Ulrich Drepper  <drepper@gmail.com>
1283
1284         * sysdeps/i386/tls.h: Remove #include <list.h>.
1285
1286 2011-10-15  Ulrich Drepper  <drepper@gmail.com>
1287
1288         * pthread_create.c (start_thread): Call __ctype_init.
1289
1290 2011-09-15  Andreas Schwab  <schwab@redhat.com>
1291
1292         * sysdeps/pthread/list.h: Define only list_t if __need_list_t is
1293         defined.
1294         (list_add): Add atomic_write_barrier.
1295         * descr.h: Define __need_list_t before including <list.h>.
1296         * nptl-init.c: Include <list.h>
1297         * allocatestack.c: Likewise.
1298
1299 2011-09-11  Ulrich Drepper  <drepper@gmail.com>
1300
1301         * sysdeps/i386/tls.h: Remove HAVE_TLS_SUPPORT test.
1302         * sysdeps/ia64/tls.h: Likewise.
1303         * sysdeps/powerpc/tls.h: Likewise.
1304         * sysdeps/s390/tls.h: Likewise.
1305         * sysdeps/sh/tls.h: Likewise.
1306         * sysdeps/sparc/tls.h: Likewise.
1307         * sysdeps/x86_64/tls.h: Likewise.
1308
1309 2011-09-10  Ulrich Drepper  <drepper@gmail.com>
1310
1311         * sysdeps/pthread/malloc-machine.h: Define MUTEX_INITIALIZER.
1312
1313         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Don't handle
1314         !USE___THREAD.
1315         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1316         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
1317         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1318         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1319         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
1320         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
1321         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
1322         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
1323         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1324         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1325         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
1326         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1327
1328         * tst-tls1.c: Support for __thread is now mandatory.
1329         * tst-tls2.c: Likewise.
1330         * tst-tls3.c: Likewise.
1331         * tst-tls3mod.c: Likewise.
1332         * tst-tls4.c: Likewise.
1333         * tst-tls4moda.c: Likewise.
1334         * tst-tls4modb.c: Likewise.
1335         * tst-tls5.h: Likewise.
1336
1337 2011-09-08  Ulrich Drepper  <drepper@gmail.com>
1338
1339         [BZ #12403]
1340         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
1341         (pthread_rwlock_timedwrlock): Use correct macro in test.
1342         Patch by H.J. Lu <hongjiu.lu@intel.com>.
1343
1344 2011-09-06  Ulrich Drepper  <drepper@gmail.com>
1345
1346         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
1347         use gettimeofday vsyscall, just call gettimeofday.
1348         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1349         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
1350         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1351         Likewise.
1352         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1353         Likewise.
1354         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1355         Simplify __vdso_clock_gettime use.
1356
1357 2011-09-05  David S. Miller  <davem@davemloft.net>
1358
1359         * sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait):
1360         New function.
1361         (sem_timedwait): Call it to force an exception region around
1362         the async cancel enable and the futex operation.
1363         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: Likewise.
1364         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: Likewise.
1365         * sysdeps/unix/sysv/linux/sem_wait.c (do_futex_wait): New function.
1366         (__new_sem_wait): Call it to force an exception region around
1367         the async cancel enable and the futex operation.
1368         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: Likewise.
1369         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: Likewise.
1370
1371 2011-08-31  Andreas Schwab  <schwab@redhat.com>
1372
1373         * allocatestack.c (setxid_mark_thread): Ensure that the exiting
1374         thread is woken up.
1375
1376 2011-08-20  David S. Miller  <davem@davemloft.net>
1377
1378         * Makefile (tst-cleanup0.out): Fix typo in output redirection.
1379
1380 2011-08-14  Roland McGrath  <roland@hack.frob.com>
1381
1382         * sysdeps/i386/pthreaddef.h (TCB_ALIGNMENT): Set to 64, optimal on Atom.
1383         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Likewise.
1384
1385 2011-08-08  Andreas Schwab  <schwab@redhat.com>
1386
1387         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Maintain aligned
1388         stack.
1389         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1390         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1391
1392 2011-07-22  Ulrich Drepper  <drepper@gmail.com>
1393
1394         * sysdeps/pthread/unwind-forcedunwind.c (_Unwind_Resume): Add read
1395         barrier.
1396         (__gcc_personality_v0): Likewise.
1397         (_Unwind_ForcedUnwind): Likewise.
1398         (_Unwind_GetCFA): Likewise.
1399
1400 2011-07-14  Roland McGrath  <roland@hack.frob.com>
1401
1402         * allocatestack.c (__reclaim_stacks): Use uintptr_t cast rather than
1403         UINTMAX_C.
1404
1405 2011-06-30  Ulrich Drepper  <drepper@gmail.com>
1406
1407         * nptl-init.c (__nptl_set_robust): New function.
1408         (pthread_functions): Add reference.
1409         * npthreadP.h: Declare __nptl_set_robust.
1410         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
1411         ptr_set_robust member.
1412         * sysdeps/unix/sysv/linux/fork.c: Call set_robust_list syscall in
1413         child if threads are used.
1414
1415 2011-06-14  Andreas Jaeger  <aj@suse.de>
1416
1417         * pthread_rwlock_init.c: Include <string.h> for memset declaration.
1418
1419 2011-05-11  Ulrich Drepper  <drepper@gmail.com>
1420
1421         [BZ #386]
1422         * allocatestack.c (allocate_stack): Convert ENOMEM error to EAGAIN.
1423
1424 2011-04-10  Ulrich Drepper  <drepper@gmail.com>
1425
1426         [BZ #12650]
1427         * allocatestack.c (get_cached_stack): Deallocate DTV entries before
1428         clearing memory.
1429         Patch partly by Robert Rex <robert.rex@exasol.com>.
1430
1431 2011-01-19  Roland McGrath  <roland@redhat.com>
1432
1433         * pthread_cond_wait.c (__pthread_cond_wait): Fix comment typo.
1434         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1435         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Likewise.
1436         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1437         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise.
1438         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise.
1439
1440 2011-01-16  Andreas Schwab  <schwab@linux-m68k.org>
1441
1442         * Makefile (test-extras): Add tst-cleanup4aux.
1443
1444 2011-01-14  Ulrich Drepper  <drepper@gmail.com>
1445
1446         [BZ #10563]
1447         * sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
1448         (__SETXID_2): Likewise.
1449         (__SETXID_3): Likewise.
1450
1451 2011-01-13  Ulrich Drepper  <drepper@gmail.com>
1452
1453         [BZ #10484]
1454         * Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
1455         * alloca_cutoff.c: Add libc_hidden_def.
1456
1457 2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
1458
1459         [BZ #12113]
1460         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
1461         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
1462         of "struct pthread".
1463
1464 2010-09-21  Andreas Schwab  <schwab@redhat.com>
1465
1466         * sysdeps/pthread/pthread.h (pthread_cleanup_push)
1467         [!__EXCEPTIONS]: Mangle local variable not_first_call.
1468         (pthread_cleanup_push_defer_np): Likewise.
1469
1470 2010-09-03  Ulrich Drepper  <drepper@redhat.com>
1471
1472         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Expect blocks are
1473         small.
1474
1475 2010-08-10  Dinakar Guniguntala  <dino@in.ibm.com>
1476             Stefan Hajnoczi  <stefanha@linux.vnet.ibm.com>
1477
1478         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: If
1479         FUTEX_WAKE_OP fails make sure to call FUTEX_WAKE instead.
1480
1481 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
1482
1483         * sysdeps/unix/sysv/linux/i386/Makefile: New file.
1484
1485 2010-05-01  Alan Modra  <amodra@gmail.com>
1486
1487         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1488         (PSEUDO): Use correct cr save.  Don't use wrong parm save area
1489         to save temps.  Correct cfi for possible later frame manipulation.
1490         (DOCARGS_1, UNDOCARGS_1): Use the correct parm save area.
1491         (DOCARGS_2, UNDOCARGS_2, DOCARGS_3, UNDOCARGS_3): Likewise.
1492         (DOCARGS_4, UNDOCARGS_4, DOCARGS_5, UNDOCARGS_5): Likewise.
1493         (DOCARGS_6, UNDOCARGS_6): Likewise.
1494         (CENABLE, CDISABLE): Add nops for non-shared calls.
1495
1496 2010-07-06  Andreas Schwab  <schwab@redhat.com>
1497
1498         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
1499         Fix type mismatch.
1500
1501 2010-07-03  Ulrich Drepper  <drepper@redhat.com>
1502
1503         * tst-abstime.c (do_test): Some more cleanups
1504
1505 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
1506
1507         * tst-abstime.c: Correct testing and add test for sem_timedwait.
1508
1509 2010-07-01  Andreas Schwab  <schwab@redhat.com>
1510             Ulrich Drepper  <drepper@redhat.com>
1511
1512         * Makefile (tests): Add tst-abstime.
1513         * tst-abstime.c: New file.
1514         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1515         (__lll_timedlock_wait): Check for timestamp before the Epoch.
1516         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1517         (__lll_timedlock_wait): Likewise.
1518         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
1519         (__lll_robust_timedlock_wait): Likewise.
1520         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1521         (__pthread_cond_timedwait): Likewise.
1522         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1523         (pthread_rwlock_timedrdlock): Likewise.
1524         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
1525         (pthread_rwlock_timedwrlock): Likewise.
1526         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1527         Likewise.
1528
1529 2010-07-01  Ulrich Drepper  <drepper@redhat.com>
1530
1531         * Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
1532
1533 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
1534
1535         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
1536         location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
1537
1538 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
1539
1540         [BZ #11390]
1541         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
1542         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
1543         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
1544         pthread_setname.
1545         * Makefile (libpthread-routines): Add pthread_getname and
1546         pthread_setname.
1547         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
1548
1549 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
1550
1551         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
1552         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
1553         * sysdeps/pthread/Makefile: Remove csu section and rt section's
1554         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
1555
1556 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
1557
1558         * pthread_cond_timedwait.c: Add check for
1559         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
1560         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
1561         INTERNAL_SYSCALL.
1562
1563 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
1564
1565         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
1566         and the call fails wake eventually waiting setxid threads.  Don't free
1567         stack here if we try starting a thread.
1568         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
1569         if the clone call failed.
1570
1571 2010-03-08  Andreas Schwab  <schwab@redhat.com>
1572
1573         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
1574         * allocatestack.c (get_cached_stack): Set setxid_futex.
1575         (allocate_stack): Likewise.
1576
1577 2010-03-05  Andreas Schwab  <schwab@redhat.com>
1578             Ulrich Drepper  <drepper@redhat.com>
1579
1580         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
1581         it is creating a thread or it is just being created.
1582         * pthread_create.c (start_thread): Wake setxid thread if it is
1583         waiting.
1584         (__pthread_create_2_1): Initialize setxid_futex.
1585         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
1586         is waiting.
1587
1588 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
1589
1590         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1591         Fix unwind info.
1592         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1593
1594 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
1595
1596         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1597         Fix pthread_cond_timedwait with requeue-PI.
1598         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1599         Fix pthread_cond_wait with requeue-PI.
1600
1601 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
1602
1603         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
1604         and pthread_mutexattr_setrobust for GLIBC_2.12.
1605         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
1606         * pthread_mutexattr_getrobust.c: Define alias
1607         pthread_mutexattr_getrobust.
1608         * pthread_mutexattr_setrobust.c: Define alias
1609         pthread_mutexattr_setrobust.
1610
1611 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
1612
1613         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
1614
1615 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
1616
1617         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
1618
1619 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
1620
1621         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
1622         call __gmon_start__.
1623         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
1624
1625 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
1626
1627         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
1628         using memset.
1629
1630 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
1631
1632         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
1633         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
1634         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
1635         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
1636         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1637         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
1638         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
1639         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1640
1641 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
1642
1643         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1644         Don't update nwaiters after invalid timeout is recognized.
1645
1646 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
1647
1648         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
1649         __gmon_start__.
1650
1651 2009-11-27  Andreas Schwab  <schwab@redhat.com>
1652
1653         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
1654         THREAD_SELF->cancelhandling after returning from futex call.
1655
1656 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
1657
1658         * tst-sem13.c: New file.
1659         * Makefile (tests): Add tst-sem13.
1660
1661 2009-11-22  Roland McGrath  <roland@redhat.com>
1662
1663         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
1664         instead of recapitulating its contents.
1665
1666 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
1667
1668         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
1669         optimizations and cleanups.
1670
1671 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
1672
1673         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1674         Remove redundant code. Fix cfi offsets.
1675         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1676         Fix cfi offsets.
1677
1678 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
1679
1680         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
1681         reduce size of unwind info.
1682
1683         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
1684         cfi directives.
1685         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1686         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
1687
1688 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
1689
1690         [BZ #4457]
1691         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
1692         LIBGCC_S_SO.
1693         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
1694
1695 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
1696
1697         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
1698
1699         [BZ #3270]
1700         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
1701         steps to avoid races with creation and terminations.
1702         * nptl-init.c (sighandler_setxid): Adjust.
1703         Patch by Daniel Jacobowitz.
1704
1705 2009-09-07  Andreas Schwab  <schwab@redhat.com>
1706
1707         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
1708
1709 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
1710             Joseph Myers  <joseph@codesourcery.com>
1711
1712         [BZ #7094]
1713         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1714         Initialize the sigev_notify field for newly created timer to make sure
1715         the timer gets deleted from the active timer's list upon timer_delete.
1716
1717 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
1718
1719         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
1720         Correct a logic error.
1721
1722 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
1723
1724         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
1725         of the field in local variables.
1726         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
1727         variable and don't unconditionally clear it.
1728
1729 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
1730
1731         * pthread_create.c (start_thread): Hint to the kernel that memory for
1732         the stack can be reused.  We do not mark all the memory.  The part
1733         still in use and some reserve are kept.
1734
1735 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
1736
1737         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
1738
1739 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
1740
1741         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
1742         directives.
1743
1744 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
1745
1746         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
1747         directives.
1748         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1749
1750 2009-08-10  Andreas Schwab  <schwab@redhat.com>
1751
1752         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1753         (__pthread_cond_signal): Don't clobber register used for syscall
1754         number.
1755
1756 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
1757
1758         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1759         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
1760
1761         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1762         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
1763         register.
1764
1765 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
1766
1767         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
1768         enabled by the special *_asynccancel functions.
1769         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1770         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1771
1772         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
1773
1774 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
1775
1776         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
1777         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
1778         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
1779         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
1780         since we can assume the special __*_{en,dis}able_asynccancel
1781         functions.
1782         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
1783         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
1784         and PTHREAD_CANCELED.
1785
1786 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
1787
1788         * descr.h: Better definition of *_BITMASK macros for cancellation.
1789
1790 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
1791
1792         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
1793
1794         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
1795         dynamic linker might have to save.
1796         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
1797         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
1798         printing.
1799
1800         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
1801
1802 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
1803
1804         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
1805         New function.
1806         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
1807         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
1808         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
1809         requeue_pi for robust mutexes.
1810         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1811         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1812         Don't only skip __pthread_mutex_cond_lock.  Call instead
1813         __pthread_mutex_cond_lock_adjust.
1814         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1815
1816         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
1817         optimization of PI mutex handling.
1818
1819 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
1820
1821         [BZ #10418]
1822         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
1823         instead of of _acq variants of cmpxchg.
1824
1825 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
1826
1827         * sysdeps/x86_64/configure.in: New file.
1828
1829         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
1830         path when not using absolute timeout futex.
1831
1832 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
1833
1834         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
1835         optimizations of last changes.
1836         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1837
1838 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
1839
1840         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1841         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
1842         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
1843         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
1844         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1845         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
1846         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
1847         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1848
1849         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1850         (__pthread_cond_timedwait): Make more robust.
1851
1852 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
1853
1854         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
1855         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
1856         directly use absolute timeout.
1857
1858         * tst-sem5.c (do_test): Add test for premature timeout.
1859         * Makefile: Linu tst-sem5 with librt.
1860
1861         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
1862         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
1863         directly use absolute timeout.
1864         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1865         (pthread_rwlock_timedrdlock): Likewise.
1866
1867         * tst-cond11.c (run_test): Add test to check that the timeout is
1868         long enough.
1869
1870         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1871         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
1872         directly use absolute timeout.
1873
1874         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1875         (__pthread_cond_wait): Convert to using exception handler instead of
1876         registered unwind buffer.
1877         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1878         (__pthread_cond_timedwait): Likewise.
1879
1880 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
1881
1882         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1883         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
1884         use absolute timeout.
1885
1886         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
1887         handling of uncontested semaphore.
1888
1889         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1890         (__condvar_cleanup): Rewrite to use cfi directives instead of
1891         hand-coded unwind tables.
1892         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
1893         Likewise.
1894         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
1895         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1896         Likewise.
1897
1898 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
1899
1900         * Makefile (libpthread-routines): Add pthread_sigqueue.
1901         * Versions: Add pthread_sigqueue for GLIBC_2.11.
1902         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
1903         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
1904
1905 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
1906
1907         [BZ #10262]
1908         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1909         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
1910         cannot be assumed.
1911         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
1912
1913 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
1914
1915         * libc-cancellation.c: Move __libc_cleanup_routine to...
1916         * libc-cleanup.c: ...here.  New file.
1917         * Makefile (routines): Add libc-cleanup.
1918
1919         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
1920         test.
1921         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
1922         * sysdeps/pthread/librt-cancellation.c: Likewise.
1923
1924         [BZ #9924]
1925         * nptl-init.c: Renamed from init.c.
1926         * Makefile: Change all occurences of init.c to nptl-init.c.
1927
1928 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
1929
1930         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
1931         to test when deciding on the delay.
1932         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
1933         * pthread_cancel.c: Close race between deciding on sending a signal
1934         and setting the CANCELING_BIT bit.
1935
1936         * cancellation.c (__pthread_disable_asynccancel): Don't return if
1937         thread is canceled.
1938         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
1939
1940 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
1941
1942         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
1943         is available.
1944         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
1945         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
1946         * sysdeps/i386/tls.h: Likewise.
1947         (tcbhead_t): Add __private_tm member.
1948
1949 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
1950
1951         * sem_open.c (sem_open): Rewrite initialization of initsem to
1952         avoid warnings.
1953
1954         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1955         Avoid warning by using may_alias attribute on ptrhack.
1956
1957 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
1958
1959         [BZ #10090]
1960         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
1961         Check policy and priority for validity.
1962         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
1963
1964 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
1965
1966         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1967         (__pthread_cond_timedwait): Change to use cfi directives instead of
1968         hand-coded unwind sections.
1969
1970 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
1971
1972         * init.c (nptl_freeres): Compile only for SHARED.
1973
1974 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
1975
1976         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
1977         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
1978         FUTEX_BITSET_MATCH_ANY.
1979
1980 2009-02-27  Roland McGrath  <roland@redhat.com>
1981
1982         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
1983         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
1984
1985 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
1986
1987         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1988         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
1989         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
1990         200112L to 200809L.
1991
1992 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
1993
1994         * sysdeps/pthread/pthread.h: The robust mutex functions are in
1995         POSIX 2008.
1996
1997 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
1998
1999         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
2000         Unify name of include protector macro.
2001
2002 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
2003
2004         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
2005         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
2006
2007 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
2008
2009         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
2010         pointer variables.
2011
2012         * allocatestack.c (__free_stacks): Renamed from free_stacks.
2013         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
2014         * init.c (nptl_freeres): New function.
2015         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
2016         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
2017         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
2018         variable.
2019         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
2020         load DSO.  Assign last.
2021         (__unwind_freeres): New function.
2022
2023         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
2024         for better debugging.  No need to use stack_list_add here.
2025
2026 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2027
2028         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
2029         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
2030         instead of computing relative timeout.
2031         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2032         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
2033
2034 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
2035
2036         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
2037
2038 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
2039
2040         * sysdeps/pthread/list.h (list_add): Initialize new element first.
2041         (list_add_tail): Removed.
2042
2043 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
2044
2045         * (in_flight_stack): New variable.
2046         (stack_list_del): New function.  Use instead of list_del.
2047         (stack_list_add): New function.  Use instead of list_add when adding to
2048         stack_cache and stack_used lists.
2049         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
2050         when the fork call interrupted another thread.
2051
2052 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
2053
2054         * init.c (__pthread_initialize_minimal_internal): Optimize test
2055         FUTEX_CLOCK_REALTIME a bit.
2056
2057 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
2058
2059         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
2060         only passing five parameters to FUTEX_WAIT_BITSET call.
2061
2062         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2063         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
2064         instead of computing relative timeout.
2065
2066 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
2067
2068         * init.c (__pthread_initialize_minimal_internal): Check for
2069         FUTEX_CLOCK_REALTIME flag.
2070         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
2071         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
2072         relative timeout.
2073
2074         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2075         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
2076         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2077         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2078         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2079         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2080
2081 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
2082
2083         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
2084         loop body instead of ; to avoid gcc warnings.
2085         (pthread_cleanup_pop_restore_np): Likewise.
2086         Patch by Caolán McNamara <caolanm@redhat.com>.
2087
2088 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
2089
2090         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
2091         fast path here, for robust/PI/PP mutexes call
2092         __pthread_mutex_lock_full.  Don't use switch, instead use a series
2093         of ifs according to their probability.
2094         (__pthread_mutex_lock_full): New function.
2095         * pthread_mutex_unlock.c: Include assert.h.
2096         (__pthread_mutex_unlock_usercnt): Handle only the
2097         fast path here, for robust/PI/PP mutexes call
2098         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
2099         of ifs according to their probability.
2100         (__pthread_mutex_unlock_full): New function.
2101         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
2102         (__pthread_mutex_lock_full): Define.
2103
2104 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
2105
2106         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
2107         implementation.  Add necessary padding and.
2108         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
2109         words.
2110
2111 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2112
2113         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
2114         and FUTEX_WAKE_BITSET.
2115
2116 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
2117
2118         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
2119         and FUTEX_WAKE_BITSET.
2120         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2121         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2122         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2123         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2124
2125 2008-11-25  Roland McGrath  <roland@redhat.com>
2126
2127         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
2128         Subdirectories moved to ports repository as
2129         sysdeps/.../nptl subdirectories.
2130
2131 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
2132
2133         [BZ #7008]
2134         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
2135         of old value.
2136         * pthread_cond_init.c (__pthread_cond_init): Fix
2137         cond->__data.__nwaiters initialization.
2138         * Makefile (tests): Add tst-cond23.
2139         * tst-cond23.c: New test.
2140
2141 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
2142
2143         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
2144         arguments.
2145         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
2146         arguments.
2147
2148 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
2149
2150         [BZ #6955]
2151         * pthread_mutex_lock.c: Add support for private PI mutexes.
2152         * pthread_mutex_timedlock.c: Likewise.
2153         * pthread_mutex_trylock.c: Likewise.
2154         * pthread_mutex_unlock.c: Likewise.
2155         Patch mostly by Ben Jackson <ben@ben.com>.
2156
2157 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
2158
2159         [BZ #6843]
2160         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
2161         Increase stack size for helper thread.
2162
2163 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2164
2165         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
2166         assembly with a clobber list for access registers a0 and a1.
2167
2168 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2169
2170         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
2171         to force runp->refcntr to be read from memory.
2172
2173 2008-09-08  Richard Guenther  <rguenther@suse.de>
2174
2175         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
2176         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
2177         lll_timedlock, lll_robust_timedlock, lll_unlock,
2178         lll_robust_unlock): Promote private to int.
2179
2180 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
2181
2182         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
2183         ARCH_RETRY_MMAP definitions.
2184         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
2185         Define MAP_STACK when not defined.
2186         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
2187         handling of ARCH_RETRY_MMAP.
2188
2189 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
2190
2191         * tst-align2.c (f): Print message that f is reached.
2192
2193 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
2194
2195         [BZ #6740]
2196         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
2197         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
2198
2199 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
2200
2201         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
2202         SOCK_CLOEXEC if possible.
2203
2204 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
2205
2206         * Makefile (tests): Add tst-rwlock2a.
2207         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
2208         * tst-rwlock2a.c: New file.
2209
2210 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
2211
2212         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
2213
2214 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
2215
2216         * sysdeps/pthread/pthread.h: Fix typo in comment.
2217
2218 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
2219
2220         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
2221         of CPU set to the kernel.
2222
2223 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
2224
2225         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
2226         cfi directives.
2227         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2228         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2229         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2230         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2231         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2232         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2233
2234 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
2235
2236         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
2237         cfi directives.
2238         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2239         Likewise.
2240         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2241         Likewise.
2242         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2243         Likewise.
2244
2245 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
2246
2247         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
2248
2249 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
2250
2251         David S. Miller  <davem@davemloft.net>
2252
2253         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
2254
2255 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
2256
2257         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
2258         __pshared correctly.
2259         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2260         Likewise.
2261         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2262         Likewise.
2263         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
2264         Likewise.
2265         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
2266         Likewise.
2267         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
2268
2269 2008-04-14  David S. Miller  <davem@davemloft.net>
2270
2271         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
2272         (__old_sem_wait): Fix argument to lll_futex_wait().
2273
2274 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
2275
2276         * pthread_create.c: Require pthread_mutex_trylock and
2277         pthread_key_delete for libgcc.
2278
2279 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
2280
2281         [BZ #6020]
2282         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
2283         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
2284         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
2285
2286 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
2287
2288         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
2289         <linux/limits.h> has defined it.
2290         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2291         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2292         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2293         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2294
2295 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
2296
2297         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
2298         of ASSEMBLER.
2299         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
2300         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
2301
2302 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
2303
2304         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
2305         HAVE_DL_DISCOVER_OSVERSION.
2306         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
2307         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
2308
2309 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
2310
2311         [BZ #5778]
2312         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
2313         _POSIX_CHOWN_RESTRICTED value to zero.
2314
2315 2008-01-31  Roland McGrath  <roland@redhat.com>
2316
2317         * Makefile (omit-deps): Variable removed.
2318
2319 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
2320
2321         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
2322         unnecessary addr32 prefix.
2323
2324 2008-01-29  Roland McGrath  <roland@redhat.com>
2325
2326         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
2327
2328 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2329
2330         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
2331
2332 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2333
2334         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
2335         a scratch register.
2336         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
2337         (__lll_lock_wait_private): Fix typo.
2338         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
2339         (pthread_barrier_wait): Likewise.  Adjust XADD use.
2340         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
2341         Adjust XADD use.
2342         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
2343         (pthread_rwlock_timedrdlock): Return correct return value.
2344         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
2345         (pthread_rwlock_timedwrlock): Likewise.
2346
2347 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
2348
2349         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
2350         thread returns the program exits with an error code.
2351
2352 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
2353
2354         * pthread-errnos.sym: Add EOVERFLOW.
2355         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
2356         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
2357         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2358         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2359
2360 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
2361
2362         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
2363         parameter.  Passed it as permission to mmap.
2364         * allocatestack.c (allocate_stack): Pass prot as second parameter
2365         to ARCH_RETRY_MMAP.
2366
2367 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
2368
2369         * tst-basic7.c: Allocate memory for the stack.
2370
2371         [BZ #5465]
2372         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
2373         (__pthread_cond_timedwait): Don't use VDSO.
2374         Patch by Michal Januszewski.
2375
2376 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
2377
2378         [BZ #5455]
2379         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
2380         Allow label before pthread_cleanup_pop.
2381         (pthread_cleanup_pop_restore_np): Likewise.
2382
2383 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2384
2385         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
2386         Store 2 before returning ETIMEDOUT.
2387
2388 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
2389
2390         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
2391         Store 2 before returning ETIMEDOUT.
2392         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
2393         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2394         (__lll_lock_wait_private): Optimize.
2395         (__lll_lock_wait): Likewise.
2396
2397 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
2398
2399         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
2400         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
2401         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
2402
2403 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
2404
2405         [BZ #5240]
2406         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
2407         If we time out, try one last time to lock the futex to avoid
2408         losing a wakeup signal.
2409         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2410         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2411
2412         [BZ #5245]
2413         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
2414         if necessary.
2415
2416 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
2417
2418         [BZ #5245]
2419         * allocatestack.c (allocate_stack): Change ENOMEM error in case
2420         mmap failed to EAGAIN.
2421         * Makefile (tests): Add tst-basic7.
2422         * tst-basic7.c: New file.
2423
2424 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
2425
2426         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
2427         Use __linkin_atfork.
2428
2429 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
2430
2431         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
2432         missing line continuations.
2433         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
2434         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
2435
2436 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
2437
2438         [BZ #5220]
2439         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
2440         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
2441         (struct timer): Add next element.
2442         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
2443         enqueue timer structure into __active_timer_sigev_thread list.
2444         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
2445         remove timer struct from __active_timer_sigev_thread.
2446         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2447         Before using timer structure make sure it is still on the
2448         __active_timer_sigev_thread list.  Keep lock until done.
2449         Define __active_timer_sigev_thread and
2450         __active_timer_sigev_thread_lock.
2451
2452 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
2453
2454         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
2455         Redefine thread_atfork for use of ATFORK_MEM.
2456         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
2457         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
2458         function.
2459         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
2460         Use atomic operation when removing first element of list.
2461
2462 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
2463
2464         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
2465         routine instead of an alias to __new_sem_post.
2466
2467 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
2468
2469         * init.c (__pthread_initialize_minimal): Initialize word to appease
2470         valgrind.
2471
2472 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
2473
2474         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
2475         libc.so just clear NAME.
2476         (__libc_rwlock_fini): Nop inside of libc.so.
2477         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
2478         all zeros.
2479
2480 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
2481
2482         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2483         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
2484         unlocking failed.
2485         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
2486
2487 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
2488
2489         [BZ #4938]
2490         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
2491         reclaimed stack if necessary.
2492         * Makefile (tests): Add tst-tsd6.
2493         * tst-tsd6.c: New file.
2494
2495 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
2496
2497         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
2498         Add private argument.
2499
2500 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
2501
2502         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2503         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
2504
2505 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
2506
2507         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
2508         (__lll_robust_timedlock): Pass private as last argument to
2509         __lll_robust_timedlock_wait.
2510         (__lll_unlock): Fix a pasto.
2511
2512 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
2513
2514         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
2515         sparc_old_sem): New structs.
2516         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
2517         (__sem_wait_cleanup): New function.
2518         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
2519         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
2520         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
2521         lll_futex_wait.
2522         (__old_sem_wait): New function.
2523         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
2524         nptl/sysdeps/unix/sysv/linux/sparc version.
2525         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
2526         Likewise.
2527         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
2528         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
2529         (__new_sem_trywait): Use sparc_old_sem structure.
2530         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
2531         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
2532         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
2533         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
2534         lll_futex_timed_wait.
2535         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
2536         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
2537         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
2538         lll_futex_wake.
2539         (__old_sem_post): New function.
2540         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
2541         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
2542         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
2543         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
2544         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
2545         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
2546
2547 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2548
2549         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
2550         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
2551         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
2552         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
2553         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
2554         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
2555         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
2556         Use FUTEX_WAKE_OP.
2557         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
2558         kernel-features.h and tcb-offsets.h.
2559         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
2560         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
2561         process private.
2562         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
2563         tcb-offsets.h.
2564         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
2565         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
2566         process private.
2567         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
2568         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
2569         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2570         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2571         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2572         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2573         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2574
2575 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
2576
2577         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
2578         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
2579         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
2580         lll_futex_timed_wait.
2581
2582         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
2583         __lll_robust_unlock): Rewrite as macros instead of inline functions.
2584         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
2585         __lll_robust_unlock, __lll_wait_tid): Likewise.
2586
2587 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
2588
2589         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
2590         Fix a pasto.
2591         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2592         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
2593         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
2594         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
2595         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2596         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
2597         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
2598         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
2599         kernel-features.h.
2600         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
2601         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
2602         process private.  Switch DW_CFA_advance_loc1 and some
2603         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
2604         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2605         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
2606         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
2607         process private.  Switch DW_CFA_advance_loc{1,2} and some
2608         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
2609         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
2610         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
2611         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2612         Likewise.
2613         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2614         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2615         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2616         Likewise.
2617         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2618         (__pthread_cond_broadcast): Compare %r8 instead of
2619         dep_mutex-cond_*(%rdi) with $-1.
2620         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2621         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
2622         of oring.
2623
2624 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
2625
2626         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
2627
2628 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
2629
2630         * allocatestack.c: Include kernel-features.h.
2631         * pthread_create.c: Likewise.
2632         * pthread_mutex_init.c: Likewise.
2633         * init.c: Likewise.
2634         * pthread_cond_timedwait.c: Likewise.
2635         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2636         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2637         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2638         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2639         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2640         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2641         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2642         Likewise.
2643         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2644         Likewise.
2645         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2646         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2647         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2648         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2649
2650 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
2651
2652         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2653         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
2654         byte elements.  One of them is the new __shared element.
2655         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
2656         adjust names of other padding elements.
2657         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2658         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
2659         byte elements.  One of them is the new __shared element.
2660         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
2661         adjust names of other padding elements.
2662         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
2663         Renamed __pad1 element to __shared, adjust names of other padding
2664         elements.
2665         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2666         (pthread_rwlock_t): Likewise.
2667         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
2668         typo.
2669
2670 2007-08-09  Anton Blanchard  <anton@samba.org>
2671
2672         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
2673
2674 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
2675
2676         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
2677         <kernel-features.h>.
2678         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2679
2680 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
2681
2682         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
2683         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
2684         dealing with robust mutexes.
2685         * pthread_mutex_timedlock.c: Likewise.
2686         * pthread_mutex_trylock.c: Likewise.
2687         * pthread_mutex_unlock.c: Likewise.
2688         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2689
2690 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
2691
2692         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
2693         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
2694         (PTHREAD_MUTEX_PSHARED): Define.
2695         * pthread_mutex_init.c (__pthread_mutex_init): Set
2696         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
2697         mutexes.
2698         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
2699         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
2700         as second argument to lll_lock.
2701         (LLL_MUTEX_TRYLOCK): Take mutex as argument
2702         instead of its __data.__lock field.
2703         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
2704         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
2705         to lll_robust_lock.
2706         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
2707         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
2708         instead of mutex->__data.__kind directly, pass
2709         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
2710         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
2711         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
2712         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
2713         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
2714         to lll_timedlock, lll_robust_timedlock, lll_unlock and
2715         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
2716         of mutex->__data.__kind directly.
2717         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
2718         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
2719         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
2720         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
2721         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
2722         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
2723         and lll_futex_wake.
2724         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
2725         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
2726         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
2727         directly.
2728         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
2729         Take mutex as argument instead of its __data.__lock field, pass
2730         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
2731         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
2732         __data.__lock field.
2733         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
2734         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
2735         to lll_robust_cond_lock.
2736         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
2737         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
2738         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
2739         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
2740         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
2741         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
2742         lll_futex_wait.
2743         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
2744         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
2745         lll_futex_wake.
2746         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
2747         pshared variable, pass it to lll_lock, lll_unlock,
2748         lll_futex_timedwait and lll_futex_wake.
2749         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
2750         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
2751         and lll_futex_wake.
2752         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
2753         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
2754         macro.
2755         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
2756         lll_futex_wake_unlock): Likewise.
2757         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
2758         Likewise.
2759         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
2760         lll_futex_wake_unlock): Likewise.
2761         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
2762         Likewise.
2763         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
2764         lll_futex_wake_unlock): Likewise.
2765         (lll_futex_wake): Fix a typo.
2766         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
2767         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2768         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
2769         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
2770         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
2771         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2772         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
2773         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
2774         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2775         (__pthread_cond_timedwait): Likewise.
2776         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
2777         (__condvar_cleanup, __pthread_cond_wait): Likewise.
2778
2779 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
2780
2781         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2782         Don't use CGOTSETUP and CGOTRESTORE macros.
2783         (CGOTSETUP, CGOTRESTORE): Remove.
2784         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
2785         @local symbol.
2786
2787 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2788
2789         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
2790         definitions for private futexes.
2791         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
2792         kernel-features.h and lowlevellock.h.  Use private futexes if
2793         they are available.
2794         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
2795         (__lll_mutex_lock_wait): Rename to
2796         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
2797         (__lll_mutex_timedlock_wait): Rename to ...
2798         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
2799         Don't compile in for libc.so.
2800         (__lll_mutex_unlock_wake): Rename to ...
2801         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
2802         (__lll_timedwait_tid): Use __NR_gettimeofday.
2803         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
2804         the header from assembler.  Renamed all lll_mutex_* resp.
2805         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
2806         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
2807         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
2808         Define.
2809         (__lll_lock_wait_private): Add prototype.
2810         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
2811         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
2812         __lll_unlock_wake): Likewise.
2813         (lll_lock): Add private argument.  Call __lll_lock_wait_private
2814         if private is constant LLL_PRIVATE.
2815         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
2816         lll_timedlock, lll_robust_timedlock): Add private argument.
2817         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
2818         if private is constant LLL_PRIVATE.
2819         (lll_robust_unlock, lll_robust_dead): Add private argument.
2820         (lll_lock_t): Remove.
2821         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
2822         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
2823         lll_cond_wake, lll_cond_broadcast): Remove.
2824         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
2825         kernel-features.h and lowlevellock.h.
2826         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
2827         (LOAD_FUTEX_WAIT): Define.
2828         (__lll_robust_mutex_lock_wait): Rename to ...
2829         (__lll_robust_lock_wait): ... this.  Add private argument.
2830         Use LOAD_FUTEX_WAIT macro.
2831         (__lll_robust_mutex_timedlock_wait): Rename to ...
2832         (__lll_robust_timedlock_wait): ... this.    Add private argument.
2833         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
2834         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
2835         lowlevellock.h.
2836         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
2837         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
2838         __lll_mutex_{lock,unlock}_*.
2839         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
2840         lowlevellock.h and pthread-errnos.h.
2841         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
2842         FUTEX_CMP_REQUEUE, EINVAL): Remove.
2843         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
2844         __lll_mutex_{lock,unlock}_*.
2845         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
2846         lowlevellock.h and pthread-errnos.h.
2847         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
2848         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
2849         __lll_mutex_{lock,unlock}_*.
2850         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
2851         lowlevellock.h.
2852         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
2853         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
2854         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
2855         (__condvar_tw_cleanup): Likewise.
2856         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
2857         lowlevellock.h.
2858         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
2859         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
2860         __lll_mutex_{lock,unlock}_*.
2861         ( __condvar_w_cleanup): Likewise.
2862         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
2863         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
2864         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
2865         lowlevellock.h.
2866         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
2867         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
2868         __lll_mutex_{lock,unlock}_*.
2869         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
2870         lowlevellock.h.
2871         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
2872         FUTEX_PRIVATE_FLAG): Remove.
2873         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
2874         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
2875         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
2876         lowlevellock.h.
2877         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
2878         FUTEX_PRIVATE_FLAG): Remove.
2879         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
2880         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
2881         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
2882         lowlevellock.h.
2883         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
2884         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
2885         __lll_mutex_{lock,unlock}_*.
2886         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
2887         lowlevellock.h.
2888         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
2889         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
2890         __lll_mutex_{lock,unlock}_*.
2891         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
2892         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
2893         (__new_sem_post): Use standard initial exec code sequences.
2894         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
2895         lowlevellock.h.
2896         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
2897         FUTEX_PRIVATE_FLAG): Remove.
2898         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
2899         exec code sequences.
2900         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
2901         (__new_sem_trywait): Use standard initial exec code sequences.
2902         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
2903         (__new_sem_wait): Use standard initial exec code sequences.
2904
2905 2007-07-31  Anton Blanchard  <anton@samba.org>
2906
2907         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
2908         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
2909         atomic_full_barrier.
2910
2911 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
2912
2913         * allocatestack.c (stack_cache_lock): Change type to int.
2914         (get_cached_stack, allocate_stack, __deallocate_stack,
2915         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
2916         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
2917         as second argument to lll_lock and lll_unlock macros on
2918         stack_cache_lock.
2919         * pthread_create.c (__find_in_stack_list): Likewise.
2920         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
2921         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
2922         as second argument.
2923         * descr.h (struct pthread): Change lock and setxid_futex field
2924         type to int.
2925         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
2926         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
2927         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
2928         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
2929         Likewise.
2930         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
2931         * pthread_cond_init.c (__pthread_cond_init): Likewise.
2932         * pthreadP.h (__attr_list_lock): Change type to int.
2933         * pthread_attr_init.c (__attr_list_lock): Likewise.
2934         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
2935         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
2936         lll_{,un}lock.
2937         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
2938         also for lll_futex_{wake,wait}.
2939         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
2940         a pointer to const.
2941         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
2942         LLL_SHARED as second argument to lll_{,un}lock.
2943         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
2944         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
2945         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
2946         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
2947         Likewise.
2948         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
2949         as second argument to lll_{,un}lock macros on pd->lock.
2950         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
2951         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
2952         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2953         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
2954         Likewise.
2955         * sysdeps/pthread/createthread.c (do_clone, create_thread):
2956         Likewise.
2957         * pthread_once.c (once_lock): Change type to int.
2958         (__pthread_once): Pass LLL_PRIVATE as second argument to
2959         lll_{,un}lock macros on once_lock.
2960         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
2961         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
2962         rwlock->__data.__shared as second argument to them and similarly
2963         for lll_futex_w*.
2964         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
2965         Likewise.
2966         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
2967         Likewise.
2968         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
2969         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
2970         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
2971         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
2972         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
2973         to lll_{,un}lock macros on __sem_mappings_lock.
2974         * sem_open.c (check_add_mapping): Likewise.
2975         (__sem_mappings_lock): Change type to int.
2976         * semaphoreP.h (__sem_mappings_lock): Likewise.
2977         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
2978         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
2979         instead of lll_*mutex_*, pass LLL_SHARED as last
2980         argument.
2981         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
2982         pass LLL_SHARED as last argument.
2983         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
2984         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
2985         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
2986         pass LLL_SHARED as last argument.
2987         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2988         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
2989         LLL_SHARED as last argument.
2990         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
2991         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
2992         Similarly.
2993         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
2994         __libc_lock_lock_recursive, __libc_lock_unlock,
2995         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
2996         argument to lll_{,un}lock.
2997         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
2998         _IO_lock_unlock): Likewise.
2999         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
3000         compound literal.
3001         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
3002         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
3003         __fork_lock.
3004         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
3005         free_mem): Likewise.
3006         (__fork_lock): Change type to int.
3007         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
3008         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
3009         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
3010         lll_futex_wake.
3011         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
3012         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
3013         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
3014         New function.
3015         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
3016         pass it through to lll_futex_*wait, only compile in when
3017         IS_IN_libpthread.
3018         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3019         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
3020         argument and pass it through to lll_futex_*wait.
3021         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
3022         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
3023         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
3024         inline functions to __lll_* resp. __lll_robust_*.
3025         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
3026         (lll_mutex_dead): Add private argument.
3027         (__lll_lock_wait_private): New prototype.
3028         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
3029         __lll_robust_lock_timedwait): Add private argument to prototypes.
3030         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
3031         call __lll_lock_wait_private, otherwise pass private to
3032         __lll_lock_wait.
3033         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
3034         __lll_robust_timedlock): Add private argument, pass it to
3035         __lll_*wait functions.
3036         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
3037         call __lll_unlock_wake_private, otherwise pass private to
3038         __lll_unlock_wake.
3039         (__lll_robust_unlock): Add private argument, pass it to
3040         __lll_robust_unlock_wake.
3041         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
3042         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
3043         argument, pass it through to __lll_* inline function.
3044         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
3045         (lll_lock_t): Remove.
3046         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
3047         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
3048         lll_cond_wake, lll_cond_broadcast): Remove.
3049         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3050         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3051         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3052         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3053         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
3054         the header from assembler.  Renamed all lll_mutex_* resp.
3055         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
3056         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
3057         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3058         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
3059         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
3060         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
3061         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
3062         Remove prototype.
3063         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
3064         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
3065         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
3066         (lll_trylock): Likewise, use __lll_trylock_asm, pass
3067         MULTIPLE_THREADS_OFFSET as another asm operand.
3068         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
3069         MULTIPLE_THREADS_OFFSET as last asm operand, call
3070         __lll_lock_wait_private if private is constant LLL_PRIVATE,
3071         otherwise pass private as another argument to __lll_lock_wait.
3072         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
3073         lll_timedlock, lll_robust_timedlock): Add private argument, pass
3074         private as another argument to __lll_*lock_wait call.
3075         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
3076         MULTIPLE_THREADS_OFFSET as another asm operand, call
3077         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
3078         otherwise pass private as another argument to __lll_unlock_wake.
3079         (lll_robust_unlock): Add private argument, pass private as another
3080         argument to __lll_unlock_wake.
3081         (lll_robust_dead): Add private argument, use __lll_private_flag
3082         macro.
3083         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
3084         LLL_MUTEX_LOCK_INITIALIZER.
3085         (lll_lock_t): Remove.
3086         (LLL_LOCK_INITIALIZER_WAITERS): Define.
3087         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
3088         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
3089         lll_cond_wake, lll_cond_broadcast): Remove.
3090         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3091         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
3092         2007-05-2{3,9} changes.
3093         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
3094         kernel-features.h and lowlevellock.h.
3095         (LOAD_PRIVATE_FUTEX_WAIT): Define.
3096         (LOAD_FUTEX_WAIT): Rewritten.
3097         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
3098         define.
3099         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
3100         (__lll_mutex_lock_wait): Rename to ...
3101         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
3102         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
3103         (__lll_mutex_timedlock_wait): Rename to ...
3104         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
3105         contains private argument.  Don't compile in for libc.so.
3106         (__lll_mutex_unlock_wake): Rename to ...
3107         (__lll_unlock_wake): ... this.  %ecx contains private argument.
3108         Don't compile in for libc.so.
3109         (__lll_timedwait_tid): Use __NR_gettimeofday.
3110         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
3111         kernel-features.h and lowlevellock.h.
3112         (LOAD_FUTEX_WAIT): Define.
3113         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
3114         define.
3115         (__lll_robust_mutex_lock_wait): Rename to ...
3116         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
3117         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
3118         macro.
3119         (__lll_robust_mutex_timedlock_wait): Rename to ...
3120         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
3121         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
3122         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
3123         lowlevellock.h.
3124         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3125         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
3126         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
3127         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
3128         to __lll_lock_wait in %edx.
3129         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
3130         Include lowlevellock.h and pthread-errnos.h.
3131         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
3132         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
3133         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
3134         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
3135         pass LLL_SHARED in %ecx to both __lll_lock_wait and
3136         __lll_unlock_wake.
3137         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
3138         Include lowlevellock.h and pthread-errnos.h.
3139         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
3140         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
3141         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
3142         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
3143         pass LLL_SHARED in %ecx to both __lll_lock_wait and
3144         __lll_unlock_wake.
3145         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
3146         Include lowlevellock.h.
3147         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
3148         Don't define.
3149         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
3150         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
3151         pass LLL_SHARED in %ecx to both __lll_lock_wait and
3152         __lll_unlock_wake.  Use __NR_gettimeofday.
3153         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3154         Include lowlevellock.h.
3155         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3156         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
3157         to __lll_*, pass cond_lock address in %edx rather than %ecx to
3158         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
3159         and __lll_unlock_wake.
3160         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
3161         Include lowlevellock.h.
3162         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3163         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
3164         MUTEX(%ebx) address in %edx rather than %ecx to
3165         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
3166         and __lll_unlock_wake.  Move return value from %ecx to %edx
3167         register.
3168         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3169         Include lowlevellock.h.
3170         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
3171         Don't define.
3172         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
3173         MUTEX(%ebp) address in %edx rather than %ecx to
3174         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
3175         and __lll_unlock_wake.  Move return value from %ecx to %edx
3176         register.  Use __NR_gettimeofday.
3177         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3178         Include lowlevellock.h.
3179         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
3180         Don't define.
3181         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
3182         MUTEX(%ebp) address in %edx rather than %ecx to
3183         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
3184         and __lll_unlock_wake.  Move return value from %ecx to %edx
3185         register.  Use __NR_gettimeofday.
3186         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
3187         Include lowlevellock.h.
3188         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3189         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
3190         MUTEX(%edi) address in %edx rather than %ecx to
3191         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
3192         and __lll_unlock_wake.
3193         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
3194         Include lowlevellock.h.
3195         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3196         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
3197         MUTEX(%ebx) address in %edx rather than %ecx to
3198         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
3199         and __lll_unlock_wake.  Move return value from %ecx to %edx
3200         register.
3201         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
3202         lowlevellock.h.
3203         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
3204         define.
3205         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
3206         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
3207         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
3208         lowlevellock.h.
3209         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
3210         (sem_timedwait): Use __NR_gettimeofday.
3211         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
3212         lowlevellock.h.
3213         (LOCK): Don't define.
3214         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
3215         lowlevellock.h.
3216         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
3217         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
3218         are waiters.
3219         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
3220         2007-05-2{3,9} changes.
3221         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
3222         kernel-features.h and lowlevellock.h.
3223         (LOAD_PRIVATE_FUTEX_WAIT): Define.
3224         (LOAD_FUTEX_WAIT): Rewritten.
3225         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
3226         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
3227         (__lll_mutex_lock_wait): Rename to ...
3228         (__lll_lock_wait): ... this.  %esi is now private argument.
3229         Don't compile in for libc.so.
3230         (__lll_mutex_timedlock_wait): Rename to ...
3231         (__lll_timedlock_wait): ... this.  %esi contains private argument.
3232         Don't compile in for libc.so.
3233         (__lll_mutex_unlock_wake): Rename to ...
3234         (__lll_unlock_wake): ... this.  %esi contains private argument.
3235         Don't compile in for libc.so.
3236         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
3237         kernel-features.h and lowlevellock.h.
3238         (LOAD_FUTEX_WAIT): Define.
3239         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
3240         (__lll_robust_mutex_lock_wait): Rename to ...
3241         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
3242         Use LOAD_FUTEX_WAIT macro.
3243         (__lll_robust_mutex_timedlock_wait): Rename to ...
3244         (__lll_robust_timedlock_wait): ... this. %esi argument contains
3245         private, use LOAD_FUTEX_WAIT macro.
3246         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
3247         lowlevellock.h.
3248         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3249         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
3250         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
3251         __lll_lock_wait and __lll_unlock_wake.
3252         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
3253         Include lowlevellock.h and pthread-errnos.h.
3254         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
3255         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
3256         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
3257         pass LLL_SHARED in %esi to both __lll_lock_wait and
3258         __lll_unlock_wake.
3259         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
3260         Include lowlevellock.h and pthread-errnos.h.
3261         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
3262         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
3263         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
3264         pass LLL_SHARED in %esi to both __lll_lock_wait and
3265         __lll_unlock_wake.
3266         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
3267         Include lowlevellock.h.
3268         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3269         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
3270         pass LLL_SHARED in %esi to both __lll_lock_wait and
3271         __lll_unlock_wake.
3272         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
3273         Include lowlevellock.h.
3274         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
3275         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
3276         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
3277         and __lll_unlock_wake.
3278         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
3279         Include lowlevellock.h.
3280         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
3281         Don't define.
3282         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
3283         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
3284         and __lll_unlock_wake.
3285         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3286         Include lowlevellock.h.
3287         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
3288         Don't define.
3289         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
3290         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
3291         and __lll_unlock_wake.
3292         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3293         Include lowlevellock.h.
3294         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
3295         Don't define.
3296         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
3297         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
3298         and __lll_unlock_wake.
3299         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
3300         Include lowlevellock.h.
3301         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
3302         Don't define.
3303         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
3304         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
3305         and __lll_unlock_wake.
3306         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
3307         Include lowlevellock.h.
3308         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
3309         Don't define.
3310         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
3311         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
3312         and __lll_unlock_wake.
3313         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
3314         lowlevellock.h.
3315         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
3316         define.
3317         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
3318         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
3319         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
3320         lowlevellock.h.
3321         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
3322         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
3323         lowlevellock.h.
3324         (LOCK): Don't define.
3325         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
3326         lowlevellock.h.
3327         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
3328         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
3329         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
3330         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
3331         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
3332         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
3333         (__lll_lock_wait_private): New function.
3334         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
3335         it to lll_futex_*wait.  Don't compile in for libc.so.
3336         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
3337         Remove.
3338         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
3339         (struct sparc_pthread_barrier): Remove.
3340         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
3341         struct sparc_pthread_barrier.  Pass
3342         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
3343         and lll_futex_wait macros.
3344         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3345         Remove.
3346         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3347         Include sparc pthread_barrier_wait.c instead of generic one.
3348
3349 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
3350
3351         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
3352
3353         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
3354         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
3355         %ecx.
3356         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
3357         (pthread_rwlock_timedwrlock): Likewise.
3358         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
3359         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
3360
3361 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
3362
3363         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
3364
3365 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
3366
3367         * tst-locale2.c (useless): Add return statement.
3368
3369 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
3370
3371         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
3372         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
3373         * pthread_create.c (start_thread): Likewise.
3374         * init.c (sighandler_setxid): Likewise.
3375         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3376         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3377         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3378         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3379         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3380         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3381         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3382         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
3383         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
3384         Likewise.
3385         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
3386         Likewise.
3387         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
3388         Likewise.
3389         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
3390         __rtld_notify): Likewise.
3391         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
3392         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
3393         __pthread_once): Likewise.
3394         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
3395         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
3396         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
3397         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
3398         (lll_futex_wait): Add private argument, define as wrapper around
3399         lll_futex_timed_wait.
3400         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
3401         use __lll_private_flag macro.
3402         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
3403         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
3404         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
3405         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
3406         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
3407         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
3408         (lll_futex_wait): Add private argument, define as wrapper around
3409         lll_futex_timed_wait.
3410         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
3411         use __lll_private_flag macro.
3412         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
3413         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
3414         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
3415         Define.
3416         (lll_futex_timed_wait, lll_futex_wake): Use it.
3417         (lll_private_futex_wait, lll_private_futex_timed_wait,
3418         lll_private_futex_wake): Removed.
3419         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
3420         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
3421         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
3422         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
3423         (lll_futex_wait): Add private argument, define as wrapper around
3424         lll_futex_timed_wait.
3425         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
3426         use __lll_private_flag macro.
3427         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
3428         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
3429         to lll_futex_*.
3430         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3431         (lll_private_futex_wait, lll_private_futex_timed_wait,
3432         lll_private_futex_wake): Removed.
3433         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
3434         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
3435         (lll_private_futex_wait, lll_private_futex_timed_wait,
3436         lll_private_futex_wake): Removed.
3437         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
3438         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
3439         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
3440         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
3441         (lll_futex_wait): Add private argument, define as wrapper around
3442         lll_futex_timed_wait.
3443         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
3444         use __lll_private_flag macro.
3445         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
3446         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
3447         to lll_futex_*.
3448         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
3449         Define.
3450         (lll_futex_timed_wait, lll_futex_wake): Use it.
3451         (lll_private_futex_wait, lll_private_futex_timed_wait,
3452         lll_private_futex_wake): Removed.
3453
3454 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
3455
3456         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
3457         of the structure for sparc32.
3458
3459 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
3460
3461         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
3462
3463 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
3464
3465         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
3466         code used when private futexes are assumed.
3467         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3468         Likewise.
3469
3470 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
3471
3472         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3473         (__lll_private_flag): Define.
3474         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
3475         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
3476         __lll_private_flag.
3477         (lll_private_futex_wait, lll_private_futex_timedwait,
3478         lll_private_futex_wake): Define as wrapper around non-_private
3479         macros.
3480         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3481         (__lll_private_flag): Define.
3482         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
3483         (lll_private_futex_wait, lll_private_futex_timedwait,
3484         lll_private_futex_wake): Define as wrapper around non-_private
3485         macros.
3486
3487 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
3488
3489         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
3490         parameter to lll_futex_wait call.
3491         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
3492
3493         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3494         Replace lll_futex_wait with lll_private_futex_wait.
3495         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3496         Add LLL_SHARED parameter to lll_futex_wake().
3497
3498         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
3499         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
3500         lll_private_futex_wake.
3501         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
3502         bit from private parm before syscall.
3503         (lll_futex_timed_wait): Likewise.
3504         (lll_futex_wake): Likewise.
3505         (lll_futex_wake_unlock): Likewise.
3506         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
3507         (lll_robust_mutex_unlock): Likewise.
3508         (lll_mutex_unlock_force): Likewise.
3509         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
3510
3511 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
3512
3513         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
3514         compilation when unconditionally using private futexes.
3515         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3516         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3517         Likewise.
3518         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
3519         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3520
3521 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
3522
3523         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
3524         Define.
3525
3526 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3527
3528         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
3529         kernel-features.h.
3530
3531 2007-05-16  Roland McGrath  <roland@redhat.com>
3532
3533         * init.c (__nptl_initial_report_events): New variable.
3534         (__pthread_initialize_minimal_internal): Initialize pd->report_events
3535         to that.
3536
3537 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
3538
3539         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
3540         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
3541
3542 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
3543
3544         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
3545         implementation.
3546
3547 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
3548
3549         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
3550         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
3551         * pthread_mutex_timedlock.c: Likewise.
3552         * pthread_mutex_trylock.c: Likewise.
3553         * pthread_mutex_unlock.c: Likewise.
3554
3555 2007-06-17  Andreas Schwab  <schwab@suse.de>
3556
3557         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
3558         sections.
3559
3560 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
3561
3562         * allocatestack.c (allocate_stack): Make code compile if
3563         __ASSUME_PRIVATE_FUTEX is set.
3564
3565 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3566
3567         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
3568         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
3569         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
3570         (__pthread_rwlock_wrlock): Likewise.
3571         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
3572         (pthread_rwlock_timedrdlock): Likewise.
3573         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
3574         (pthread_rwlock_timedwrlock): Likewise.
3575         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
3576         (__pthread_rwlock_unlock): Likewise.
3577
3578 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3579
3580         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
3581         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
3582         Split __flags into __flags, __shared, __pad1 and __pad2.
3583         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
3584         futexes if they are available.
3585         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
3586         in libc-lowlevellock.S allow using private futexes.
3587         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
3588         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
3589         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
3590         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
3591         lll_private_futex_timed_wait and lll_private_futex_wake.
3592         (lll_robust_mutex_unlock): Fix typo.
3593         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
3594         field in futex command setup.
3595         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
3596         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
3597         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3598         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
3599         if they are available.  Remove clear_once_control.
3600         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
3601         futexes if they are available.
3602         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3603         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3604         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3605         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3606         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
3607         Wake only when there are waiters.
3608         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
3609         support.  Indicate that there are waiters.  Remove unnecessary
3610         extra cancellation test.
3611         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
3612         left-over duplication of __sem_wait_cleanup.
3613
3614 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
3615
3616         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
3617         parameter to lll_futex_wait, lll_futex_timed_wait, and
3618         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
3619         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
3620         lll_private_futex_wake.
3621         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
3622         * allocatestack.c: Adjust use of lll_futex_* macros.
3623         * init.c: Likewise.
3624         * lowlevellock.h: Likewise.
3625         * pthread_barrier_wait.c: Likewise.
3626         * pthread_cond_broadcast.c: Likewise.
3627         * pthread_cond_destroy.c: Likewise.
3628         * pthread_cond_signal.c: Likewise.
3629         * pthread_cond_timedwait.c: Likewise.
3630         * pthread_cond_wait.c: Likewise.
3631         * pthread_create.c: Likewise.
3632         * pthread_mutex_lock.c: Likewise.
3633         * pthread_mutex_setprioceiling.c: Likewise.
3634         * pthread_mutex_timedlock.c: Likewise.
3635         * pthread_mutex_unlock.c: Likewise.
3636         * pthread_rwlock_timedrdlock.c: Likewise.
3637         * pthread_rwlock_timedwrlock.c: Likewise.
3638         * pthread_rwlock_unlock.c: Likewise.
3639         * sysdeps/alpha/tls.h: Likewise.
3640         * sysdeps/i386/tls.h: Likewise.
3641         * sysdeps/ia64/tls.h: Likewise.
3642         * sysdeps/powerpc/tls.h: Likewise.
3643         * sysdeps/pthread/aio_misc.h: Likewise.
3644         * sysdeps/pthread/gai_misc.h: Likewise.
3645         * sysdeps/s390/tls.h: Likewise.
3646         * sysdeps/sh/tls.h: Likewise.
3647         * sysdeps/sparc/tls.h: Likewise.
3648         * sysdeps/unix/sysv/linux/fork.c: Likewise.
3649         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
3650         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
3651         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
3652         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
3653         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
3654         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3655         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3656         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
3657         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
3658         Likewise.
3659         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
3660         * sysdeps/x86_64/tls.h: Likewise.
3661
3662 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
3663
3664         * pthread_getattr_np.c: No need to install a cancellation handler,
3665         this is no cancellation point.
3666         * pthread_getschedparam.c: Likewise.
3667         * pthread_setschedparam.c: Likewise.
3668         * pthread_setschedprio.c: Likewise.
3669         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
3670         lll_unlock_wake_cb.
3671         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
3672         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
3673         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3674         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3675         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3676         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3677         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
3678         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
3679         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3680         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
3681         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3682         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3683
3684         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
3685         whether there are more than one thread makes no sense here since
3686         we only call the slow path if the locks are taken.
3687         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
3688
3689         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
3690         COND_NWAITERS_SHIFT.
3691         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
3692         COND_CLOCK_BITS.
3693         * pthread_cond_init.c: Likewise.
3694         * pthread_cond_timedwait.c: Likewise.
3695         * pthread_cond_wait.c: Likewise.
3696         * pthread_condattr_getclock.c: Likewise.
3697         * pthread_condattr_setclock.c: Likewise.
3698         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
3699         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3700         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3701         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3702         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3703
3704 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
3705
3706         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
3707         unistd.h.
3708
3709         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
3710         insn suffix.
3711         (THREAD_GSCOPE_GET_FLAG): Remove.
3712         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
3713         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
3714         changes.
3715         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
3716         (THREAD_GSCOPE_GET_FLAG): Remove.
3717         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
3718         instead of THREAD_GSCOPE_GET_FLAG.
3719         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
3720         it.
3721         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
3722         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
3723         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
3724         THREAD_GSCOPE_WAIT): Define.
3725         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
3726         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
3727         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
3728         THREAD_GSCOPE_WAIT): Define.
3729         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
3730         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
3731         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
3732         THREAD_GSCOPE_WAIT): Define.
3733         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
3734         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
3735         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
3736         THREAD_GSCOPE_WAIT): Define.
3737
3738 2007-05-24  Richard Henderson  <rth@redhat.com>
3739
3740         * descr.h (struct pthread): Add header.gscope_flag.
3741         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
3742         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
3743         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
3744         THREAD_GSCOPE_WAIT): Define.
3745
3746 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
3747
3748         * init.c: Make it compile with older kernel headers.
3749
3750         * tst-initializers1.c: Show through exit code which test failed.
3751
3752         * pthread_rwlock_init.c: Also initialize __shared field.
3753         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
3754         element in rwlock structure into four byte elements.  One of them is
3755         the new __shared element.
3756         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
3757         Likewise.
3758         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
3759         __shared, adjust names of other padding elements.
3760         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3761         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
3762         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
3763         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
3764         FUTEX_PRIVATE_FLAG.
3765         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
3766         futex to use private operations if possible.
3767         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3768         Likewise.
3769         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3770         Likewise.
3771         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
3772         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3773         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3774         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3775         Likewise.
3776         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3777         Likewise.
3778         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
3779         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3780
3781 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
3782
3783         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
3784         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
3785         * pthread_rwlock_timedrdlock.c: Likewise.
3786         * pthread_rwlock_tryrdlock.c: Likewise.
3787
3788         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
3789         optimization.
3790
3791         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
3792         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
3793         duplication of __sem_wait_cleanup.
3794
3795         * allocatestack.c: Revert last change.
3796         * init.c: Likewise.
3797         * sysdeps/i386/tls.h: Likewise.
3798         * sysdeps/x86_64/tls.h: Likewise.
3799         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
3800         header structure.
3801         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
3802
3803         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
3804         Add private field.
3805         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
3806         * pthread_barrier_init.c: Set private flag if pshared and private
3807         futexes are supported.
3808         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
3809         private field in futex command setup.
3810         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3811
3812 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
3813
3814         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
3815         support.
3816         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3817         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3818         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3819         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3820         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3821
3822         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
3823         * sem_init.c (__new_sem_init): Rewrite to initialize all three
3824         fields in the structure.
3825         (__old_sem_init): New function.
3826         * sem_open.c: Initialize all fields of the structure.
3827         * sem_getvalue.c: Adjust for renamed element.
3828         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
3829         (gen-as-const-headers): Add structsem.sym.
3830         * sysdeps/unix/sysv/linux/structsem.sym: New file.
3831         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
3832         struct new_sem.  Add struct old_sem.
3833         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
3834         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
3835         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3836         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
3837         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3838         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3839         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
3840         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3841         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3842         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
3843         * tst-sem10.c: New file.
3844         * tst-sem11.c: New file.
3845         * tst-sem12.c: New file.
3846         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
3847         of struct sem.
3848
3849 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
3850             Jakub Jelinek  <jakub@redhat.com>
3851
3852         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3853         Move __pthread_enable_asynccancel right before futex syscall.
3854         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
3855         Likewise.
3856
3857 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
3858
3859         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
3860         THREAD_COPY_PRIVATE_FUTEX): Define.
3861         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
3862         THREAD_COPY_PRIVATE_FUTEX): Define.
3863         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
3864         * init.c (__pthread_initialize_minimal_internal): Use
3865         THREAD_SET_PRIVATE_FUTEX.
3866
3867         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
3868         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
3869         THREAD_GSCOPE_FLAG_WAIT): Define.
3870         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
3871         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
3872         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
3873         PTR_DEMANGLE.
3874         (THREAD_GSCOPE_GET_FLAG): Define.
3875         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
3876         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
3877         instead of ->header.gscope_flag directly.
3878
3879 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
3880
3881         * init.c (__pthread_initialize_minimal_internal): Check whether
3882         private futexes are available.
3883         * allocatestack.c (allocate_stack): Copy private_futex field from
3884         current thread into the new stack.
3885         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
3886         futexes if they are available.
3887         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
3888         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
3889         in libc-lowlevellock.S allow using private futexes.
3890         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3891         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
3892         FUTEX_PRIVATE_FLAG.
3893         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
3894         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
3895         if they are available.
3896         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
3897         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
3898         * sysdeps/i386/tcb-offsets.sym: Likewise.
3899         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
3900         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
3901
3902 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
3903
3904         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3905         Remove ptr_wait_lookup_done again.
3906         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
3907         (__pthread_initialize_minimal_internal): Initialize
3908         _dl_wait_lookup_done pointer in _rtld_global directly.
3909         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3910         Remove code to code _dl_wait_lookup_done.
3911         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
3912         encrypted for now.
3913
3914 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
3915
3916         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
3917         pthread_mutex_init failed with ENOTSUP.
3918
3919 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
3920
3921         * allocatestack.c (__wait_lookup_done): New function.
3922         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3923         Add ptr_wait_lookup_done.
3924         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
3925         * pthreadP.h: Declare __wait_lookup_done.
3926         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
3927         Define macros to implement reference handling of global scope.
3928         * sysdeps/x86_64/tls.h: Likewise.
3929         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3930         Initialize GL(dl_wait_lookup_done).
3931
3932 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
3933
3934         [BZ #4512]
3935         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
3936         is detected.
3937         * pthread_mutex_timedlock.c: Likewise.
3938         * pthread_mutex_trylock.c: Likewise.
3939         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
3940
3941         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
3942         * tst-robust9.c: New file.
3943         * tst-robustpi9.c: New file.
3944
3945         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
3946         unnecessary extra cancellation test.
3947
3948 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
3949
3950         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
3951         extra cancellation test.
3952         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3953
3954 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
3955
3956         * descr.h (struct pthread): Rearrange members to fill hole in
3957         64-bit layout.
3958
3959         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3960         (__pthread_setaffinity_new): If syscall was successful and
3961         RESET_VGETCPU_CACHE is defined, use it before returning.
3962         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
3963
3964 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
3965
3966         [BZ #4455]
3967         * tst-align2.c: Include stackinfo.h.
3968         * tst-getpid1.c: Likewise.
3969
3970 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
3971
3972         [BZ #4455]
3973         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
3974         * tst-getpid1.c (do_test): Likewise.
3975
3976         [BZ #4456]
3977         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
3978         (allocate_stack): Likewise.
3979
3980 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
3981
3982         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3983         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
3984         (__lll_robust_timedlock_wait): Likewise.
3985         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
3986
3987 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
3988
3989         [BZ #4465]
3990         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
3991         * tst-cancel4.c (tf_fdatasync): New test.
3992
3993 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
3994
3995         [BZ #4392]
3996         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
3997         check mutexes like normal mutexes.
3998
3999         [BZ #4306]
4000         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
4001         Initialize the whole sigevent structure to appease valgrind.
4002
4003 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
4004
4005         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
4006         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
4007
4008 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
4009
4010         * tst-locale1.c: Avoid warnings.
4011         * tst-locale2.c: Likewise.
4012
4013 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
4014
4015         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4016         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
4017
4018 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
4019
4020         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
4021         __extern_always_inline where appropriate.
4022         * sysdeps/pthread/pthread.h: Likewise.
4023
4024 2007-03-13  Richard Henderson  <rth@redhat.com>
4025
4026         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
4027         separate cfi regions for the two subsections.
4028
4029 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
4030
4031         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
4032         new thread, don't just decrement it.
4033         Patch by Suzuki K P <suzuki@in.ibm.com>.
4034
4035 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
4036
4037         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
4038         PTHFCT_CALL definition.
4039
4040 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
4041
4042         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
4043         available, don't use it.
4044
4045 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
4046
4047         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4048         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
4049         call into the kernel to delay.
4050
4051 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
4052
4053         * tst-initializers1.c: We want to test the initializers as seen
4054         outside of libc, so undefined _LIBC.
4055
4056         * pthread_join.c (cleanup): Avoid warning.
4057
4058 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
4059
4060         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4061         (__lll_timedwait_tid): Add unwind info.
4062
4063         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
4064         function table, mangle the pointers.
4065         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
4066         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
4067         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
4068         demangle pointers before use.
4069         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
4070         demangle pointer.
4071         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
4072         * sysdeps/pthread/setxid.h: Likewise.
4073
4074 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
4075
4076         * tst-rwlock7.c: Show some more information in case of correct
4077         behavior.
4078
4079 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
4080
4081         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4082         (lll_futex_timed_wait): Undo part of last change, don't negate
4083         return value.
4084
4085 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
4086
4087         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
4088         FUTEX_CMP_REQUEUE and lll_futex_requeue.
4089
4090 2006-12-28  David S. Miller  <davem@davemloft.net>
4091
4092         * shlib-versions: Fix sparc64 linux target specification.
4093
4094 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
4095
4096         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
4097         Adjust include path for pthread_barrier_wait.c move.
4098
4099 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
4100
4101         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
4102         tid isn't reread from pd->tid in between ESRCH test and the syscall.
4103
4104 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
4105
4106         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
4107         6 argument cancellable syscalls.
4108         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
4109         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
4110         6 argument cancellable syscalls.
4111         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
4112
4113 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
4114
4115         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
4116         (__rtld_mrlock_initialize): Add missing closing parenthesis.
4117
4118 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
4119
4120         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
4121         __sync_lock_release instead of __sync_lock_release_si.
4122
4123 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
4124
4125         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
4126         Define.
4127         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
4128         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
4129         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4130         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4131         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4132         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4133         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4134         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4135         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4136         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4137         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4138
4139 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
4140
4141         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
4142         * pthread_barrier_wait.c: ...here.
4143         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
4144         * pthread_cond_broadcast.c: ...here.
4145         * sysdeps/pthread/pthread_cond_signal.c: Move to...
4146         * pthread_cond_signal.c: ...here.
4147         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
4148         * pthread_cond_timedwait.c: ...here.
4149         * sysdeps/pthread/pthread_cond_wait.c: Move to...
4150         * pthread_cond_wait.c: ...here.
4151         * sysdeps/pthread/pthread_once.c: Move to...
4152         * pthread_once.c: ...here.
4153         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
4154         * pthread_rwlock_rdlock.c: ...here.
4155         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
4156         * pthread_rwlock_timedrdlock.c: ...here.
4157         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
4158         * pthread_rwlock_timedwrlock.c: ...here.
4159         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
4160         * pthread_rwlock_unlock.c: ...here.
4161         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
4162         * pthread_rwlock_wrlock.c: ...here.
4163         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
4164         * pthread_spin_destroy.c: ...here.
4165         * sysdeps/pthread/pthread_spin_init.c: Move to...
4166         * pthread_spin_init.c: ...here.
4167         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
4168         * pthread_spin_unlock.c: ...here.
4169         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
4170         * pthread_getcpuclockid.c: ...here.
4171
4172         * init.c: USE_TLS support is now always enabled.
4173         * tst-tls5.h: Likewise.
4174         * sysdeps/alpha/tls.h: Likewise.
4175         * sysdeps/i386/tls.h: Likewise.
4176         * sysdeps/ia64/tls.h: Likewise.
4177         * sysdeps/powerpc/tls.h: Likewise.
4178         * sysdeps/s390/tls.h: Likewise.
4179         * sysdeps/sh/tls.h: Likewise.
4180         * sysdeps/sparc/tls.h: Likewise.
4181         * sysdeps/x86_64/tls.h: Likewise.
4182
4183 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
4184
4185         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
4186         __rtld_mrlock_change): Update oldval if atomic compare and exchange
4187         failed.
4188
4189         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4190         Define to THREAD_SELF->header.multiple_threads.
4191         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
4192         Likewise.
4193         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
4194         Likewise.
4195         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
4196         (SINGLE_THREAD_P): Likewise.
4197         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4198         (SINGLE_THREAD_P): Likewise.
4199         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
4200         (SINGLE_THREAD_P): Likewise.
4201         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4202         (SINGLE_THREAD_P): Likewise.
4203         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
4204         Likewise.
4205         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4206         (SINGLE_THREAD_P): Likewise.
4207         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4208         (SINGLE_THREAD_P): Likewise.
4209         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
4210         Likewise.
4211
4212 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
4213
4214         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
4215         by default rather than 2_3_3.
4216
4217 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
4218
4219         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
4220         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
4221         atomic_* instead of catomic_* macros.
4222
4223 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
4224
4225         [BZ #3285]
4226         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
4227         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
4228         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4229         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4230         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4231         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
4232         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4233         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4234         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4235         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
4236         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4237         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4238         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4239
4240 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
4241
4242         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
4243         cancelable syscalls with six parameters.
4244
4245         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
4246         operations instead of atomic_*.
4247
4248 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
4249
4250         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
4251
4252 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
4253
4254         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
4255         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
4256         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
4257         New file.
4258         * pthread_attr_setstack.c: Allow overwriting the version number of the
4259         new symbol.
4260         * pthread_attr_setstacksize.c: Likewise.
4261         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
4262         it.
4263         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
4264         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
4265
4266 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
4267
4268         [BZ #3251]
4269         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
4270         Patch by Petr Baudis.
4271
4272 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
4273
4274         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
4275
4276         * tst-cancel2.c (tf): Loop as long as something was written.
4277
4278 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4279
4280         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
4281         mutexes wake all mutexes.
4282         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
4283         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
4284         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4285
4286 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
4287
4288         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
4289         to guarantee the thread is always canceled.
4290
4291 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
4292
4293         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
4294         Include stdlib.h.
4295         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
4296         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
4297         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4298         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4299         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4300
4301 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
4302
4303         [BZ #3123]
4304         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
4305         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
4306         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4307         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4308         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4309         * Makefile (tests): Add tst-cond22.
4310         * tst-cond22.c: New file.
4311
4312 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
4313
4314         [BZ #3124]
4315         * descr.h (struct pthread): Add parent_cancelhandling.
4316         * sysdeps/pthread/createthread.c (create_thread): Pass parent
4317         cancelhandling value to child.
4318         * pthread_create.c (start_thread): If parent thread was canceled
4319         reset the SIGCANCEL mask.
4320         * Makefile (tests): Add tst-cancel25.
4321         * tst-cancel25.c: New file.
4322
4323 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
4324             Ulrich Drepper  <drepper@redhat.com>
4325
4326         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
4327         counterp if it is already zero.
4328         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
4329
4330 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
4331             Roland McGrath  <roland@redhat.com>
4332
4333         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
4334         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
4335         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
4336         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
4337         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
4338         lll_robust_mutex_timedlock, lll_mutex_unlock,
4339         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
4340         Add _L_*_ symbols around the subsection.
4341         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
4342         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
4343
4344 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
4345             Roland McGrath  <roland@redhat.com>
4346
4347         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4348         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
4349         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
4350         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
4351         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
4352         lll_robust_mutex_timedlock, lll_mutex_unlock,
4353         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
4354         Add _L_*_ symbols around the subsection.
4355         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
4356         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
4357
4358 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
4359
4360         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
4361         change because it can disturb too much existing code.  If real hard
4362         reader preference is needed we'll introduce another type.
4363         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4364         (pthread_rwlock_timedwrlock): Likewise.
4365         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
4366         Likewise.
4367
4368 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
4369
4370         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
4371         reader preference.
4372         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4373         (pthread_rwlock_timedwrlock): Likewise.
4374         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
4375         Likewise.
4376
4377 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
4378
4379         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
4380         Only define ifdef SHARED.
4381
4382 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
4383
4384         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
4385         (free_stacks): ...here.
4386         (__free_stack_cache): New function.
4387         * pthreadP.h: Declare __free_stack_cache.
4388         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
4389         ptr_freeres.
4390         * init.c (pthread_functions): Initialize ptr_freeres.
4391         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
4392         New freeres function.
4393
4394 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
4395
4396         [BZ #3018]
4397         * Makefile (extra-objs): Add modules to extra-test-objs instead.
4398
4399 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
4400
4401         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4402         _XOPEN_REALTIME_THREADS.
4403
4404 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
4405
4406         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
4407         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
4408         HAVE_CLOCK_GETTIME_VSYSCALL.
4409         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
4410
4411 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
4412
4413         * sysdeps/unix/sysv/linux/bits/posix_opt.h
4414         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
4415         * descr.h (struct priority_protection_data): New type.
4416         (struct pthread): Add tpp field.
4417         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
4418         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
4419         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
4420         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
4421         TPP mutexes.
4422         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
4423         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
4424         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
4425         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
4426         * tpp.c: New file.
4427         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
4428         boosted by TPP.
4429         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
4430         * pthread_mutexattr_getprioceiling.c
4431         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
4432         in the SCHED_FIFO priority range.
4433         * pthread_mutexattr_setprioceiling.c
4434         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
4435         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
4436         if mutex is not TPP.  Ceiling is now in __data.__lock.
4437         * pthread_mutex_setprioceiling.c: Include stdbool.h.
4438         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
4439         is now in __data.__lock.  Add locking.
4440         * pthread_create.c (__free_tcb): Free pd->tpp structure.
4441         * Makefile (libpthread-routines): Add tpp.
4442         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
4443         * tst-tpp.h: New file.
4444         * tst-mutexpp1.c: New file.
4445         * tst-mutexpp6.c: New file.
4446         * tst-mutexpp10.c: New file.
4447         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
4448         * tst-mutex6.c (TEST_FUNCTION): Likewise.
4449
4450 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
4451
4452         [BZ #2843]
4453         * pthread_join.c (pthread_join): Account for self being canceled
4454         when checking for deadlocks.
4455         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
4456         (tf1): Don't print anything after pthread_join returns, this would be
4457         another cancellation point.
4458         (tf2): Likewise.
4459         * tst-join6.c: New file.
4460         * Makefile (tests): Add tst-join6.
4461
4462 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
4463
4464         [BZ #2892]
4465         * pthread_setspecific.c (__pthread_setspecific): Check
4466         out-of-range index before checking for unused key.
4467
4468         * sysdeps/pthread/gai_misc.h: New file.
4469
4470 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
4471
4472         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
4473         file.  Don't use sysctl.
4474         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
4475         overwrite the file if this is likely not true.
4476
4477 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
4478
4479         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
4480         * Makefile (tests): Add tst-getpid3.
4481         * tst-getpid3.c: New file.
4482
4483 2006-07-30  Roland McGrath  <roland@redhat.com>
4484
4485         * Makefile (libpthread-routines): Add ptw-sigsuspend.
4486
4487         * sysdeps/unix/sysv/linux/i386/not-cancel.h
4488         (pause_not_cancel): New macro.
4489         (nanosleep_not_cancel): New macro.
4490         (sigsuspend_not_cancel): New macro.
4491         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
4492         nanosleep_not_cancel macro from <not-cancel.h>.
4493         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
4494         macro from <not-cancel.h>.
4495
4496 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
4497             Jakub Jelinek  <jakub@redhat.com>
4498
4499         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
4500         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
4501         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
4502         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
4503         * pthread_mutex_init.c: Add support for priority inheritance mutex.
4504         * pthread_mutex_lock.c: Likewise.
4505         * pthread_mutex_timedlock.c: Likewise.
4506         * pthread_mutex_trylock.c: Likewise.
4507         * pthread_mutex_unlock.c: Likewise.
4508         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
4509         all mutexes.
4510         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
4511         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
4512         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
4513         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
4514         pthread-pi-defines.sym.
4515         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
4516         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
4517         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4518         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
4519         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4520         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
4521         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
4522         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
4523         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
4524         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4525         _POSIX_THREAD_PRIO_INHERIT to 200112L.
4526         * tst-mutex1.c: Adjust to allow use in PI mutex test.
4527         * tst-mutex2.c: Likewise.
4528         * tst-mutex3.c: Likewise.
4529         * tst-mutex4.c: Likewise.
4530         * tst-mutex5.c: Likewise.
4531         * tst-mutex6.c: Likewise.
4532         * tst-mutex7.c: Likewise.
4533         * tst-mutex7a.c: Likewise.
4534         * tst-mutex8.c: Likewise.
4535         * tst-mutex9.c: Likewise.
4536         * tst-robust1.c: Likewise.
4537         * tst-robust7.c: Likewise.
4538         * tst-robust8.c: Likewise.
4539         * tst-mutexpi1.c: New file.
4540         * tst-mutexpi2.c: New file.
4541         * tst-mutexpi3.c: New file.
4542         * tst-mutexpi4.c: New file.
4543         * tst-mutexpi5.c: New file.
4544         * tst-mutexpi6.c: New file.
4545         * tst-mutexpi7.c: New file.
4546         * tst-mutexpi7a.c: New file.
4547         * tst-mutexpi8.c: New file.
4548         * tst-mutexpi9.c: New file.
4549         * tst-robust1.c: New file.
4550         * tst-robust2.c: New file.
4551         * tst-robust3.c: New file.
4552         * tst-robust4.c: New file.
4553         * tst-robust5.c: New file.
4554         * tst-robust6.c: New file.
4555         * tst-robust7.c: New file.
4556         * tst-robust8.c: New file.
4557         * Makefile (tests): Add the new tests.
4558
4559         * pthread_create.c (start_thread): Add some casts to avoid warnings.
4560         * pthread_mutex_destroy.c: Remove unneeded label.
4561
4562 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
4563
4564         * pthread_mutex_init.c (__pthread_mutex_init): Move some
4565         computations to compile time.
4566
4567 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
4568
4569         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
4570
4571 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
4572
4573         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
4574
4575 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
4576
4577         * pthread_key_create.c (__pthread_key_create): Do away with
4578         __pthread_keys_lock.
4579
4580         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4581         (__kernel_cpumask_size): Mark as hidden.
4582         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4583
4584         * sem_open.c (__sem_mappings_lock): Mark as hidden.
4585         * semaphoreP.h (__sem_mappings_lock): Likewise.
4586
4587 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
4588
4589         * pthread_atfork.c: Mark __dso_handle as hidden.
4590
4591 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
4592
4593         [BZ #2644]
4594         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
4595         the reload problem.  Change the one path in pthread_cancel_init
4596         which causes the problem.  Force gcc to reload.  Simplify callers.
4597         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
4598         (_Unwind_GetBSP): Undo last patch.
4599
4600 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
4601
4602         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
4603         function pointer is reloaded after pthread_cancel_init calls.
4604
4605         [BZ #2644]
4606         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
4607         pointers are reloaded after pthread_cancel_init calls.
4608
4609 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
4610
4611         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
4612         __always_inline.
4613
4614 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
4615
4616         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4617         Allocate new object which is passed to timer_sigev_thread so that
4618         the timer can be deleted before the new thread is scheduled.
4619
4620 2006-04-26  Roland McGrath  <roland@redhat.com>
4621
4622         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
4623
4624 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
4625
4626         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
4627         suffix for conditional jumps.
4628         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4629         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4630         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
4631         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
4632         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4633         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4634
4635         * init.c (sigcancel_handler): Compare with correct PID even if the
4636         thread is in the middle of a fork call.
4637         (sighandler_setxid): Likewise.
4638         Reported by Suzuki K P <suzuki@in.ibm.com> .
4639
4640 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
4641
4642         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
4643
4644 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
4645
4646         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
4647         fails [Coverity CID 105].
4648
4649 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
4650
4651         * sysdeps/pthread/pthread.h: Add nonnull attributes.
4652
4653 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
4654
4655         [BZ #2505]
4656         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
4657         Define __lll_rel_instr using lwsync.
4658
4659 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
4660
4661         * allocatestack.c (allocate_stack): Always initialize robust_head.
4662         * descr.h: Define struct robust_list_head.
4663         (struct pthread): Use robust_list_head in robust mutex list definition.
4664         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
4665         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
4666         (__pthread_initialize_minimal_internal): Register robust_list with
4667         the kernel.
4668         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
4669         Declare __set_robust_list_avail.
4670         * pthread_create.c (start_thread): Register robust_list of new thread.
4671         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
4672         waiters.
4673         * pthread_mutex_destroy.c: For robust mutexes don't look at the
4674         number of users, it's unreliable.
4675         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
4676         set_robust_list syscall is available.
4677         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
4678         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
4679         Set robust_head.list_op_pending before trying to lock a robust mutex.
4680         * pthread_mutex_timedlock.c: Likewise.
4681         * pthread_mutex_trylock.c: Likewise.
4682         * pthread_mutex_unlock.c: Likewise for unlocking.
4683         * Makefile (tests): Add tst-robust8.
4684         * tst-robust8.c: New file.
4685
4686 2006-03-08  Andreas Schwab  <schwab@suse.de>
4687
4688         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
4689         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
4690
4691 2006-03-05  Roland McGrath  <roland@redhat.com>
4692
4693         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
4694         and $config_os doesn't match *linux*.
4695
4696 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
4697
4698         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
4699         Use __syscall_error.
4700         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4701         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
4702         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
4703         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4704         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
4705         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
4706
4707 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
4708
4709         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
4710
4711 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
4712
4713         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
4714         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
4715         mutex.
4716         (__lll_robust_timedlock_wait): Likewise.
4717         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
4718         (__lll_robust_lock_wait): Likewise.
4719         (__lll_robust_timedlock_wait): Likewise.
4720         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
4721         (__lll_robust_lock_wait): Likewise.
4722         (__lll_robust_timedlock_wait): Likewise.
4723
4724 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
4725
4726         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
4727         lll_robust_mutex_trylock, lll_robust_mutex_lock,
4728         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
4729         lll_robust_mutex_unlock): Define.
4730         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
4731
4732 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
4733
4734         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
4735         instead of <clone.S>.
4736
4737 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
4738
4739         * Makefile (libpthread-routines): Add
4740         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
4741         and pthread_mutex_[sg]etprioceiling.
4742         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
4743         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
4744         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
4745         pthread_mutex_setprioceiling.
4746         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
4747         PTHREAD_PRIO_PROTECT): New enum values.
4748         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
4749         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
4750         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
4751         prototypes.
4752         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
4753         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
4754         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
4755         Define.
4756         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
4757         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
4758         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
4759         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
4760         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
4761         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
4762         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
4763         protocol mutexes.
4764         * pthread_mutex_getprioceiling.c: New file.
4765         * pthread_mutex_setprioceiling.c: New file.
4766         * pthread_mutexattr_getprioceiling.c: New file.
4767         * pthread_mutexattr_setprioceiling.c: New file.
4768         * pthread_mutexattr_getprotocol.c: New file.
4769         * pthread_mutexattr_setprotocol.c: New file.
4770
4771 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
4772
4773         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
4774
4775 2006-02-27  Roland McGrath  <roland@redhat.com>
4776
4777         * sysdeps/pthread/Subdirs: List nptl here too.
4778         * configure (libc_add_on_canonical): New variable.
4779
4780         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
4781
4782         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
4783         self to get main source tree's file.
4784         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
4785         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
4786         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
4787         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
4788         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
4789         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
4790         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
4791         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
4792         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
4793         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
4794         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
4795         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
4796         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
4797
4798         * Makefile: Use $(sysdirs) in vpath directive.
4799
4800         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
4801         (CPPFLAGS-timer_routines.c): Likewise.
4802
4803         * Makeconfig (includes): Variable removed.
4804
4805 2006-02-26  Roland McGrath  <roland@redhat.com>
4806
4807         * sysdeps/generic/pt-raise.c: Moved to ...
4808         * pt-raise.c: ... here.
4809         * sysdeps/generic/lowlevellock.h: Moved to ...
4810         * lowlevellock.h: ... here.
4811
4812 2006-02-23  Roland McGrath  <roland@redhat.com>
4813
4814         * descr.h (struct pthread): Add final member `end_padding'.
4815         (PTHREAD_STRUCT_END_PADDING): Use it.
4816
4817 2006-02-20  Roland McGrath  <roland@redhat.com>
4818
4819         * sysdeps/mips: Directory removed, saved in ports repository.
4820         * sysdeps/unix/sysv/linux/mips: Likewise.
4821
4822 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
4823
4824         * tst-robust1.c: Add second mutex to check that the mutex list is
4825         handled correctly.
4826
4827 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
4828
4829         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
4830         lll_robust_mutex_trylock, lll_robust_mutex_lock,
4831         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
4832         lll_robust_mutex_unlock): New macros.
4833         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
4834         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
4835         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
4836         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4837         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
4838
4839 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4840
4841         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
4842         definitions.
4843         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
4844
4845 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
4846
4847         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
4848         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
4849         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
4850         (lll_robust_mutex_unlock): Likewise.
4851
4852 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
4853
4854         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
4855         Set robust_list.__next rather than robust_list.
4856         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4857         (__pthread_list_t): New typedef.
4858         (pthread_mutex_t): Replace __next and __prev fields with __list.
4859         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
4860         (__pthread_list_t): New typedef.
4861         (pthread_mutex_t): Replace __next and __prev fields with __list.
4862         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4863         (__pthread_list_t, __pthread_slist_t): New typedefs.
4864         (pthread_mutex_t): Replace __next and __prev fields with __list.
4865         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
4866         (__pthread_list_t, __pthread_slist_t): New typedefs.
4867         (pthread_mutex_t): Replace __next and __prev fields with __list.
4868         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
4869         (__pthread_list_t, __pthread_slist_t): New typedefs.
4870         (pthread_mutex_t): Replace __next and __prev fields with __list.
4871         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
4872         (__pthread_slist_t): New typedef.
4873         (pthread_mutex_t): Replace __next field with __list.
4874
4875 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
4876
4877         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
4878         PTHREAD_MUTEX_OWNERDEAD.
4879         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
4880         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
4881         * Makefile (libpthread-routines): Add lowlevelrobustlock.
4882         * pthread_create.c (start_thread): Very much simplify robust_list loop.
4883         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
4884         to PTHREAD_MUTEX_INCONSISTENT.
4885         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
4886         * pthread_mutex_lock.c: Reimplement robust mutex handling.
4887         * pthread_mutex_trylock.c: Likewise.
4888         * pthread_mutex_timedlock.c: Likewise.
4889         * pthread_mutex_unlock.c: Likewise.
4890         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4891         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
4892         lowlevelrobustlock.sym.
4893         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
4894         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
4895         definitions.
4896         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4897         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
4898         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
4899         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
4900         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
4901
4902 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
4903
4904         * allocatestack.c (allocate_stack): Initialize robust_list.
4905         * init.c (__pthread_initialize_minimal_internal): Likewise.
4906         * descr.h (struct xid_command): Pretty printing.
4907         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
4908         robust_list.  Adjust macros.
4909         * pthread_create.c (start_thread): Adjust robust_list handling.
4910         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
4911         but the owner for all robust mutex types.
4912         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
4913         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
4914         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4915         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
4916
4917         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
4918         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
4919
4920 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
4921
4922         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
4923         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
4924
4925 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4926
4927         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
4928         Return status.
4929         (lll_futex_timed_wait): Define.
4930
4931 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
4932
4933         * tst-cancel4.c: Test ppoll.
4934
4935 2006-01-18  Andreas Jaeger  <aj@suse.de>
4936
4937         [BZ #2167]
4938         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
4939         (pthread_mutex_t): Follow changes for other archs.  Based on patch
4940         by Jim Gifford <patches@jg555.com>.
4941
4942 2006-01-13  Richard Henderson  <rth@redhat.com>
4943
4944         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
4945
4946 2006-01-10  Roland McGrath  <roland@redhat.com>
4947
4948         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
4949         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
4950         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
4951         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4952         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4953         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4954         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4955         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
4956         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4957         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4958
4959 2006-01-09  Roland McGrath  <roland@redhat.com>
4960
4961         * tst-initializers1-c89.c: New file.
4962         * tst-initializers1-c99.c: New file.
4963         * tst-initializers1-gnu89.c: New file.
4964         * tst-initializers1-gnu99.c: New file.
4965         * Makefile (tests): Add them.
4966         (CFLAGS-tst-initializers1-c89.c): New variable.
4967         (CFLAGS-tst-initializers1-c99.c): New variable.
4968         (CFLAGS-tst-initializers1-gnu89.c): New variable.
4969         (CFLAGS-tst-initializers1-gnu99.c): New variable.
4970
4971         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
4972         Use __extension__ on anonymous union definition.
4973         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4974         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4975         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4976         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4977         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4978
4979 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
4980
4981         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4982         Don't give the union a name because it changes the mangled name.
4983         Instead name the struct for __data.
4984         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
4985         Likewise.
4986         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
4987         Likewise.
4988
4989 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
4990
4991         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
4992         stack bias to mc_ftp field.
4993
4994 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
4995
4996         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
4997         being too clever and reloading the futex value where it shouldn't.
4998
4999 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
5000
5001         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
5002         correct type.
5003
5004 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
5005
5006         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5007         Add cfi directives.
5008
5009 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
5010
5011         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
5012         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
5013         rename in tcbhead_t.
5014
5015         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
5016         Don't give the union a name because it changes the mangled name.
5017         Instead name the struct for __data.
5018         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5019         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5020         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5021         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5022         * pthread_create.c (start_thread): Adjust robust mutex free loop.
5023         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
5024
5025 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
5026
5027         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5028         Return status.
5029         (lll_futex_timed_wait): Define.
5030         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5031         * sysdeps/pthread/aio_misc.h: New file.
5032
5033 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
5034
5035         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
5036
5037 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
5038
5039         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
5040         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
5041         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
5042
5043 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
5044
5045         * tst-cancel24.cc: Use C headers instead of C++ headers.
5046
5047 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
5048
5049         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
5050         sparc-linux configured glibc.
5051         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
5052         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
5053         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
5054         atomic_compare_and_exchange_val_24_acq instead of
5055         atomic_compare_and_exchange_val_acq.
5056         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
5057         instead of atomic_exchange_rel.
5058         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
5059         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
5060         file.
5061         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
5062         file.
5063         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
5064         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
5065         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
5066         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
5067         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
5068         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
5069         New file.
5070         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
5071         New file.
5072         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
5073         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
5074         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
5075         file.
5076         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
5077         file.
5078         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
5079
5080 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
5081
5082         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
5083         mutex initializers.
5084
5085 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
5086
5087         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
5088         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
5089         THREAD_COPY_POINTER_GUARD): Define.
5090         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
5091         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
5092
5093 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
5094
5095         * version.c: Update copyright year.
5096
5097 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5098
5099         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
5100         .eh_frame section, use cfi_* directives.
5101         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
5102
5103 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
5104
5105         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
5106         now.
5107
5108 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
5109
5110         * sysdeps/pthread/sigaction.c: Removed.
5111         * sigaction.c: New file.
5112         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
5113
5114 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
5115
5116         * Makefile (tests): Add tst-signal7.
5117         * tst-signal7.c: New file.
5118
5119 2005-12-27  Roland McGrath  <roland@redhat.com>
5120
5121         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
5122         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
5123         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
5124         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
5125         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
5126         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
5127         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
5128         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
5129         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
5130         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
5131         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
5132
5133 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
5134
5135         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
5136         and __prev field to pthread_mutex_t.
5137         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5138         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5139         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5140         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5141         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
5142         to pthread_mutex_t.
5143
5144 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
5145
5146         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
5147         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
5148         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
5149         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
5150         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
5151         and PTHREAD_MUTEXATTR_FLAG_BITS.
5152         * descr.h (struct pthread): Add robust_list field and define
5153         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
5154         * pthread_mutexattr_getrobust.c: New file.
5155         * pthread_mutexattr_setrobust.c: New file.
5156         * pthread_mutex_consistent.c: New file.
5157         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
5158         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
5159         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
5160         Adjust pthread_mutex_t initializers.
5161         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
5162         field to pthread_mutex_t.
5163         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
5164         and __prev field to pthread_mutex_t.
5165         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
5166         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
5167         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
5168         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
5169         * pthread_mutexattr_gettype.c: Likewise.
5170         * pthread_mutexattr_setpshared.c: Likewise.
5171         * pthread_mutexattr_settype.c: Likewise.
5172         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
5173         Initialize mutex kind according to robust flag.
5174         * pthread_mutex_lock.c: Implement local robust mutex.
5175         * pthread_mutex_timedlock.c: Likewise.
5176         * pthread_mutex_trylock.c: Likewise.
5177         * pthread_mutex_unlock.c: Likewise.
5178         * pthread_create.c (start_thread): Mark robust mutexes which remained
5179         locked as dead.
5180         * tst-robust1.c: New file.
5181         * tst-robust2.c: New file.
5182         * tst-robust3.c: New file.
5183         * tst-robust4.c: New file.
5184         * tst-robust5.c: New file.
5185         * tst-robust6.c: New file.
5186         * tst-robust7.c: New file.
5187         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
5188         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
5189         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
5190         tst-robust5, tst-robust6, and tst-robust7.
5191
5192         * tst-typesizes.c: New file.
5193         * Makefile (tests): Add tst-typesizes.
5194
5195         * tst-once3.c: More debug output.
5196
5197 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
5198
5199         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
5200         missing after last change.
5201
5202         * version.c: Update copyright year.
5203
5204 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
5205
5206         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
5207         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
5208         * pthread_mutex_trylock.c: Likewise.
5209         * pthread_mutex_timedlock.c: Likewise.
5210         * pthread_mutex_unlock.c: Likewise.
5211
5212 2005-12-22  Roland McGrath  <roland@redhat.com>
5213
5214         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
5215         so that #include_next's search location is not reset to the -I..
5216         directory where <nptl/...> can be found.
5217
5218 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
5219
5220         [BZ #1913]
5221         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
5222         Fix unwind info.  Remove useless branch prediction prefix.
5223         * tst-cancel24.cc: New file.
5224         * Makefile: Add rules to build and run tst-cancel24.
5225
5226 2005-12-21  Roland McGrath  <roland@redhat.com>
5227
5228         * libc-cancellation.c: Use <> rather than "" #includes.
5229         * pt-cleanup.c: Likewise.
5230         * pthread_create.c: Likewise.
5231         * pthread_join.c: Likewise.
5232         * pthread_timedjoin.c: Likewise.
5233         * pthread_tryjoin.c: Likewise.
5234         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
5235         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
5236         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
5237         * unwind.c: Likewise.
5238
5239 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5240
5241         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
5242         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
5243         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
5244         THREAD_COPY_POINTER_GUARD): Define.
5245
5246 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
5247
5248         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
5249         rather than one.
5250         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
5251         THREAD_COPY_POINTER_GUARD): Define.
5252         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
5253         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
5254         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
5255         THREAD_COPY_POINTER_GUARD): Define.
5256         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
5257         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
5258         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
5259         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
5260         Use PTR_DEMANGLE for B0 if defined.
5261
5262 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
5263
5264         * pthread_create.c (__pthread_create_2_1): Use
5265         THREAD_COPY_POINTER_GUARD if available.
5266         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
5267         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5268         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
5269         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
5270         * sysdeps/x86_64/tls.h: Likewise.
5271
5272 2005-12-15  Roland McGrath  <roland@redhat.com>
5273
5274         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
5275
5276 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
5277
5278         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
5279         sysdeps/generic.
5280         * errno-loc.c: New file.
5281
5282 2005-12-12  Roland McGrath  <roland@redhat.com>
5283
5284         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
5285         adjustments before choosing stack size.  Update minimum stack size
5286         calculation to match allocate_stack change.
5287
5288 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
5289
5290         * allocatestack.c (allocate_stack): Don't demand that there is an
5291         additional full page available on the stack beside guard, TLS, the
5292         minimum stack.
5293
5294 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
5295
5296         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
5297         (__cleanup_fct_attribute): Use __regparm__ not regparm.
5298
5299         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
5300         compiling 32-bit code we must define __cleanup_fct_attribute.
5301
5302 005-11-24  Jakub Jelinek  <jakub@redhat.com>
5303
5304         [BZ #1920]
5305         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
5306         __attribute__ instead of __attribute.
5307         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
5308         (__cleanup_fct_attribute): Likewise.
5309
5310 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
5311
5312         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
5313         a write barrier before writing libgcc_s_getcfa.
5314
5315 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
5316
5317         * sysdeps/unix/sysv/linux/configure: Removed.
5318
5319 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
5320
5321         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
5322         optional init_array/fini_array support.
5323
5324 2005-10-24  Roland McGrath  <roland@redhat.com>
5325
5326         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
5327         versioned_symbol use.
5328
5329 2005-10-16  Roland McGrath  <roland@redhat.com>
5330
5331         * init.c (__pthread_initialize_minimal_internal): Even when using a
5332         compile-time default stack size, apply the minimum that allocate_stack
5333         will require, and round up to page size.
5334
5335 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
5336
5337         * Makefile ($(test-modules)): Remove static pattern rule.
5338
5339 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
5340             Ulrich Drepper  <drepper@redhat.com>
5341
5342         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
5343         alignment in callback function.
5344         * Makefile: Add rules to build and run tst-align3.
5345         * tst-align3.c: New file.
5346
5347 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
5348
5349         * allocatestack.c (setxid_signal_thread): Add
5350         INTERNAL_SYSCALL_DECL (err).
5351
5352 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
5353
5354         * allocatestack.c (setxid_signal_thread): Need to use
5355         atomic_compare_and_exchange_bool_acq.
5356
5357 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
5358             Jakub Jelinek  <jakub@redhat.com>
5359
5360         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
5361         CANCEL_RESTMASK.
5362         (struct pthread): Move specific_used field to avoid padding.
5363         Add setxid_futex field.
5364         * init.c (sighandler_setxid): Reset setxid flag and release the
5365         setxid futex.
5366         * allocatestack.c (setxid_signal_thread): New function.  Broken
5367         out of the bodies of the two loops in __nptl_setxid.  For undetached
5368         threads check whether they are exiting and if yes, don't send a signal.
5369         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
5370         * pthread_create.c (start_thread): For undetached threads, check
5371         whether setxid bit is set.  If yes, wait until signal has been
5372         processed.
5373
5374         * allocatestack.c (STACK_VARIABLES): Initialize them.
5375         * pthread_create.c (__pthread_create_2_1): Initialize pd.
5376
5377 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
5378
5379         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
5380         waiters, awake all waiters on the associated mutex.
5381
5382 2005-09-22  Roland McGrath  <roland@redhat.com>
5383
5384         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
5385         ../sysdeps/x86_64/hp-timing.h).
5386
5387 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
5388
5389         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
5390         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
5391         (lll_futex_wake_unlock): Define.
5392         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
5393         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
5394         (lll_futex_wake_unlock): Define.
5395         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
5396         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
5397         (lll_futex_wake_unlock): Define.
5398         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
5399         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
5400         (lll_futex_wake_unlock): Define.
5401         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
5402         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
5403         (lll_futex_wake_unlock): Define.
5404         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
5405         lll_futex_wake_unlock.
5406         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5407         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
5408         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
5409         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
5410         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
5411         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
5412
5413 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5414
5415         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5416         Fix typo in register name.
5417
5418 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
5419
5420         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
5421         Use __sigfillset.  Document that sigfillset does the right thing wrt
5422         to SIGSETXID.
5423
5424 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
5425
5426         [BZ #1102]
5427         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
5428         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
5429         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
5430         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
5431         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
5432         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
5433         in the structure.
5434         * Makefile (tests): Add tst-initializers1.
5435         (CFLAGS-tst-initializers1.c): Set.
5436         * tst-initializers1.c: New test.
5437
5438 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
5439
5440         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
5441         Make sure __flags are located at offset 48 from the start of the
5442         structure.
5443
5444 2005-07-02  Roland McGrath  <roland@redhat.com>
5445
5446         * Makeconfig: Comment fix.
5447
5448 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
5449
5450         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
5451         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
5452         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
5453         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
5454         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
5455         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
5456         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
5457         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
5458         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
5459         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
5460
5461 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
5462
5463         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
5464         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
5465         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
5466         fields.
5467         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
5468         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
5469         field.  Put in sysinfo field unconditionally.
5470         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
5471         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
5472         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
5473         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
5474         fields.
5475         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
5476         * pthread_create.c (__pthread_create_2_1): Use
5477         THREAD_COPY_STACK_GUARD macro.
5478         * Makefile: Add rules to build and run tst-stackguard1{,-static}
5479         tests.
5480         * tst-stackguard1.c: New file.
5481         * tst-stackguard1-static.c: New file.
5482
5483 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
5484
5485         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5486         Invoke CGOTSETUP and CGOTRESTORE.
5487         (CGOTSETUP, CGOTRESTORE): Define.
5488
5489 2005-05-29  Richard Henderson  <rth@redhat.com>
5490
5491         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
5492         (tf_write, tf_writev): Use it.
5493         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
5494         the system minimum.
5495
5496 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
5497
5498         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
5499         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
5500         __librt_*_asynccancel@local.
5501
5502 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
5503
5504         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
5505         all occurrences of JUMPTARGET.  Instead append @local to labels.
5506
5507 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
5508
5509         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
5510         size/alignment of struct pthread rather than tcbhead_t.
5511         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
5512         Likewise.
5513         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
5514         Likewise.
5515         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
5516         Likewise.
5517
5518 2005-05-19  Richard Henderson  <rth@redhat.com>
5519
5520         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
5521         __sync_val_compare_and_swap, not explicit _si variant.
5522         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
5523
5524 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
5525
5526         [BZ #915]
5527         * sysdeps/pthread/pthread.h: Avoid empty initializers.
5528
5529 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
5530
5531         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
5532         .eh_frame section, use cfi_* directives.
5533
5534 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
5535
5536         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
5537         of "" includes.
5538
5539 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
5540
5541         [BZ #1075]
5542         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
5543         aio_write blocks.
5544
5545 2005-04-27  Roland McGrath  <roland@redhat.com>
5546
5547         * Makefile (tests): Remove tst-clock2.
5548
5549         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
5550         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
5551         translating to the kernel clockid_t for our own process/thread clock.
5552
5553         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
5554
5555 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
5556
5557         * old_pthread_cond_init.c: Include <errno.h>.
5558         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
5559         process shared or uses clock other than CLOCK_REALTIME.
5560         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
5561
5562 2005-04-13  David S. Miller  <davem@davemloft.net>
5563
5564         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
5565         * sysdeps/sparc/sparc64/clone.S: New file.
5566
5567 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
5568
5569         [BZ #1102]
5570         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
5571         __inline instead of inline.
5572         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
5573
5574 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
5575
5576         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
5577         functionally equivalent, but shorter instructions.
5578         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5579         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
5580         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5581         Likewise.
5582         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
5583         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5584         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5585         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5586         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5587         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5588         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5589         Likewise.
5590         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5591         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5592         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5593         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5594         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5595
5596 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
5597
5598         * sysdeps/mips/Makefile: New file.
5599         * sysdeps/mips/nptl-sysdep.S: New file.
5600         * sysdeps/mips/tcb-offsets.sym: New file.
5601         * sysdeps/mips/pthread_spin_lock.S: New file.
5602         * sysdeps/mips/pthread_spin_trylock.S: New file.
5603         * sysdeps/mips/pthreaddef.h: New file.
5604         * sysdeps/mips/tls.h: New file.
5605         * sysdeps/mips/jmpbuf-unwind.h: New file.
5606         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
5607         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
5608         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
5609         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
5610         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
5611         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
5612         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
5613         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
5614         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
5615         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
5616
5617 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
5618
5619         [BZ #1112]
5620         * pthread_create.c (__pthread_create_2_1): Rename syscall error
5621         variable to scerr.
5622
5623 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
5624
5625         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
5626
5627 2005-02-25  Roland McGrath  <roland@redhat.com>
5628
5629         * alloca_cutoff.c: Correct license text.
5630         * tst-unload.c: Likewise.
5631         * sysdeps/pthread/allocalim.h: Likewise.
5632         * sysdeps/pthread/pt-initfini.c: Likewise.
5633         * sysdeps/pthread/bits/libc-lock.h: Likewise.
5634         * sysdeps/pthread/bits/sigthread.h: Likewise.
5635         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
5636         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
5637
5638 2005-02-16  Roland McGrath  <roland@redhat.com>
5639
5640         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5641         Use unsigned int * for ptr_nthreads.
5642
5643 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
5644
5645         [BZ #721]
5646         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
5647         gcc4.
5648
5649 2005-02-07  Richard Henderson  <rth@redhat.com>
5650
5651         [BZ #787]
5652         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
5653         argument.
5654
5655 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
5656
5657         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
5658         order of arguments in invocation of atomic_add_zero.
5659
5660 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
5661
5662         [BZ #737]
5663         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
5664         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
5665         at least gotntpoff relocation and addition.
5666         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
5667         Likewise.
5668         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
5669         Likewise.
5670         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
5671         Likewise.
5672
5673 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
5674
5675         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
5676         entry for static tls deallocation fix.
5677         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
5678         also contains information whether the memory pointed to is static
5679         TLS or not.
5680         * sysdeps/i386/tls.h: Likewise.
5681         * sysdeps/ia64/tls.h: Likewise.
5682         * sysdeps/powerpc/tls.h: Likewise.
5683         * sysdeps/s390/tls.h: Likewise.
5684         * sysdeps/sh/tls.h: Likewise.
5685         * sysdeps/sparc/tls.h: Likewise.
5686         * sysdeps/x86_64/tls.h: Likewise.
5687
5688 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
5689
5690         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
5691
5692 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
5693
5694         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
5695         %esp.
5696         * Makefile (tests): Add tst-align2.
5697         * tst-align2.c: New test.
5698         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
5699         -mpreferred-stack-boundary=4.
5700
5701 2004-12-18  Roland McGrath  <roland@redhat.com>
5702
5703         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
5704         New file removed withdrawn for the moment.
5705
5706 2004-12-17  Richard Henderson  <rth@redhat.com>
5707
5708         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
5709         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
5710
5711 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
5712
5713         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
5714         Increased PTHREAD_STACK_MIN.
5715
5716         * tst-context1.c (stacks): Use bigger stack size.
5717
5718 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
5719
5720         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
5721         * sysdeps/sparc/tcb-offsets.sym: Add TID.
5722
5723 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
5724
5725         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
5726         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
5727         * sysdeps/s390/tcb-offsets.sym (TID): Add.
5728
5729 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
5730
5731         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
5732
5733 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
5734
5735         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
5736         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
5737
5738         * tst-getpid1.c: If child crashes, report this first.  Print which
5739         signal.
5740
5741 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
5742
5743         * init.c (__pthread_initialize_minimal_internal): Also unblock
5744         SIGSETXID.
5745
5746 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
5747
5748         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
5749         _POSIX_THREAD_CPUTIME): Define to 0.
5750         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
5751         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
5752         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
5753         __timer_signal_thread_tclk): Remove.
5754         (init_module): Remove their initialization.
5755         (thread_cleanup): Remove their cleanup assertions.
5756         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
5757         __timer_signal_thread_tclk): Remove.
5758         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
5759         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
5760         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
5761
5762 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
5763
5764         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
5765         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
5766
5767         * Makefile (tests): Add tst-getpid2.
5768         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
5769         (do_test): Use it.  Use __clone2 instead of clone on ia64.
5770         * tst-getpid2.c: New test.
5771
5772 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5773
5774         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
5775
5776 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
5777
5778         * Makefile (tests): Add tst-getpid1.
5779         * tst-getpid1.c: New file.
5780         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
5781         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
5782
5783 2004-12-02  Roland McGrath  <roland@redhat.com>
5784
5785         * Makefile (libpthread-nonshared): Variable removed.
5786         ($(objpfx)libpthread_nonshared.a): Target removed.
5787         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
5788         These are now handled by generic magic from
5789         libpthread-static-only-routines being set.
5790
5791 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
5792
5793         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
5794         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
5795         _POSIX_THREAD_PRIO_PROTECT): Define.
5796         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5797         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
5798         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5799
5800 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
5801
5802         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
5803         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
5804         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
5805         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
5806         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5807         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
5808         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5809
5810 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
5811
5812         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
5813
5814         * Makefile (libpthread-routines): Add pthread_setschedprio.
5815         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
5816         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
5817         * pthread_setschedprio.c: New file.
5818
5819 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
5820
5821         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
5822         * pthread_cancel.c (pthread_create): Likewise.
5823
5824         * Makefile (libpthread-routines): Add vars.
5825         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
5826         * init.c (__default_stacksize, __is_smp): Remove.
5827         * vars.c: New file.
5828         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
5829         and define a wrapper macro.
5830         (PTHREAD_STATIC_FN_REQUIRE): Define.
5831         * allocatestack.c (__find_thread_by_id): Undefine.
5832         * pthread_create (__pthread_keys): Remove.
5833         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
5834         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
5835         PTHREAD_STATIC_FN_REQUIRE.
5836
5837 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5838
5839         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
5840         parameter to REGISTER macro.
5841
5842 2004-11-17  Roland McGrath  <roland@redhat.com>
5843
5844         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
5845         Make sure SIGCANCEL is blocked as well.
5846
5847 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
5848
5849         * sysdeps/pthread/setxid.h: New file.
5850         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
5851         (struct xid_command): Add forward decl.
5852         (struct pthread_functions): Change return type of __nptl_setxid hook
5853         to int.
5854         * pthreadP.h (__nptl_setxid): Change return type to int.
5855         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
5856         calling thread, return its return value and set errno on failure.
5857         * descr.h (struct xid_command): Change id type to long array.
5858
5859         * Makefile: Add rules to build and test tst-setuid1 and
5860         tst-setuid1-static.
5861         * tst-setuid1.c: New test.
5862         * tst-setuid1-static.c: New test.
5863
5864 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
5865
5866         * Makefile (tests): Add tst-exit3.
5867         * tst-exit3.c: New test.
5868
5869 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
5870
5871         * Makefile (tests): Add tst-exit2.
5872         * tst-exit2.c: New file.
5873
5874 2004-11-09  Roland McGrath  <roland@redhat.com>
5875
5876         [BZ #530]
5877         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
5878         here, before calling clone.
5879         * pthread_create.c (start_thread): Don't do it here.
5880
5881 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
5882
5883         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
5884
5885 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
5886
5887         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
5888         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
5889         assembler warning.
5890
5891 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
5892
5893         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
5894         if sched_priority is not between minprio and maxprio.
5895
5896 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5897
5898         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
5899         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
5900
5901         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
5902         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
5903
5904 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
5905
5906         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
5907         not-cancelable I/O functions.
5908
5909 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5910
5911         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
5912         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
5913         make sure 2 is stored in the futex and we looked at the old value.
5914         Fix a few other problems to return the correct value.
5915
5916 2004-10-14  Richard Henderson  <rth@redhat.com>
5917
5918         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
5919         make gcc4 happy.
5920
5921 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
5922
5923         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
5924         of pthread-functions.h and pthreaddef.h.
5925         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
5926
5927         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
5928         Change __data.__nwaiters from int to unsigned int.
5929
5930         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
5931         sysconf (_SC_THREAD_CPUTIME) returns negative value.
5932
5933         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
5934         before return type.
5935
5936         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
5937         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
5938
5939 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
5940
5941         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
5942         test fails, remove message queue.
5943         (tf_msgsnd): Likewise.
5944
5945 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
5946
5947         * tst-clock1.c: Change #ifdef to #if defined.
5948         * tst-clock2.c: Likewise.
5949         * tst-cond11.c: Likewise.
5950
5951         * sysdeps/pthread/timer_create.c (timer_create): Use
5952         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
5953         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
5954         THREAD_CPUTIME.
5955
5956 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
5957
5958         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
5959         _POSIX_THREAD_CPUTIME): Define to 0.
5960
5961 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
5962
5963         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
5964         and _POSIX_THREAD_CPUTIME to zero.
5965         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
5966         * tst-barrier2.c: Fix testing for POSIX feature.
5967         * tst-clock1.c: Likewise.
5968         * tst-clock2.c: Likewise.
5969         * tst-cond11.c: Likewise.
5970         * tst-cond4.c: Likewise.
5971         * tst-cond6.c: Likewise.
5972         * tst-flock2.c: Likewise.
5973         * tst-mutex4.c: Likewise.
5974         * tst-mutex9.c: Likewise.
5975         * tst-rwlock12.c: Likewise.
5976         * tst-rwlock4.c: Likewise.
5977         * tst-signal1.c: Likewise.
5978         * tst-spin2.c: Likewise.
5979         * sysdeps/pthread/posix-timer.h: Likewise.
5980         * sysdeps/pthread/timer_create.c: Likewise.
5981         * sysdeps/pthread/timer_routines.c: Likewise.
5982
5983 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
5984
5985         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5986         (__lll_mutex_timedlock_wait): Address futex correctly.
5987
5988         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5989         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
5990         make sure 2 is stored in the futex and we looked at the old value.
5991         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5992         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
5993         which might very well made the code not working at all before.
5994         [BZ #417]
5995
5996 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
5997
5998         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
5999         allow SIGSETXID to be sent.
6000         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
6001         for SIGSETXID to be defined.
6002         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
6003         SIGSETXID cannot be blocked.
6004
6005         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6006         Add __extension__ to long long types.
6007         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6008         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6009         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6010         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6011         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6012         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6013         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6014
6015 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
6016
6017         * descr.h (struct pthread): Add stopped_start field.
6018         * sysdeps/pthread/createthread.c (create_thread): Set
6019         start_stopped flag in descriptor for new thread appropriately.
6020         * pthread_create.c (start_thread): Only take lock to be stopped on
6021         startup if stopped_start flag says so.
6022
6023 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
6024
6025         * pthread_create.c (__pthread_create_2_1): Remember whether thread
6026         is created detached and if yes, do not try to free the stack in case
6027         the thread creation failed.
6028         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
6029         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
6030         case there has been no error.  [BZ #405]
6031
6032         * pthread_create.c (start_thread): Don't wait for scheduler data
6033         etc to be set at the beginning of the function.  The cancellation
6034         infrastructure must have been set up.  And enable async
6035         cancellation before potentially going to sleep.  [BZ #401]
6036
6037 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
6038
6039         * Versions: Remove exports for pthread_set*id_np functions.
6040         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
6041         for now.
6042         * Makefile: Don't build pthread_set*id code for now.
6043
6044 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
6045
6046         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
6047         internal use.
6048         * allocatestack.c (__nptl_setxid): New function.
6049         * descr.h (struct xid_command): Define type.
6050         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
6051         (sighandler_setxid): New function.
6052         (__pthread_initialize_minimal): Register sighandler_setxid for
6053         SIGCANCEL.
6054         * pt-allocrtsig.c: Update comment.
6055         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
6056         Declare __nptl_setxid.
6057         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
6058         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
6059         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
6060         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
6061         and pthread_setresuid_np.
6062         * pthread_setgid_np.c: New file.
6063         * pthread_setuid_np.c: New file.
6064         * pthread_setegid_np.c: New file.
6065         * pthread_seteuid_np.c: New file.
6066         * pthread_setregid_np.c: New file.
6067         * pthread_setreuid_np.c: New file.
6068         * pthread_setresgid_np.c: New file.
6069         * pthread_setresuid_np.c: New file.
6070         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
6071         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
6072         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
6073         and pthread_setresuid_np.
6074         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
6075         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
6076         pthread_setregid, and pthread_setresgid.
6077
6078 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
6079
6080         * allocatestack.c (allocate_stack): Return EAGAIN instead of
6081         ENOMEM when out of memory.
6082
6083 2004-09-10  Roland McGrath  <roland@redhat.com>
6084
6085         [BZ #379]
6086         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
6087         code, since we don't try to use the broken CLONE_STOPPED any more.
6088         * pthread_create.c (start_thread): Likewise.
6089
6090 2004-09-15  Richard Henderson  <rth@redhat.com>
6091
6092         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
6093
6094 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
6095
6096         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
6097         (__libc_unwind_longjmp): Delete macro and declare as function.
6098         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
6099         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
6100         nptl directory.
6101         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
6102         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
6103         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
6104
6105 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
6106
6107         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
6108         for __USE_XOPEN2K.
6109         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
6110         types also for __USE_XOPEN2K.
6111         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6112         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6113         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6114         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6115         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6116         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6117         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6118         [BZ #320]
6119
6120 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
6121
6122         * sysdeps/pthread/pthread.h
6123         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
6124         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
6125         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
6126         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
6127         [BZ #375]
6128
6129 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
6130
6131         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
6132         PSEUDO to be used with . prefix.
6133
6134         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
6135         Use atomic_increment instead of atomic_exchange_and_add.
6136         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
6137         Likewise.
6138         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
6139         Likewise.
6140         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6141         Likewise.
6142
6143         * allocatestack.c (allocate_stack): Use atomic_increment_val
6144         instead of atomic_exchange_and_add.
6145         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
6146         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
6147         Likewise.
6148         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
6149         Likewise.
6150
6151         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
6152         the initialization function might throw.
6153
6154 2005-09-05  Richard Henderson  <rth@redhat.com>
6155
6156         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
6157         Move definition inside libpthread, libc, librt check.  Provide
6158         definition for rtld.
6159
6160 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
6161
6162         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
6163         * sysdeps/i386/jmpbuf-unwind.h: Likewise
6164         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
6165         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
6166         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
6167         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
6168         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
6169         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
6170         * unwind.c: Use it.
6171
6172         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6173         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
6174         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
6175         Likewise.
6176         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
6177         Decrement __nwaiters.  If pthread_cond_destroy has been called and
6178         this is the last waiter, signal pthread_cond_destroy caller and
6179         avoid using the pthread_cond_t structure after unlock.
6180         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6181         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6182         Read clock type from the least significant bits of __nwaiters instead
6183         of __clock.
6184         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6185         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
6186
6187 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
6188
6189         [BZ #342]
6190         * Makefile (tests): Add tst-cond20 and tst-cond21.
6191         * tst-cond20.c: New test.
6192         * tst-cond21.c: New test.
6193         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
6194         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
6195         it unsigned int.
6196         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6197         Likewise.
6198         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6199         (pthread_cond_t): Likewise.
6200         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
6201         Likewise.
6202         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6203         Likewise.
6204         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
6205         Likewise.
6206         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
6207         (cond_nwaiters): New.
6208         (clock_bits): New.
6209         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
6210         if there are waiters not signalled yet.
6211         Wait until all already signalled waiters wake up.
6212         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
6213         __nwaiters.  If pthread_cond_destroy has been called and this is the
6214         last waiter, signal pthread_cond_destroy caller and avoid using
6215         the pthread_cond_t structure after unlock.
6216         (__pthread_cond_wait): Increment __nwaiters in the beginning,
6217         decrement it when leaving.  If pthread_cond_destroy has been called
6218         and this is the last waiter, signal pthread_cond_destroy caller.
6219         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6220         Likewise.  Read clock type from the least significant bits of
6221         __nwaiters instead of __clock.
6222         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
6223         whether clock ID can be encoded in COND_CLOCK_BITS bits.
6224         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
6225         clock type just from the last COND_CLOCK_BITS bits of value.
6226         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
6227         instead of __clock, just from second bit of condattr's value.
6228
6229 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
6230
6231         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
6232         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
6233         != 64.
6234         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
6235
6236 2004-08-15  Roland McGrath  <roland@frob.com>
6237
6238         * pthread_atfork.c: Update copyright terms including special exception
6239         for these trivial files, which are statically linked into executables
6240         that use dynamic linking for the significant library code.
6241
6242 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
6243
6244         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
6245         pthread_rwlock_rdlock.
6246         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
6247         Decrease __nr_readers_queued after reacquiring lock.
6248         * sysdeps/pthread/pthread_rwlock_timedrdlock
6249         (pthread_rwlock_timedrdlock): Likewise.
6250         Reported by Bob Cook <bobcook47@hotmail.com>.
6251
6252 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
6253
6254         * tst-rwlock14.c (tf): Read main thread handle from *ARG
6255         before pthread_barrier_wait.
6256
6257 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
6258
6259         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
6260         Remove unnecessary exception handling data.
6261
6262 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
6263
6264         [BZ #284]
6265         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
6266         instead of clockid_t.
6267
6268 2004-07-21  Roland McGrath  <roland@redhat.com>
6269
6270         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
6271
6272 2004-07-19  Roland McGrath  <roland@redhat.com>
6273
6274         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
6275
6276 2004-07-02  Roland McGrath  <roland@redhat.com>
6277
6278         * configure: Don't exit.
6279
6280 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6281
6282         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
6283         (__pthread_cond_timedwait): Check for invalid nanosecond in
6284         timeout value.
6285
6286 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
6287
6288         * Makefile: Add rules to build and run tst-fini1.
6289         * tst-fini1.c: New file.
6290         * tst-fini1mod.c: New file.
6291
6292 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
6293
6294         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
6295         if no cancellation support is needed.
6296         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6297         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6298         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6299         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6300         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6301         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6302         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6303         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
6304         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
6305
6306         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
6307         only if not already defined.
6308
6309 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
6310
6311         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
6312         constraint "m" instead of "0" for futex.
6313
6314         * shlib-versions: Add powerpc64-.*-linux.*.
6315
6316 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
6317
6318         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
6319         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
6320         for valid tv_nsec.
6321         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
6322         1 billion and 64-bit tv_nsec which is valid when truncated to 32
6323         bits.
6324
6325 2004-06-29  Roland McGrath  <roland@redhat.com>
6326
6327         * Banner: NPTL no longer has its own version number.
6328         * Makefile (nptl-version): Variable removed.
6329         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
6330         using $(version), the glibc version number.
6331
6332 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6333
6334         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
6335         Fix branch offset for a PLT entry.
6336         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
6337         Likewise.
6338         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
6339         Likewise.
6340         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
6341         Likewise.
6342         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
6343         Likewise.
6344
6345 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
6346
6347         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
6348         unconditionally.
6349
6350 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
6351
6352         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
6353         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
6354         instead of tv_sec.
6355         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
6356         (pthread_rwlock_timedrdlock): Likewise.
6357
6358 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
6359
6360         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
6361         Set __r7 to val, not mutex.
6362
6363 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
6364
6365         * Makefile: Add rules to build tst-rwlock14.
6366         * tst-rwlock14.c: New file.
6367
6368 2004-06-24  Boris Hu  <boris.hu@intel.com>
6369
6370         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
6371         check.
6372         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6373
6374 2004-06-19  Andreas Jaeger  <aj@suse.de>
6375
6376         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
6377         assembler in last patch.
6378
6379 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
6380
6381         * sysdeps/pthread/pthread_cond_timedwait.c
6382         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
6383         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6384         (__pthread_cond_timedwait): Check for invalid nanosecond in
6385         timeout value.
6386         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6387         * tst-cond19.c: New file.
6388         * Makefile: Add rules to build and run tst-cond19.
6389
6390 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
6391
6392         * tst-context1.c (GUARD_PATTERN): Defined.
6393         (tst_context_t): Define struct containing ucontext_t & guard words.
6394         (ctx): Declare as an array of tst_context_t.
6395         (fct): Verify uc_link & guard words are still valid.
6396         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
6397
6398 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6399
6400         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6401         Add __data.__futex field, reshuffle __data.__clock.
6402         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
6403         (__pthread_cond_signal): Increment __futex at the same time as
6404         __wakeup_seq or __total_seq.  Pass address of __futex instead of
6405         address of low 32-bits of __wakeup_seq to futex syscall.
6406         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
6407         (__pthread_cond_wait): Likewise.  Pass __futex value from before
6408         releasing internal lock to FUTEX_WAIT.
6409         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
6410         (__pthread_cond_timedwait): Likewise.
6411         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
6412         (FUTEX_CMP_REQUEUE): Define.
6413         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
6414         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
6415         Pass __futex value from before the unlock and __futex address instead
6416         of address of low 32-bits of __wakeup_seq to futex syscall.
6417         Fallback to FUTEX_WAKE all on any errors.
6418
6419 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
6420
6421         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
6422         comment typo.
6423         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
6424         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
6425         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
6426         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
6427         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
6428
6429 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6430
6431         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
6432         Add memory clobber to inline assembly.
6433         (__lll_mutex_trylock): Likewise.
6434         (__lll_mutex_cond_trylock): Likewise.
6435
6436 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6437
6438         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
6439         Pass val argument as 6th system call argument in %r7.
6440
6441 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
6442
6443         * Makefile (tests): Add tst-cond16.
6444         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
6445         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
6446         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6447         Add __data.__futex field, reshuffle __data.__clock.
6448         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
6449         (__pthread_cond_signal): Increment __futex at the same time as
6450         __wakeup_seq or __total_seq.  Pass address of __futex instead of
6451         address of low 32-bits of __wakeup_seq to futex syscall.
6452         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
6453         (__pthread_cond_wait): Likewise.  Pass __futex value from before
6454         releasing internal lock to FUTEX_WAIT.
6455         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
6456         (__pthread_cond_timedwait): Likewise.
6457         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
6458         (FUTEX_CMP_REQUEUE): Define.
6459         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
6460         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
6461         Pass __futex value from before the unlock and __futex address instead
6462         of address of low 32-bits of __wakeup_seq to futex syscall.
6463         Fallback to FUTEX_WAKE all on any errors.
6464         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
6465         Define.
6466         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
6467         internally.  Return non-zero if error, zero if success.
6468         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
6469         Add __data.__futex field, reshuffle __data.__clock.
6470         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
6471         Define.
6472         (lll_futex_requeue): Add val argument, return 1 unconditionally
6473         for the time being.
6474         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6475         Add __data.__futex field, reshuffle __data.__clock.
6476         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
6477         Define.
6478         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
6479         internally.  Return non-zero if error, zero if success.
6480         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6481         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
6482         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
6483         Define.
6484         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
6485         internally.  Return non-zero if error, zero if success.
6486         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
6487         Add __data.__futex field, reshuffle __data.__clock.
6488         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
6489         Define.
6490         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
6491         internally.  Return non-zero if error, zero if success.
6492         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
6493         Add __data.__futex field, reshuffle __data.__clock.
6494         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
6495         Add __data.__futex field, reshuffle __data.__clock.
6496         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
6497         Increment __futex at the same time as __wakeup_seq or __total_seq.
6498         Pass address of __futex instead of address of low 32-bits of
6499         __wakeup_seq to futex syscall.
6500         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
6501         Pass __futex value from before releasing internal lock
6502         to FUTEX_WAIT.
6503         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6504         Likewise.  Avoid unnecessary shadowing of variables.
6505         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
6506         Set __futex to 2 * __total_seq.  Pass __futex value from before the
6507         unlock and __futex address instead of address of low 32-bits of
6508         __wakeup_seq to futex_requeue macro, adjust for new return value
6509         meaning.
6510         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
6511         (__pthread_cond_signal): Increment __futex at the same time as
6512         __wakeup_seq or __total_seq.  Pass address of __futex instead of
6513         address of low 32-bits of __wakeup_seq to futex syscall.
6514         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6515         (__pthread_cond_wait): Likewise.  Pass __futex value from before
6516         releasing internal lock to FUTEX_WAIT.
6517         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6518         (__pthread_cond_timedwait): Likewise.
6519         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6520         (FUTEX_CMP_REQUEUE): Define.
6521         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
6522         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
6523         Pass __futex value from before the unlock and __futex address instead
6524         of address of low 32-bits of __wakeup_seq to futex syscall.
6525         Fallback to FUTEX_WAKE all on any errors.
6526
6527 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6528
6529         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
6530         Add nop to align the end of critical section.
6531         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
6532
6533 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6534
6535         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6536         Add __broadcast_seq field.
6537         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
6538         all waiters as woken with woken_seq and bump broadcast counter.
6539         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
6540         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
6541         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6542         Comment typo fixes.  Avoid returning -ETIMEDOUT.
6543
6544 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
6545
6546         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6547         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
6548         Reported by Kaz Kojima.
6549
6550 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
6551
6552         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
6553
6554 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
6555
6556         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
6557         __broadcast_seq with bc_seq after acquiring internal lock instead of
6558         before it.
6559
6560 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
6561
6562         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
6563         compilation.
6564         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6565         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
6566         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6567         (pthread_cond_t): Add __data.__broadcast_seq field.
6568         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6569         (FRAME_SIZE): Define.
6570         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
6571         Comment typo fixes.
6572         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
6573         Define.
6574         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
6575         typo fixes.
6576         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6577         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
6578         fixes.
6579
6580 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
6581
6582         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
6583         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
6584         Add __broadcast_seq field.
6585         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6586         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6587         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6588         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6589         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6590         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
6591         all waiters as woken with woken_seq and bump broadcast counter.
6592         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
6593         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
6594         __broadcast_seq field.
6595         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6596         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6597         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
6598         * pthread_cond_init.c: Initialize __broadcast_seq field.
6599         * Makefile (tests): Add tst-cond17 and tst-cond18.
6600         Add .NOTPARALLEL goal.
6601         * tst-cond16.c: New file.  From Jakub.
6602         * tst-cond17.c: New file.  From Jakub.
6603         * tst-cond18.c: New file.  From Jakub.
6604
6605 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
6606
6607         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
6608         unwind info.
6609
6610         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
6611         Parametrize frame size.  Correct some unwind info.
6612         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6613
6614 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
6615
6616         * tst-stack3.c: Note testing functionality beyond POSIX.
6617
6618 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
6619
6620         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
6621         Change conditional from ifdef to if.
6622
6623 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
6624
6625         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
6626         SYSDEP_CANCEL_ERROR): Define.
6627         (PSEUDO): Use it.
6628
6629 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
6630
6631         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
6632
6633 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
6634
6635         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
6636
6637 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6638
6639         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
6640         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6641         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
6642         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6643
6644 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
6645
6646         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
6647         thread has all signals blocked.
6648
6649 2004-04-18  Andreas Jaeger  <aj@suse.de>
6650
6651         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
6652         (SEM_VALUE_MAX): Add missing brace.
6653
6654 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
6655
6656         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
6657         in rt subdir.
6658         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
6659         * sysdeps/pthread/tst-mqueue8x.c: New test.
6660         * tst-cancel4.c: Update comment about message queues.
6661
6662         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
6663         return it_value { 0, 0 }.
6664         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
6665         like SIGEV_SIGNAL.
6666         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
6667         assertion for SIGEV_NONE.
6668         (thread_attr_compare): Compare all attributes, not just a partial
6669         subset.
6670
6671 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
6672
6673         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
6674
6675 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
6676
6677         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
6678         Just use a plain number.
6679         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
6680         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
6681         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
6682         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
6683         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
6684         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
6685         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
6686
6687 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6688
6689         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
6690         frame info.
6691         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6692
6693 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
6694
6695         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
6696         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
6697         of calling sigwaitinfo.
6698
6699 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
6700
6701         * allocatestack.c (allocate_stack): Set reported_guardsize
6702         unconditionally.
6703         * pthread_getattr_np.c (pthread_getattr_np): Use
6704         reported_guardsize instead of guardsize.
6705         * descr.h (struct pthread): Add reported_guardsize field.
6706
6707 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
6708
6709         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
6710
6711 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
6712
6713         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
6714
6715 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
6716
6717         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
6718         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
6719         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
6720         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
6721         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
6722         Define.
6723         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
6724         (_POSIX_MESSAGE_PASSING): Define.
6725         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
6726         (_POSIX_MESSAGE_PASSING): Define.
6727         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
6728         (_POSIX_MESSAGE_PASSING): Define.
6729
6730 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
6731
6732         * tst-context1.c (fct): Check whether correct stack is used.
6733
6734 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
6735
6736         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
6737         matching constraints for asm mem parameters.
6738
6739         * tst-clock2.c (tf): Don't define unless needed.
6740
6741 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
6742
6743         * Makefile (link-libc-static): Use $(static-gnulib) instead of
6744         $(gnulib).
6745
6746 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
6747
6748         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
6749         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
6750         * pthreadP.h: Declare __nptl_deallocate_tsd.
6751         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
6752         Adjust caller.
6753
6754         * Makefile (tests): Add tst-tsd5.
6755         * tst-tsd5.c: New file.
6756
6757 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
6758
6759         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6760         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
6761         is SHLIB_COMPAT check.
6762         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6763         (__pthread_attr_getaffinity_old): Likewise.
6764         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6765         (__pthread_getaffinity_old): Likewise.
6766         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
6767         (__pthread_setaffinity_old): Likewise.
6768
6769 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
6770
6771         * allocatestack.c (_make_stacks_executable): Call
6772         _dl_make_stack_executable first.
6773
6774 2004-03-24  Roland McGrath  <roland@redhat.com>
6775
6776         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
6777         constraint instead of "0".
6778
6779 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
6780
6781         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6782         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
6783
6784         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
6785         code to avoid warning.
6786
6787 2004-03-24  Andreas Jaeger  <aj@suse.de>
6788
6789         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6790         (__pthread_attr_setaffinity_old): Remove const.
6791
6792 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
6793
6794         * sysdeps/unix/sysv/linux/smp.h: New file.
6795         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
6796         * init.c: Define __is_smp.
6797         (__pthread_initialize_minimal_internal): Call is_smp_system to
6798         initialize __is_smp.
6799         * pthreadP.h: Declare __is_smp.
6800         Define MAX_ADAPTIVE_COUNT is necessary.
6801         * pthread_mutex_init.c: Add comment regarding __spins field.
6802         * pthread_mutex_lock.c: Implement adaptive mutex type.
6803         * pthread_mutex_timedlock.c: Likewise.
6804         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
6805         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
6806         Add __spins field.
6807         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6808         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6809         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6810         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6811         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6812         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6813         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6814         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
6815         lll_mutex_cond_trylock.
6816         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6817         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6818         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6819         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6820         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6821         Define BUSY_WAIT_NOP.
6822         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6823         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6824
6825         * tst-mutex5.c: Add support for testing adaptive mutexes.
6826         * tst-mutex7.c: Likewise.
6827         * tst-mutex5a.c: New file.
6828         * tst-mutex7a.c: New file.
6829         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
6830
6831         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
6832         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
6833         vgettimeofday call might destroy the content.
6834
6835         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
6836         @pause in the loop.
6837
6838         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
6839         No need to restrict type of ret.  Make it int.  Add comment.
6840
6841         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
6842         Remove unnecessary setne instruction.
6843
6844 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
6845
6846         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6847         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
6848         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
6849         If realloc fails, break out of the loop.
6850
6851 2004-03-20  Andreas Jaeger  <aj@suse.de>
6852
6853         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
6854         (__pthread_setaffinity_old): Fix interface.
6855         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6856         (__pthread_getaffinity_old): Likewise.
6857
6858         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
6859         (__pthread_setaffinity_new): Remove duplicate declaration.
6860
6861 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6862
6863         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
6864         the return value to a safe register.
6865         (CDISABLE): Set the function argument correctly.
6866
6867 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6868
6869         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
6870         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
6871         Rewrite so that only one locked memory operation per round is needed.
6872         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
6873         (pthread_barrier_wait): After wakeup, release lock only when the
6874         last thread stopped using the barrier object.
6875         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
6876         (__pthread_cond_wait): Don't store mutex address if the current
6877         value is ~0l.  Add correct cleanup support and unwind info.
6878         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6879         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
6880         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
6881         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
6882         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
6883         Add correct cleanup support and unwind info.
6884         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
6885         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
6886         information for syscall wrappers.
6887
6888 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
6889
6890         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6891         cpusetsize field, remove next.
6892         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
6893         parameter for size of the CPU set.
6894         (pthread_setaffinity_np): Likewise.
6895         (pthread_attr_getaffinity_np): Likewise.
6896         (pthread_attr_setaffinity_np): Likewise.
6897         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
6898         interface change, keep compatibility code.
6899         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
6900         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
6901         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
6902         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
6903         __pthread_getaffinity_np.
6904         * Versions: Add version for changed interfaces.
6905         * tst-attr3.c: Adjust test for interface change.
6906         * pthread_getattr_np.c: Query the kernel about the affinity mask with
6907         increasing buffer sizes.
6908         * pthread_attr_destroy.c: Remove unused list handling.
6909         * pthread_attr_init.c: Likewise.
6910
6911 2004-03-17  Roland McGrath  <roland@redhat.com>
6912
6913         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
6914         first argument to clock_getres so we ever enable kernel timers.
6915
6916 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
6917
6918         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
6919
6920 2004-03-12  Richard Henderson  <rth@redhat.com>
6921
6922         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
6923         oldvalue from CENABLE to CDISABLE.
6924
6925 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
6926
6927         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
6928         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
6929         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
6930         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
6931
6932 2004-03-11  Richard Henderson  <rth@redhat.com>
6933
6934         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
6935         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
6936         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
6937
6938 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
6939
6940         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
6941         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
6942         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
6943
6944 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
6945
6946         * forward.c (__pthread_cond_broadcast_2_0,
6947         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
6948         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
6949         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
6950
6951 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6952
6953         * sysdeps/sh/tcb-offsets.sym: Add PID.
6954         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
6955         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
6956
6957 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
6958
6959         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
6960         include <sysdep-cancel.h>, vfork is no cancellation point.
6961         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
6962         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
6963         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
6964
6965 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
6966
6967         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
6968         libc_hidden_def.
6969         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
6970         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
6971         Likewise.
6972         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
6973         Likewise.
6974         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
6975         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
6976         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
6977         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
6978         of DO_CALL_VIA_BREAK.  Work around a gas problem.
6979
6980         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
6981         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
6982         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
6983         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
6984         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
6985         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
6986
6987         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
6988         a local register for saving old PID.  Negate PID in parent upon exit.
6989
6990         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
6991         tcb-offsets.h.
6992         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
6993         before syscall, set to the old value in the parent afterwards.
6994         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
6995         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
6996         tcb-offsets.h.
6997         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
6998         before syscall, set to the old value in the parent afterwards.
6999         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
7000         * sysdeps/s390/tcb-offsets.sym: Add PID.
7001
7002         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
7003         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
7004         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
7005         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
7006         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
7007         * sysdeps/sparc/tcb-offsets.sym: Add PID.
7008
7009 2004-03-10  Andreas Schwab  <schwab@suse.de>
7010
7011         * sysdeps/ia64/tcb-offsets.sym: Add PID.
7012         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
7013         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
7014
7015 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
7016
7017         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
7018         * tst-cancel21.c (do_one_test): Likewise.
7019         Reported by Gordon Jin <gordon.jin@intel.com>.
7020
7021 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
7022
7023         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
7024         if non-zero and set to INT_MIN if zero.
7025         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
7026         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
7027         (SAVE_PID, RESTORE_PID): Define.
7028         (__vfork): Use it.
7029         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
7030         Use relative path to avoid including NPTL i386/vfork.S.
7031         (SAVE_PID, RESTORE_PID): Define.
7032         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
7033         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
7034         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
7035         tst-vfork2x.
7036         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
7037         * tst-vfork1.c: New test.
7038         * tst-vfork2.c: New test.
7039         * tst-vfork1x.c: New test.
7040         * tst-vfork2x.c: New test.
7041
7042 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
7043
7044         * sysdeps/i386/tcb-offsets.sym: Add PID.
7045         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7046         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
7047         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
7048
7049 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
7050
7051         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
7052
7053 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
7054
7055         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
7056         _rtld_global_ro.
7057
7058 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
7059
7060         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
7061         _rtld_global_ro.
7062
7063         * tst-once4.c: Remove unnecessary macro definition.
7064
7065         * tst-mutex7.c (do_test): Limit thread stack size.
7066         * tst-once2.c (do_test): Likewise.
7067         * tst-tls3.c (do_test): Likewise.
7068         * tst-tls1.c (do_test): Likewise.
7069         * tst-signal3.c (do_test): Likewise.
7070         * tst-kill6.c (do_test): Likewise.
7071         * tst-key4.c (do_test): Likewise.
7072         * tst-join4.c (do_test): Likewise.
7073         * tst-fork1.c (do_test): Likewise.
7074         * tst-context1.c (do_test): Likewise.
7075         * tst-cond2.c (do_test): Likewise.
7076         * tst-cond10.c (do_test): Likewise.
7077         * tst-clock2.c (do_test): Likewise.
7078         * tst-cancel10.c (do_test): Likewise.
7079         * tst-basic2.c (do_test): Likewise.
7080         * tst-barrier4.c (do_test): Likewise.
7081
7082 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
7083
7084         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
7085
7086 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
7087
7088         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7089         (__pthread_cond_timedwait): Optimize wakeup test.
7090         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7091         (__pthread_cond_wait): Likewise.
7092         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
7093         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7094         Likewise.
7095
7096 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
7097
7098         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7099         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
7100         the atomic instruction needed.
7101         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
7102         (__lll_mutex_lock_wait): Likewise.
7103
7104 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
7105
7106         * Makefile (tests): Add tst-cond14 and tst-cond15.
7107         * tst-cond14.c: New file.
7108         * tst-cond15.c: New file.
7109
7110 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
7111
7112         * sysdeps/pthread/createthread.c (create_thread): Remove use of
7113         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
7114         needs to be implemented differently to be useful.
7115
7116 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
7117
7118         * pthread_attr_setschedparam.c: Don't test priority against limits
7119         here.  Set ATTR_FLAG_SCHED_SET flag.
7120         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
7121         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
7122         from parent thread to child.  If attribute is used and scheduling
7123         parameters are not inherited, copy parameters from attribute or
7124         compute them.  Check priority value.
7125         * pthread_getschedparam.c: If the parameters aren't known yet get
7126         them from the kernel.
7127         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
7128         ATTR_FLAG_POLICY_SET flag for thread.
7129         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
7130         and ATTR_FLAG_POLICY_SET.
7131
7132         * sysdeps/pthread/createthread.c: Use tgkill if possible.
7133
7134         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
7135         fail if stack address hasn't been set.  Just return 0.
7136
7137 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
7138
7139         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
7140         libpthread for the files in this list.
7141         (CFLAGS-tst-unload): Removed.
7142         * tst-unload.c (do_test): Don't use complete path for
7143         LIBPHREAD_SO.
7144
7145         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
7146         tst-_res1mod2.
7147
7148 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
7149
7150         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7151         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
7152         operation per round is needed.
7153         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
7154         (__lll_mutex_lock_wait): Likewise.
7155
7156 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
7157
7158         * tst-cancel9.c (cleanup): Don't print to stderr.
7159
7160 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7161
7162         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
7163
7164 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
7165
7166         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
7167         (__syscall_error_handler2): Call CDISABLE.
7168         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
7169         (__syscall_error_handler2): Call CDISABLE.
7170
7171         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
7172         Release lock before the loop, don't reacquire it.
7173
7174         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
7175
7176 2004-02-19  Andreas Schwab  <schwab@suse.de>
7177
7178         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
7179         Fix last change.
7180
7181 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
7182
7183         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
7184         (pthread_barrier_wait): After wakeup, release lock only when the
7185         last thread stopped using the barrier object.
7186         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
7187         (pthread_barrier_wait): Likewise.
7188         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
7189         Likewise.
7190         * Makefile (tests): Add tst-barrier4.
7191         * tst-barrier4.c: New file.
7192
7193         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7194         (__pthread_cond_timedwait): Perform timeout test while holding
7195         internal lock to prevent wakeup race.
7196         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
7197         * sysdeps/pthread/pthread_cond_timedwait.c
7198         (__pthread_cond_timedwait): Likewise.
7199         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
7200         (__pthread_cond_timedwait): Likewise.
7201
7202 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
7203
7204         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
7205         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
7206         * Makefile (tests): Add tst-rwlock13.
7207         * tst-rwlock13.c: New test.
7208
7209 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
7210
7211         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7212         (__condvar_tw_cleanup): Little optimization.
7213         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
7214
7215 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
7216
7217         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
7218         libpthread as "lib" parameter to SHLIB_COMPAT.
7219         (__novmx_siglongjmp): Fix typo in function name.
7220         (__novmx_longjmp): Fix typo in function name.
7221
7222 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
7223
7224         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
7225         __builtin_expect.
7226
7227         * sysdeps/generic/pt-longjmp.c: Moved to...
7228         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
7229
7230 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
7231
7232         * Makefile (libpthread-routines): Add pt-cleanup.
7233         * pt-longjmp.c: Removed.
7234         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
7235         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
7236         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
7237         Version longjmp, siglongjmp for GLIBC_2.3.4.
7238         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
7239
7240 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
7241
7242         * sysdeps/pthread/pthread_cond_timedwait.c
7243         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
7244         Reuse code.  Add __builtin_expects.
7245
7246         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7247         (__pthread_cond_timedwait): Get internal lock in case timeout has
7248         passed before the futex syscall.
7249         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7250
7251 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
7252
7253         * allocatestack.c: Pretty printing.
7254
7255         * sysdeps/pthread/createthread.c (create_thread): Don't add
7256         CLONE_DETACHED bit if it is not necessary.
7257
7258 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
7259
7260         * pthread_getattr_np.c: Include ldsodefs.h.
7261
7262 2004-01-16  Richard Henderson  <rth@redhat.com>
7263
7264         * allocatestack.c: Don't declare __libc_stack_end.
7265         * init.c (__pthread_initialize_minimal_internal): Likewise.
7266         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
7267
7268 2004-01-15  Richard Henderson  <rth@redhat.com>
7269
7270         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
7271         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
7272         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
7273         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
7274         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
7275         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
7276         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
7277         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
7278
7279 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
7280
7281         * init.c (pthread_functions): Make array const.
7282
7283 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
7284
7285         * allocatestack.c (__make_stacks_executable): Change interface.
7286         Check parameters.  Pass parameter on to libc counterpart.
7287         * pthreadP.h: Change declaration.
7288
7289 2004-01-13  Richard Henderson  <rth@redhat.com>
7290
7291         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
7292         prototype form.
7293         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
7294         Likewise.
7295
7296         * sysdeps/alpha/Makefile: New file.
7297         * sysdeps/alpha/tcb-offsets.sym: New file.
7298         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
7299         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
7300
7301         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
7302         on powerpc version.
7303
7304 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
7305
7306         * Makefile (tests): Add tst-backtrace1.
7307         * tst-backtrace1.c: New test.
7308
7309 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
7310
7311         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
7312         register as second parameter to the REGISTER macro.
7313         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
7314         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
7315         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
7316         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
7317         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
7318         of thread register as second parameter to REGISTER macro in 64 case.
7319
7320 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
7321
7322         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
7323         (CFLAGS-getpid.o): Defined.
7324         (CFLAGS-getpid.os): Defined.
7325
7326 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
7327
7328         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
7329         returned for main thread does not overlap with any other VMA.
7330         Patch by Jakub Jelinek.
7331
7332 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
7333
7334         * tst-raise1.c: Include stdio.h.
7335
7336 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
7337
7338         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
7339         setting with __ASSUME_TGKILL || defined __NR_tgkill.
7340         If pid is 0, set it to selftid.
7341         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
7342         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
7343         != 0, return self->tid without doing a syscall.
7344         * descr.h (struct pthread): Move pid field after tid.
7345
7346         * Makefile (tests): Add tst-raise1.
7347         * tst-raise1.c: New file.
7348
7349 2003-12-23  Roland McGrath  <roland@redhat.com>
7350
7351         * tst-oddstacklimit.c: New file.
7352         * Makefile (tests): Add it.
7353         (tst-oddstacklimit-ENV): New variable.
7354
7355         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
7356         value up to page size for __default_stacksize.
7357
7358 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
7359
7360         * Makefile (tests): Add tst-eintr5.
7361         * tst-eintr5.c: New file.
7362
7363         * eintr.c (eintr_source): Prevent sending signal to self.
7364
7365         * tst-eintr2.c (tf1): Improve error message.
7366
7367 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
7368
7369         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
7370         * sysdeps/unix/sysv/linux/getpid.c: New file.
7371         * pthread_cancel.c: Add comment explaining use of PID field.
7372         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
7373         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
7374         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
7375         temporarily to signal the field must not be relied on and updated
7376         by getpid().
7377         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
7378         temporarily negative.
7379         * sysdeps/unix/sysv/linux/raise.c: Likewise.
7380
7381 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
7382
7383         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
7384         (eintr_source): If ARG != NULL, use pthread_kill.
7385         * tst-eintr1.c: Adjust for this change.
7386         * tst-eintr2.c: Likewise.
7387         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
7388         * tst-eintr3.c: New file.
7389         * tst-eintr4.c: New file.
7390
7391 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
7392
7393         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
7394         if CANCELSTATE_BITMASK is set.
7395         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
7396         Likewise.
7397
7398         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
7399         (tests-reverse): Add tst-cancel23.
7400         * tst-cancel22.c: New test.
7401         * tst-cancel23.c: New test.
7402
7403 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
7404
7405         * tst-eintr1.c: Better error messages.
7406
7407         * Makefile (tests): Add tst-eintr2.
7408         * tst-eintr2.c: New file.
7409
7410 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
7411
7412         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
7413         (CFLAGS-tst-cancelx21.c): Set.
7414         * tst-cancel21.c: New test.
7415         * tst-cancelx21.c: New test.
7416
7417         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
7418         comparison operand.
7419         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
7420         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
7421         * pt-longjmp.c: Include jmpbuf-unwind.h.
7422         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
7423         _JMPBUF_UNWINDS.  Adjust compared pointers.
7424         * init.c (__pthread_initialize_minimal_internal): Initialize
7425         pd->stackblock_size.
7426         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
7427         * sysdeps/alpha/jmpbuf-unwind.h: New file.
7428         * sysdeps/i386/jmpbuf-unwind.h: New file.
7429         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
7430         * sysdeps/s390/jmpbuf-unwind.h: New file.
7431         * sysdeps/sh/jmpbuf-unwind.h: New file.
7432         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
7433         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
7434         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
7435         (_JMPBUF_CFA_UNWINDS): Remove.
7436         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
7437
7438 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
7439
7440         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
7441         (CFLAGS-tst-cancelx20.c): Set.
7442         * tst-cancel20.c: New test.
7443         * tst-cancelx20.c: New test.
7444
7445 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
7446
7447         * init.c (__pthread_initialize_minimal_internal): Don't treat
7448         architectures with separate register stack special here when
7449         computing default stack size.
7450
7451 2003-12-17  Roland McGrath  <roland@redhat.com>
7452
7453         * Makefile (tst-cancelx7-ARGS): New variable.
7454         Reportd by Greg Schafer <gschafer@zip.com.au>.
7455
7456 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
7457
7458         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
7459         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
7460         (tst-stack3-ENV): Set.
7461         ($(objpfx)tst-stack3-mem): New.
7462         * tst-stack3.c: New test.
7463
7464 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
7465
7466         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
7467         Add unwind directives.  Drop unused .regstk directive.
7468         (_fini_EPILOG_BEGINS): Add unwind directives.
7469
7470 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
7471
7472         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
7473         Assume parameter is a pointer.
7474         (lll_futex_wake): Likewise.
7475         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
7476         Likewise.
7477         (lll_futex_wake): Likewise.
7478         Reported by Boris Hu.
7479         * sysdeps/unix/sysv/linux/unregister-atfork.c
7480         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
7481
7482         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
7483
7484 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
7485
7486         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
7487         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
7488         __rtld_lock_initialize for ld.so lock.
7489         Patch in part by Adam Li <adam.li@intel.com>.
7490
7491 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
7492
7493         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
7494         in $(gnulib).  Also, remove stale comment.
7495
7496 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
7497
7498         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
7499         advantage of new syscall stub and optimize accordingly.
7500
7501         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
7502         from SYS_futex, to match expectations of
7503         sysdep.h:DO_INLINE_SYSCALL.
7504         (lll_futex_clobbers): Remove.
7505         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
7506         (lll_futex_wake): Likewise.
7507         (lll_futex_requeue): Likewise.
7508         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
7509         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
7510         Jelinek).
7511         (__lll_mutex_lock): Likewise.
7512         (__lll_mutex_cond_lock): Likewise.
7513         (__lll_mutex_timed_lock): Likewise.
7514         (__lll_mutex_unlock): Likewise.
7515         (__lll_mutex_unlock_force): Likewise.
7516
7517         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
7518         comes before the include of <sysdep.h>.
7519         (THREAD_SELF_SYSINFO): New macro.
7520         (THREAD_SYSINFO): Likewise.
7521         (INIT_SYSINFO): New macro.
7522         (TLS_INIT_TP): Call INIT_SYSINFO.
7523
7524         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
7525
7526         * sysdeps/pthread/createthread.c (create_thread): Use
7527         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
7528         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
7529         THREAD_SELF_SYSINFO instead of open code.
7530         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
7531         (THREAD_SYSINFO): Likewise.
7532
7533         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
7534
7535         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
7536
7537 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
7538
7539         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
7540         instead of .init.  Patch by David Mosberger.
7541
7542 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
7543
7544         * sysdeps/pthread/configure.in: Remove broken declaration in C
7545         cleanup handling check.
7546
7547 2003-11-30  Andreas Jaeger  <aj@suse.de>
7548
7549         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
7550         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
7551         Likewise.
7552
7553 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
7554
7555         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
7556         * pthread_attr_destroy.c: Include shlib-compat.h.
7557         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
7558         is set in iattr->flags.
7559         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
7560
7561 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
7562
7563         * Makefile (distribute): Add tst-cleanup4aux.c.
7564
7565         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
7566         include.
7567
7568 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
7569
7570         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
7571         pthread_cond_signal.
7572
7573         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
7574         store mutex address if the current value is ~0l.
7575         * sysdeps/pthread/pthread_cond_timedwait.c
7576         (__pthread_cond_timedwait): Likewise.
7577         * sysdeps/pthread/pthread_cond_broadcast.c
7578         (__pthread_cond_broadcast): Don't use requeue for pshared
7579         condvars.
7580
7581         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
7582         (__pthread_cond_wait): Don't store mutex address if the current
7583         value is ~0l.
7584         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
7585         (__pthread_cond_timedwait): Likewise.
7586         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
7587         (__pthread_cond_broadcast): Don't use requeue for pshared
7588         condvars.
7589
7590         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
7591         element with ~0l for pshared condvars, with NULL otherwise.
7592
7593         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
7594         (__pthread_cond_wait): Don't store mutex address if the current
7595         value is ~0l.
7596         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
7597         (__pthread_cond_timedwait): Likewise.
7598         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
7599         (__pthread_cond_broadcast): Don't use requeue for pshared
7600         condvars.
7601
7602         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
7603         * tst-cond12.c: New file.
7604         * tst-cond13.c: New file.
7605
7606 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
7607
7608         * sysdeps/pthread/configure.in: Make missing forced unwind support
7609         fatal.
7610
7611 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
7612
7613         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
7614
7615 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
7616
7617         * Makefile: Add magic to clean up correctly.
7618
7619 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
7620
7621         * unwind.c (FRAME_LEFT): Define.
7622         (unwind_stop): Handle old style cleanups here.
7623         (__pthread_unwind): Handle old style cleanups only if
7624         !HAVE_FORCED_UNWIND.
7625         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
7626         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
7627         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
7628         ($(objpfx)tst-cleanupx4): Likewise.
7629         * tst-cleanup4.c: New test.
7630         * tst-cleanup4aux.c: New.
7631         * tst-cleanupx4.c: New test.
7632
7633 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
7634
7635         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
7636         lll_mutex_*lock macros to skip atomic operations on some archs.
7637
7638 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
7639
7640         * sysdeps/pthread/tst-timer.c (main): Initialize
7641         sigev2.sigev_value as well.
7642
7643 2003-10-15  Roland McGrath  <roland@redhat.com>
7644
7645         * sysdeps/pthread/configure.in: Barf if visibility attribute support
7646         is missing.
7647         * sysdeps/pthread/configure: Regenerated.
7648
7649 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7650
7651         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
7652         locking macros.  No distinction between normal and mutex locking
7653         anymore.
7654         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
7655         Merge bits from lowlevelmutex.S we still need.
7656         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
7657         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7658         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
7659         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
7660         new mutex implementation.
7661         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
7662         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7663         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7664         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7665         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7666         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7667         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7668         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7669         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7670         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
7671         symbol for entry point to avoid cancellation.
7672
7673 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
7674
7675         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
7676         changes.
7677         (SAVE_OLDTYPE_0): Fix a typo.
7678
7679 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
7680
7681         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
7682         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
7683
7684 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
7685
7686         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
7687         correct offset.
7688
7689 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
7690
7691         * Makefile (tests): Add tst-cancel19.
7692         * tst-cancel19.c: New test.
7693
7694 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
7695
7696         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
7697         restoring of the old cancellation type.
7698
7699 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
7700
7701         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
7702
7703 2003-09-27  Wolfram Gloger  <wg@malloc.de>
7704
7705         * sysdeps/pthread/malloc-machine.h: New file
7706
7707 2003-09-24  Roland McGrath  <roland@redhat.com>
7708
7709         * allocatestack.c (__make_stacks_executable): Don't ignore return
7710         value from _dl_make_stack_executable.
7711
7712 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
7713
7714         * allocatestack.c (__make_stacks_executable): Also change
7715         permission of the currently unused stacks.
7716
7717         * allocatestack.c (change_stack_perm): Split out from
7718         __make_stacks_executable.
7719         (allocate_stack): If the required permission changed between the time
7720         we started preparing the stack and queueing it, change the permission.
7721         (__make_stacks_executable): Call change_stack_perm.
7722
7723         * Makefile: Build tst-execstack-mod locally.
7724         * tst-execstack-mod.c: New file.
7725
7726 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
7727
7728         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
7729
7730 2003-09-23  Roland McGrath  <roland@redhat.com>
7731
7732         * tst-execstack.c: New file.
7733         * Makefile (tests): Add it.
7734         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
7735         (LDFLAGS-tst-execstack): New variable.
7736
7737         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
7738         whether to use PROT_EXEC for stack mmap.
7739         (__make_stacks_executable): New function.
7740         * pthreadP.h: Declare it.
7741         * init.c (__pthread_initialize_minimal_internal): Set
7742         GL(dl_make_stack_executable_hook) to that.
7743
7744 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
7745
7746         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
7747         recommendation from AMD re avoidance of lock prefix.
7748
7749 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
7750
7751         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
7752         lll_futex_timed_wait instead of lll_futex_wait.
7753         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
7754         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
7755         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
7756         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
7757         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
7758         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
7759         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
7760         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
7761         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
7762         Completely revamp the locking macros.  No distinction between
7763         normal and mutex locking anymore.
7764         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
7765         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
7766         __lll_lock_timedwait): Fix prototypes.
7767         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
7768         __lll_lock_timedwait): Likewise.
7769         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
7770         macros, add __builtin_expect.
7771         (lll_mutex_timedlock): Likewise.  Fix return value.
7772         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
7773         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
7774         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
7775         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
7776         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
7777         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
7778         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
7779         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
7780
7781 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
7782
7783         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7784         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
7785         operation if possible.
7786
7787         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
7788         like jumping over the lock prefix.
7789
7790 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
7791
7792         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
7793         locking macros.  No distinction between normal and mutex locking
7794         anymore.
7795         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7796         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7797         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7798         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
7799         locking.  Merge bits from lowlevelmutex.S we still need.
7800         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7801         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
7802         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
7803         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
7804         * Makefile (routines): Remove libc-lowlevelmutex.
7805         (libpthread-rountines): Remove lowlevelmutex.
7806         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
7807         for new mutex implementation.
7808         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7809         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7810         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7811         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7812         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7813         Likewise.
7814         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7815         Likewise.
7816         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
7817         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7818         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
7819         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7820         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7821         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7822         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7823         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7824         Likewise.
7825         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7826         Likewise.
7827         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
7828         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7829         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7830         Don't use requeue.
7831         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7832         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
7833
7834 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
7835
7836         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
7837         in parameters of asm with output parameters.
7838
7839         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
7840         type of DECR parameter to int.
7841         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
7842
7843 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
7844
7845         * tst-attr3.c (tf, do_test): Print stack start/end/size and
7846         guardsize for each thread.
7847
7848 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
7849
7850         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
7851         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
7852         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
7853
7854         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
7855         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
7856         NULL.
7857         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
7858         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
7859         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
7860         (pthread_getaffinity_np): Add hidden_def.
7861
7862         * Makefile (tests): Add tst-attr3.
7863         * tst-attr3.c: New test.
7864
7865         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
7866
7867 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
7868
7869         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
7870         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
7871
7872 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
7873
7874         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
7875         * tst-align.c: Include tst-stack-align.h.
7876         (tf, do_test): Use TEST_STACK_ALIGN macro.
7877
7878 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
7879
7880         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
7881         variable.
7882
7883 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
7884
7885         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
7886         stack-related values for the initial thread.
7887
7888 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
7889
7890         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
7891
7892 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
7893
7894         * pthread_mutex_lock.c: Minor code rearrangements.
7895
7896 2003-09-05  Roland McGrath  <roland@redhat.com>
7897
7898         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
7899         Instead, include ../nptl_db/db_info.c to do its magic.
7900         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
7901         (__pthread_pthread_key_2ndlevel_size): Likewise.
7902         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
7903         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
7904         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
7905         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
7906         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
7907         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
7908         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
7909         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
7910         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
7911         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
7912         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
7913         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
7914         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
7915         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
7916         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
7917         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
7918         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
7919
7920 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
7921
7922         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
7923         of pthread_t to be compatible with LT.
7924         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
7925         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7926         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7927         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7928         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
7929         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7930         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
7931
7932 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
7933
7934         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
7935
7936 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
7937
7938         * unwind-forcedunwind.c: Move to...
7939         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
7940         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
7941         * sysdeps/pthread/jmpbuf-unwind.h: New file.
7942         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
7943         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
7944         * unwind.c: Include jmpbuf-unwind.h.
7945         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
7946
7947 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
7948
7949         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
7950         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
7951         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
7952         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
7953         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
7954         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
7955         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
7956         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
7957         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
7958         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
7959         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
7960         function.
7961         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
7962         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
7963         * Makefile (tests): Add tst-stack2.
7964         * tst-stack2.c: New test.
7965         * tst-stack1.c: Include limits.h and sys/param.h.
7966         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
7967
7968         * pthread_condattr_setpshared.c: Include errno.h.
7969         (pthread_condattr_setpshared): Return EINVAL if pshared
7970         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
7971
7972         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
7973         defined symbol for entry point to avoid cancellation.
7974         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
7975         Likewise.
7976         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
7977         Likewise.
7978         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
7979         Likewise.
7980         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
7981         Likewise.
7982         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
7983         Likewise.
7984         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
7985         __close_nocancel, __read_nocancel, __write_nocancel,
7986         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
7987         libpthread.so or librt.so, define to corresponding function
7988         without _nocancel suffix.
7989         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
7990         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
7991         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
7992
7993         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
7994
7995 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
7996
7997         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
7998         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
7999
8000         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
8001         in subsections has a symbol associated with it.
8002
8003         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
8004         defined symbol for entry point to avoid cancellation.
8005         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
8006
8007 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
8008
8009         * Makefile (tests): Add tst-tls5.
8010         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
8011         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
8012         ($(objpfx)tst-tls5): New.
8013         ($(objpfx)tst-tls6.out): Likewise.
8014         (tests): Depend on $(objpfx)tst-tls6.out.
8015         * tst-tls3.c: Include stdint.h and pthreaddef.h.
8016         (do_test): Check pthread_self () return value alignment.
8017         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
8018         (tf): Check pthread_self () return value alignment.
8019         * tst-tls5.c: New test.
8020         * tst-tls5.h: New.
8021         * tst-tls5mod.c: New.
8022         * tst-tls5moda.c: New.
8023         * tst-tls5modb.c: New.
8024         * tst-tls5modc.c: New.
8025         * tst-tls5modd.c: New.
8026         * tst-tls5mode.c: New.
8027         * tst-tls5modf.c: New.
8028         * tst-tls6.sh: New test.
8029
8030         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
8031         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
8032         * init.c (pthread_functions): Initialize them.
8033         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
8034         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
8035         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
8036         pthread_cond_timedwait@@GLIBC_2.3.2.
8037
8038 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
8039
8040         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
8041         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
8042         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
8043         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
8044         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
8045         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
8046
8047         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
8048
8049         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
8050         _POSIX_THREAD_PRIORITY_SCHEDULING.
8051         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
8052
8053 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
8054
8055         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
8056         nested function, use static inline function from libio.h.
8057         Code by Richard Henderson.
8058
8059         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
8060         weak.
8061
8062 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
8063
8064         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
8065         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
8066         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
8067         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
8068         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
8069         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
8070         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
8071         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
8072         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
8073         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
8074         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
8075         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
8076         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
8077         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
8078         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
8079         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
8080         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
8081         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
8082         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
8083         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
8084         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
8085         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
8086         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
8087         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
8088         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
8089         * sysdeps/sparc/tls.h: New file.
8090         * sysdeps/sparc/tcb-offsets.sym: New file.
8091         * sysdeps/sparc/Makefile: New file.
8092         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
8093         * init.c [__sparc__] (__NR_set_tid_address): Define.
8094
8095 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
8096
8097         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
8098         _IO_release_lock): Define.
8099
8100 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
8101
8102         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
8103         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
8104
8105 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
8106
8107         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
8108         (__pthread_cleanup_class): Add missing return types of member
8109         functions.
8110
8111 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
8112
8113         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
8114         (lll_mutex_unlock_force): Add memory barrier between store and futex
8115         syscall.
8116
8117 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
8118
8119         * tst-cancel4.c (do_test): Also unlink tempfname and remove
8120         tempmsg in first loop.
8121
8122 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
8123
8124         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8125         _POSIX_THREAD_PRIORITY_SCHEDULING.
8126         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8127
8128 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
8129
8130         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
8131         (__rtld_lock_default_lock_recursive,
8132         __rtld_lock_default_unlock_recursive): Define.
8133         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
8134         __rtld_lock_unlock_recursive): Define using
8135         GL(_dl_rtld_*lock_recursive).
8136         * init.c (__pthread_initialize_minimal_internal): Initialize
8137         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
8138         Lock GL(_dl_load_lock) the same number of times as
8139         GL(_dl_load_lock) using non-mt implementation was nested.
8140
8141         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
8142         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
8143
8144 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
8145
8146         * tst-cancel17.c (do_test): Make len2 maximum of page size and
8147         PIPE_BUF.
8148
8149 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
8150
8151         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
8152
8153 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
8154
8155         * sysdeps/pthread/createthread.c (do_clone): Move error handling
8156         to first syscall error check.  Move syscall error check for tkill
8157         into __ASSUME_CLONE_STOPPED #ifdef.
8158
8159 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
8160
8161         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
8162         is not defined, do explicit synchronization.
8163         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
8164         is not defined also unlock pd->lock for non-debugging case in case
8165         it is necessary.
8166         * pthread_create.c (start_thread): Always get and release pd->lock
8167         if __ASSUME_CLONE_STOPPED is not defined.
8168         (start_thread_debug): Removed.  Adjust users.
8169         * allocatestack.c (allocate_stack): Always initialize lock if
8170         __ASSUME_CLONE_STOPPED is not defined.
8171         * Makefile (tests): Add tst-sched1.
8172         * tst-sched1.c: New file.
8173
8174         * sysdeps/pthread/createthread.c (do_clone): Only use
8175         sched_setschduler and pass correct parameters.
8176
8177 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
8178
8179         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
8180         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
8181         PTHREAD_STACK_MIN in comments.
8182
8183 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
8184
8185         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8186         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
8187         argument.
8188         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
8189         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
8190         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
8191         (__pthread_cleanup_upto): Fix prototype.
8192         (_longjmp_unwind): Adjust caller.
8193         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
8194         Change second argument to const struct pointer.
8195         * tst-sem8.c (main): Remove unused s2 and s3 variables.
8196         * tst-sem9.c (main): Likewise.
8197         * unwind.c: Include string.h for strlen prototype.
8198
8199 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
8200
8201         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8202         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
8203         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
8204         Define HAVE_CMOV.
8205         Patch by Nicholas Miell <nmiell@attbi.com>.
8206
8207 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
8208
8209         * init.c (__pthread_initialize_minimal_internal): Initialize
8210         GL(dl_init_static_tls).
8211         * pthreadP.h (__pthread_init_static_tls): New prototype.
8212         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
8213         New functions.
8214         * Makefile (tests): Add tst-tls4.
8215         (modules-names): Add tst-tls4moda and tst-tls4modb.
8216         ($(objpfx)tst-tls4): Link against libdl and libpthread.
8217         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
8218         tst-tls4modb.so.
8219         * tst-tls4.c: New file.
8220         * tst-tls4moda.c: New file.
8221         * tst-tls4modb.c: New file.
8222
8223 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
8224
8225         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
8226         before __timer_dealloc.
8227         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
8228         Don't call list_unlink.
8229
8230 2003-07-29  Roland McGrath  <roland@redhat.com>
8231
8232         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
8233
8234 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
8235
8236         * tst-cancel17.c (do_test): Check if aio_cancel failed.
8237         Don't reuse struct aiocb A if it failed.
8238         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
8239         not just one byte, as that does not block.
8240
8241 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
8242
8243         * sysdeps/pthread/unwind-resume.c: New file.
8244         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
8245         unwind-resume in csu subdir.
8246         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
8247         exceptions.
8248         (librt-sysdep_routines, librt-shared-only-routines): Add
8249         rt-unwind-resume.
8250         * sysdeps/pthread/rt-unwind-resume.c: New file.
8251         * unwind-forcedunwind.c: New file.
8252         * Makefile (libpthread-routines): Add unwind-forcedunwind.
8253         (libpthread-shared-only-routines): Likewise.
8254         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
8255         * pthreadP.h (pthread_cancel_init): New prototype.
8256         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
8257
8258         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
8259         attr argument const struct pthread_attr *.
8260
8261         * res.c (__res_state): Return __resp.
8262         * descr.h: Include resolv.h.
8263         (struct pthread): Add res field.
8264         * pthread_create.c: Include resolv.h.
8265         (start_thread): Initialize __resp.
8266         * Makefile (tests): Add tst-_res1.
8267         (module-names): Add tst-_res1mod1, tst-_res1mod2.
8268         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
8269         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
8270         libpthread.
8271         * tst-_res1.c: New file.
8272         * tst-_res1mod1.c: New file.
8273         * tst-_res1mod2.c: New file.
8274
8275 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
8276
8277         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
8278
8279         * Makefile: Define various *-no-z-defs variables for test DSOs
8280         which has undefined symbols.
8281
8282 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
8283
8284         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
8285         Retry if the stwcx fails to store once_control.
8286
8287 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
8288
8289         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
8290         pthread_attr_setaffinity.
8291         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
8292         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
8293         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
8294         * pthread_attr_destroy.c: Free cpuset element if allocated.
8295         * pthread_create.c: Pass iattr as additional parameter to
8296         create_thread.
8297         * sysdeps/pthread/createthread.c: If attribute is provided and
8298         a new thread is created with affinity set or scheduling parameters,
8299         start thread with CLONE_STOPPED.
8300         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
8301         pthread_attr_setaffinity.
8302         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
8303         cpuset element.
8304
8305 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
8306
8307         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
8308
8309 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
8310
8311         * sysdeps/pthread/configure.in: Require CFI directives also for
8312         ppc and s390.
8313
8314 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
8315
8316         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
8317         Add cfi directives.
8318
8319 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8320
8321         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
8322         CLEANUP_JMP_BUF.
8323         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
8324         registers as variables.  Call __pthread_mutex_unlock_usercnt.
8325         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8326         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
8327         not self pointer in __writer.  Compare with TID to determine
8328         deadlocks.
8329         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8330         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
8331         Likewise.
8332         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
8333         Likewise.
8334         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
8335         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8336         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
8337         macros also when compiling librt.
8338
8339 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
8340
8341         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
8342         -fasynchronous-unwind-tables.
8343         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
8344         (PSEUDO): Add cfi directives.
8345         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
8346         Likewise.
8347         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
8348         Likewise.
8349
8350 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
8351
8352         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
8353         __pthread_unregister_cancel): Add prototypes and hidden_proto.
8354         * unwind.c (__pthread_unwind_next): Add hidden_def.
8355         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
8356         Likewise.
8357         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
8358         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
8359         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
8360         Likewise.
8361         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
8362         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
8363         Likewise.
8364         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
8365         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
8366         __pthread_unregister_cancel and __pthread_unwind_next.
8367
8368 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
8369
8370         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
8371         different symbol for the cancellation syscall wrapper and
8372         non-cancellation syscall wrapper.
8373         (PSEUDO_END): Define.
8374
8375 2003-07-05  Richard Henderson  <rth@redhat.com>
8376
8377         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
8378         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
8379         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
8380         return actual return value from the syscall, not 0.
8381
8382 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
8383
8384         * descr.h (struct pthread): Add pid field.
8385         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
8386         (__reclaim_stacks): Likewise.
8387         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
8388         also check for PID of the signal source.
8389         (__pthread_initialize_minimal_internal): Also initialize pid field
8390         of initial thread's descriptor.
8391         * pthread_cancel.c: Use tgkill instead of tkill if possible.
8392         * sysdeps/unix/sysv/linux/fork.c: Likewise.
8393         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
8394         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8395         * sysdeps/unix/sysv/linux/raise.c: Likewise.
8396
8397 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
8398
8399         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
8400         Fix use of parameter.
8401         (__libc_cleanup_pop): Likewise.
8402
8403 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
8404
8405         * init.c (sigcancel_handler): Change parameters to match handler
8406         for SA_SIGACTION.  Check signal number and code to recognize
8407         invalid invocations.
8408
8409 2003-07-03  Roland McGrath  <roland@redhat.com>
8410
8411         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
8412         Apply sizeof (struct pthread) bias to r13 value.
8413
8414 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
8415
8416         * sysdeps/pthread/configure.in: Require CFI directives.
8417
8418         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
8419         definition.
8420         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
8421         libpthread compilation.
8422         * unwind.c (__pthread_unwind): Add hidden_def.
8423         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
8424
8425 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
8426
8427         * libc-cancellation.c (__libc_cleanup_routine): Define.
8428         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
8429         (__pthread_cleanup_pop): Define.
8430
8431 2003-07-01  Richard Henderson  <rth@redhat.com>
8432
8433         * sysdeps/alpha/elf/pt-initfini.c: New file.
8434         * sysdeps/alpha/pthread_spin_lock.S: New file.
8435         * sysdeps/alpha/pthread_spin_trylock.S: New file.
8436         * sysdeps/alpha/pthreaddef.h: New file.
8437         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
8438         * sysdeps/alpha/tls.h: New file.
8439         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
8440         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
8441         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
8442         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
8443         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
8444         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
8445         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
8446         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
8447         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
8448         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
8449
8450 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
8451
8452         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
8453         cleanup support and unwind info.
8454
8455 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
8456
8457         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
8458         Use correct cleanup handler registration.  Add unwind info.
8459         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
8460         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
8461         * tst-once3.c: Add cleanup handler and check it is called.
8462         * tst-once4.c: Likewise.
8463         * tst-oncex3.c: New file.
8464         * tst-oncex4.c: New file.
8465         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
8466
8467 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
8468
8469         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
8470
8471 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
8472
8473         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
8474         (tf_msgsnd): Likewise.
8475
8476         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
8477         premature returns a bit more.
8478
8479 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
8480
8481         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
8482         definition to the front.
8483
8484         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
8485         the cleanup functions to make the names unique.  Fix dwarf opcode
8486         un unwind table.
8487         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
8488         functions to make the names unique.  Fix CFA offset for two blocks.
8489
8490 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
8491
8492         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
8493         missing closing braces.
8494         Patch by Christophe Saout <christophe@saout.de>.
8495
8496 2003-06-24  Roland McGrath  <roland@redhat.com>
8497
8498         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
8499
8500 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
8501
8502         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
8503         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
8504
8505         * pthreadP.h: Declare __find_thread_by_id.
8506         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
8507         * pthread_clock_gettime.c: Allow using other thread's clock.
8508         * pthread_clock_settime.c: Likewise.
8509         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8510         * Makefile: Add rules to build and run tst-clock2.
8511         * tst-clock2.c: New file.
8512
8513 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
8514
8515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
8516         to use exception-based cleanup handler.
8517         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8518
8519         * tst-cond8.c (ch): Announce that we are done.
8520
8521         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
8522
8523         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
8524         Also test aio_suspend with timeout value.
8525
8526 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
8527
8528         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
8529         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
8530         attribute_hidden.
8531
8532         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
8533         (__pthread_mutex_lock_internal): Likewise.
8534         (__pthread_mutex_unlock_internal): Likewise.
8535         (__pthread_mutex_unlock_usercnt): Declare.
8536         * pthread_mutex_destroy.c: Always fail if used in any way.
8537         * pthread_mutex_init.c: Update comment.
8538         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
8539         * pthread_mutex_timedlock.c: Adjust __nusers.
8540         * pthread_mutex_trylock.c: Adjust __nusers.
8541         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
8542         and public interfaces are wrapper with pass additional parameter.
8543         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
8544         parameter zero.
8545         * tst-mutex8.c: New file.
8546         * Makefile (tests): Add tst-mutex8.
8547         * sysdeps/pthread/pthread_cond_timedwait.c: Call
8548         __pthread_mutex_unlock_usercnt.
8549         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
8550         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8551         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8552         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8553         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8554         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
8555         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
8556         Add __nusers.
8557         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8558         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8559         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8560         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8561         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
8562
8563         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
8564         * pthread_mutex_timedlock.c: Likewise.
8565         * pthread_mutex_trylock.c: Adjust __nusers.
8566         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
8567         * tst-mutex9.c: New file.
8568         * Makefile (tests): Add tst-mutex9.
8569         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
8570         * sysdeps/ia64/tls.h: Likewise.
8571         * sysdeps/powerpc/tls.h: Likewise.
8572         * sysdeps/s390/tls.h: Likewise.
8573         * sysdeps/sh/tls.h: Likewise.
8574         * sysdeps/x86_64/tls.h: Likewise.
8575         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
8576         Change type of __owner.
8577         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8578         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8579         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8580         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8581         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
8582
8583 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
8584
8585         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
8586         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
8587
8588         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
8589         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
8590         instead of nr to lll_futex_wake.  Only set errno and return -1
8591         if err < 0.
8592
8593         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
8594         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
8595         return actual return value from the syscall, not 0.
8596
8597 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
8598
8599         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
8600         find a random value.
8601         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
8602         errno==EIDRM.
8603
8604         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
8605         compat_timer_settime.
8606         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
8607         compat_timer_gettime.
8608         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
8609         compat_timer_getoverrun.
8610         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
8611         compat_timer_delete.
8612
8613         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
8614         error-checking mutex detect busy mutexes.
8615
8616 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
8617
8618         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
8619         Add ax to clobber list.
8620         (lll_mutex_cond_lock): Likewise.
8621         (lll_mutex_unlock): Likewise.
8622         (lll_lock): Likewise.
8623         (lll_unlock): Likewise.
8624
8625         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
8626         * tst-cancel18.c: New file.
8627         * tst-cancelx18.c: New file.
8628
8629         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
8630         and tcdrain.
8631
8632         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
8633         * tst-cancel17.c: New file.
8634         * tst-cancelx17.c: New file.
8635
8636         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
8637         * sysdeps/unix/sysv/linux/sigwait.c: New file.
8638         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
8639
8640         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
8641
8642 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
8643
8644         * sysdeps/pthread/createthread.c (create_thread): Set
8645         header.multiple_threads unconditionally.
8646         * allocatestack.c (allocate_stack): Likewise.
8647         * descr.h (struct pthread): Add header.multiple_threads
8648         unconditionally.
8649         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
8650         Define for librt.  #error if neither libpthread, libc nor librt.
8651         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
8652         Likewise.
8653         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
8654         CDISABLE): Likewise.
8655         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
8656         CDISABLE): Likewise.
8657         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
8658         CDISABLE): Likewise.
8659         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
8660         CDISABLE): Likewise.  Access header.multiple_threads outside of
8661         libc and libpthread.
8662         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
8663         Likewise.
8664         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
8665         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
8666
8667 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
8668
8669         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
8670         Also test early cancellation before the thread reaches the cancellation
8671         point.
8672
8673         * Makefile: Compile forward.c with exceptions.
8674
8675         * sysdeps/unix/sysv/linux/sleep.c: New file.
8676
8677 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
8678
8679         * Makefile: Add CFLAGS definition to compile function wrappers
8680         duplicated from libc with exceptions.
8681         * tst-cancel4.c: Also check cancellation handlers.
8682
8683         * Makefile: Add rules to build and run tst-cancel16 and
8684         tst-cancelx16.  Add missing CFLAGS definitions.
8685         * tst-cancel16.c: New file.
8686         * tst-cancelx16.c: New file.
8687
8688 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
8689
8690         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
8691         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
8692         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
8693         (DL_SYSINFO_IMPLEMENTATION): Likewise.
8694
8695         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
8696         (LIBC_CANCEL_RESET): Likewise.
8697         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
8698         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
8699         librt-cancellation.
8700         (CFLAGS-libcrt-cancellation.c): Define.
8701         * sysdeps/pthread/librt-cancellation.c: New file.
8702         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
8703         macros also when compiling librt.
8704         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
8705         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
8706         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
8707         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
8708         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
8709         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
8710         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
8711
8712         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
8713         compat_timer_create.
8714
8715 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
8716
8717         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
8718
8719         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
8720         __register_atfork.
8721         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
8722         Add libc_hidden_def.
8723
8724 2003-06-13  Roland McGrath  <roland@redhat.com>
8725
8726         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
8727         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
8728
8729 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
8730
8731         * allocatestack.c (queue_stack): Always inline.
8732         * ptreadhP.h (__do_cancel): Likewise.
8733
8734 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
8735
8736         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
8737         a typo.
8738
8739 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
8740
8741         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8742         (__pthread_cond_signal): Remove incorrect second addition for
8743         cond_lock!=0.
8744
8745 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
8746
8747         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8748         (__pthread_cond_signal): Use correct futex pointer in
8749         __lll_mutex_lock_wait call.
8750
8751         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8752         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
8753
8754 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
8755
8756         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
8757         cancelable.
8758         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
8759         Likewise.
8760
8761         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
8762         hand-written CFI generation code.  Since ENTRY/END also initiated
8763         CFI frames this caused two CFI sets to be generated.
8764
8765 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
8766
8767         * cleanup_routine.c: New file.
8768         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
8769         * sysdeps/pthread/pthread.h: Add support for fully exception-based
8770         cleanup handling.
8771         * Makefile (libpthread-routines): Add cleanup_routine.
8772         Add more CFLAGS variables to compile with exceptions.  Add comments
8773         why which file needs unwind tables.
8774         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
8775         tests.
8776         * tst-cancelx1.c: New file.
8777         * tst-cancelx2.c: New file.
8778         * tst-cancelx3.c: New file.
8779         * tst-cancelx4.c: New file.
8780         * tst-cancelx5.c: New file.
8781         * tst-cancelx6.c: New file.
8782         * tst-cancelx7.c: New file.
8783         * tst-cancelx8.c: New file.
8784         * tst-cancelx9.c: New file.
8785         * tst-cancelx10.c: New file.
8786         * tst-cancelx11.c: New file.
8787         * tst-cancelx12.c: New file.
8788         * tst-cancelx13.c: New file.
8789         * tst-cancelx14.c: New file.
8790         * tst-cancelx15.c: New file.
8791         * tst-cleanupx0.c: New file.
8792         * tst-cleanupx0.expect: New file.
8793         * tst-cleanupx1.c: New file.
8794         * tst-cleanupx2.c: New file.
8795         * tst-cleanupx3.c: New file.
8796
8797         * tst-cleanup0.c: Make standard compliant.
8798         * tst-cleanup1.c: Likewise.
8799
8800         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
8801         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8802         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8803         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8804         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8805         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8806         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
8807         CLEANUP_JMP_BUF.
8808         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
8809         * tst-cancel12.c: New file.
8810         * tst-cancel13.c: New file.
8811         * tst-cancel14.c: New file.
8812         * tst-cancel15.c: New file.
8813         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
8814         and tst-cancel15.
8815
8816         * tst-cancel1.c: Add some comments.
8817
8818         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
8819         timeout correctly.
8820
8821 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
8822
8823         * Makefile (CFLAGS-pthread_cancel.c): Define.
8824
8825 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
8826
8827         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
8828         Change type of __writer element to int.
8829         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8830         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8831         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8832         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8833         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
8834         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
8835         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
8836         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
8837         Compare with TID to determine deadlocks.
8838         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8839         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8840         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
8841         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8842         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8843         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8844         Likewise.
8845         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8846         Likewise.
8847         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8848         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8849         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
8850         Likewise.
8851         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
8852         Likewise.
8853         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8854         * Makefile (tests): Add tst-rwlock12.
8855         * tst-rwlock12.c: New file.
8856
8857 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
8858
8859         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
8860         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
8861         Remove bogus hidden_proto.
8862         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8863         Likewise.
8864         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
8865         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
8866         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
8867         ___lll_mutex_timedlock): Likewise.
8868
8869 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
8870
8871         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8872         (__pthread_cond_signal): Add some code to eventually handle
8873         cond_lock!=0.
8874
8875 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
8876
8877         * Makefile (tests): Add tst-exec4.
8878         (tst-exec4-ARGS): Define.
8879         * tst-exec4.c: New file.
8880
8881 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
8882
8883         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8884         Also fail if tv_nsec < 0.
8885         (__lll_timedwait_tid): Likewise.
8886         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
8887         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
8888         Likewise.
8889         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
8890         Likewise.
8891         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
8892         Likewise.
8893         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
8894         Likewise.
8895         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
8896         Likewise.
8897         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
8898         Likewise.
8899
8900         * Makefile (tests): Add tst-sem8 and tst-sem9.
8901         * tst-sem8.c: New file.
8902         * tst-sem9.c: New file.
8903         * sem_open.c: Fix creation of in_use record if the file exists but
8904         no internal record.
8905
8906         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
8907         definitions.
8908
8909         * sysdeps/pthread/timer_create.c (timer_create): In case
8910         evp==NULL, assign timer ID to sival_ptr.
8911
8912         * descr.h (struct pthread_unwind_buf): Change type of prev element to
8913         struct pthread_unwind_buf *.
8914         (struct pthread): Likewise for cleanup_jmp_buf element.
8915
8916         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
8917         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
8918         * unwind.c (__pthread_unwind_next): Likewise.
8919
8920 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
8921
8922         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8923         (lll_futex_timed_wait): Use int for futex value parameter.
8924         (lll_futex_wake): Likewise.
8925         (lll_futex_requeue): Likewise.
8926
8927         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8928         Replace one memory operation with one register operation.
8929
8930         * tst-join4.c (do_test): Fix error message.
8931
8932         * tst-rwlock6.c (do_test): Use correct format specifier.
8933
8934         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8935         (__lll_mutex_lock_wait): Replace one memory operation with one
8936         register operation.
8937         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
8938         (__lll_mutex_lock_wait): Likewise.
8939
8940         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8941         (__lll_mutex_cond_lock): Add one to value parameter of
8942         __lll_lock_wait to reflect reality in the futex syscall.
8943         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
8944         (lll_mutex_cond_lock): Likewise.
8945
8946 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
8947
8948         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
8949         New function.
8950         (lll_mutex_cond_lock): Define.
8951
8952 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
8953
8954         * Makefile (tests): Add tst-signal6.
8955         * tst-signal6.c: New file.
8956
8957         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
8958         (__lll_mutex_unlock_force): New function
8959         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
8960
8961         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8962         (__lll_mutex_unlock_force): New function.
8963         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
8964
8965         * tst-rwlock7.c (do_test): Use correct format specifier.
8966
8967         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
8968         Find break parameter in correct asm argument.
8969
8970 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
8971
8972         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
8973         Remove out4.
8974         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
8975         error occured.
8976         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
8977         Add __mutex.
8978         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
8979         lll_futex_requeue, lll_mutex_unlock_force): Define.
8980
8981 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
8982
8983         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
8984         (pthread_cond_t): Add __mutex.
8985         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
8986         lll_futex_requeue, lll_mutex_unlock_force): Define.
8987
8988 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8989
8990         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
8991         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
8992         Add __mutex field.
8993         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
8994         Define.
8995         (lll_futex_wait, lll_futex_wake): Define.
8996         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
8997         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
8998         FUTEX_REQUEUE instead of FUTEX_WAIT.
8999         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
9000         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
9001         mutex which was used in condvar structure.  Call
9002         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
9003         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
9004
9005         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
9006         include tcb-offsets.h.  Read wakeup value in locked region.
9007         Use the value of gbr register as THREAD_ID.
9008         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
9009         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
9010         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
9011
9012         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
9013         macros.
9014
9015 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
9016
9017         * sysdeps/pthread/pthread_cond_broadcast.c
9018         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
9019
9020 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
9021
9022         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
9023         typo in register name.
9024         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
9025         correctly.  Actually use requeue.  Little optimization.
9026         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
9027         mutex address early.  Handle cancellation state as 32-bit value.
9028         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
9029         Remove unnecessary label.
9030
9031 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
9032
9033         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
9034         instead of FUTEX_WAIT.
9035         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
9036         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9037         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9038         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
9039         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
9040         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
9041         used in condvar structure.  Call __pthread_mutex_cond_lock instead
9042         of __pthread_mutex_lock_internal.
9043         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9044         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
9045         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
9046         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
9047         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9048         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
9049         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
9050         Add pthread_mutex_cond_lock.
9051         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
9052         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
9053         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
9054         lll_mutex_cond_lock.
9055         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
9056         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
9057         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9058         Add __mutex field.
9059         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
9060         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9061
9062         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
9063         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
9064
9065         * pthreadP.h: Declare __pthread_mutex_cond_lock.
9066         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
9067         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
9068         macro don't define aliases.
9069
9070         * cancellation.c: Remove __pthread_enable_asynccancel_2.
9071         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
9072         * sysdeps/pthread/pthread_cond_timedwait.c: Use
9073         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
9074         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9075         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
9076         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
9077         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9078         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
9079
9080 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
9081
9082         * sem_open.c: Fix one endless loop.  Implement correct semantics
9083         wrt opening the same semaphore more then once.
9084         * sem_close.c: Adjust for sem_open change.
9085         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
9086         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
9087         * Makefile (tests): Add tst-sem7.
9088         * tst-sem7.c: New file.
9089
9090 2003-05-16  Roland McGrath  <roland@redhat.com>
9091
9092         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
9093         uninitialized variable braino.
9094
9095 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
9096
9097         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
9098         test for syscall availability.
9099
9100         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
9101         __no_posix_timers to -1 if the syscalls don't exist.
9102
9103         * pthread_join.c (pthread_join): Set tid field of the joined
9104         thread to -1.  This isn't necessary but helps to recognize some
9105         error conditions with almost no cost.
9106
9107         * allocatestack.c (FREE_P): Also negative values indicate an
9108         unused stack.
9109
9110         * unwind.c: Include <unistd.h>.
9111
9112 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
9113
9114         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
9115
9116 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
9117
9118         * Makefile (crti-objs, crtn-objs): New variables.
9119         (omit-deps, extra-objs): Add crtn.
9120         ($(objpfx)libpthread.so): Depend on both crti and crtn
9121         and links to them in multidir.
9122         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
9123
9124 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
9125
9126         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
9127         (lll_mutex_unlock): Use atomic_exchange_rel.
9128
9129 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
9130
9131         * cond-perf.c (cons): Add missing locking around setting of alldone.
9132
9133 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
9134
9135         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
9136         related macros.
9137         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
9138
9139 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
9140
9141         * tst-sem6.c: New file.
9142         * Makefile (tests): Add tst-sem6.
9143
9144         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
9145         Use atomic_exchange_rel instead of atomic_exchange.
9146         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
9147         Likewise.
9148
9149         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
9150         code for lll_futex_wait and lll_futex_wake in static apps.  Use
9151         vsyscall is possible.
9152
9153         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
9154         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
9155         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
9156         pthread_setaffinity_np.
9157         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
9158         and pthread_setaffinity_np.
9159         * Makefile (libpthread-routines): Add pthread_getaffinity and
9160         pthread_setaffinity.
9161
9162         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
9163         use it in case mmap to allocate the stack fails.
9164         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
9165         ARCH_MAP_FLAGS here.
9166         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
9167         ARCH_RETRY_MMAP.
9168
9169 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
9170
9171         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
9172         handler implementation.  It is now lockless in fork().
9173         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
9174         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
9175         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
9176         declare the __fork_*_lists.
9177         (struct fork_handler): Include pointers to all three functions.
9178         Add next, refcntr and need_signal elements.
9179         (__fork_handlers): New declaration.
9180         (__register_atfork_malloc): Remove declaration.
9181         (HAVE_register_atfork_malloc): Remove definition.
9182         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
9183         __pthread_child_handler variable.
9184         (__libc_pthread_init): Use __register_atfork instead of explicitly
9185         adding to the list.
9186         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
9187         and lll_futex_wake.
9188         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
9189
9190         * unwind.c (unwind_cleanup): Print error message and then abort.  This
9191         function must never be reached.
9192
9193         * cond-perf.c: New file.
9194
9195 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
9196
9197         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
9198
9199 2003-05-04  Roland McGrath  <roland@redhat.com>
9200
9201         * Makefile ($(objpfx)../libc.so): New target.
9202
9203 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
9204
9205         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
9206         (pthread_condattr_t): Size is only an int, don't use long for
9207         alignment.
9208         (pthread_mutexattr_t): Likewise.
9209         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
9210         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
9211         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
9212
9213 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
9214
9215         * sysdeps/i386/tls.h: Define THREAD_ID.
9216         * sysdeps/ia64/tls.h: Likewise.
9217         * sysdeps/powerpc/tls.h: Likewise.
9218         * sysdeps/s390/tls.h: Likewise.
9219         * sysdeps/sh/tls.h: Likewise.
9220         * sysdeps/x86_64/tls.h: Likewise.
9221         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
9222         record ownership.
9223         * pthread_mutex_timedlock.c: Likewise.
9224         * pthread_mutex_trylock.c: Likewise.
9225         * pthread_mutex_unlock.c: Likewise.
9226         * pthread_rwlock_trywrlock.c: Likewise.
9227         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
9228         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9229         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9230         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9231
9232         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
9233         flag.
9234
9235 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
9236
9237         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
9238         (__SIZEOF_PTHREAD_COND_T): Define to 48.
9239         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
9240         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
9241         Make __align long long instead of long.
9242         (pthread_rwlock_t): Formatting.
9243         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
9244         (pthread_rwlock_t): Formatting.
9245         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
9246         (pthread_cond_t): Make __align long long instead of long.
9247         (pthread_rwlock_t): Move __flags field to the same position as in
9248         linuxthreads.
9249
9250 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
9251
9252         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
9253         * tst-rwlock7.c (do_test): Likewise.
9254
9255 2003-04-26  Roland McGrath  <roland@redhat.com>
9256
9257         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
9258
9259 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
9260
9261         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
9262         sizeof (struct pthread).
9263         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
9264         1 struct pthread.
9265         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
9266         to 0.
9267         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
9268         struct pthread.
9269         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
9270         to 32-bit bytes.
9271         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
9272         tcbp.
9273         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
9274         unneccessarily.
9275         (NO_TLS_OFFSET): Define.
9276         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
9277         add TLS_TCB_SIZE unnecessarily.
9278
9279 2003-04-22  Roland McGrath  <roland@redhat.com>
9280
9281         * Makeconfig (shared-thread-library): Reverse link order to work
9282         around linker bug.
9283
9284 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
9285
9286         * semaphore.h: Fix typo in comment.
9287
9288 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
9289
9290         * sysdeps/pthread/sigfillset.c: New file.
9291
9292         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
9293         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
9294         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
9295         * sysdeps/pthread/sigaction.c: Likewise.
9296         * sysdeps/pthread/sigprocmask.c: New file.
9297         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
9298         __SIGRTMIN+1.
9299         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
9300         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
9301         in this case.
9302
9303 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
9304
9305         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9306         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
9307
9308         * sysdeps/unix/sysv/linux/unregister-atfork.c
9309         (__unregister_atfork): Don't free memory not allocated dynamically.
9310
9311         * semaphore.h: Remove __THROW marker from cancellation points.
9312         * nptl/sysdeps/pthread/pthread.h: Likewise.
9313
9314 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
9315
9316         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
9317         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
9318         __THROW.
9319
9320 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
9321
9322         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
9323
9324 2003-04-15  Roland McGrath  <roland@redhat.com>
9325
9326         * forward.c (__pthread_unwind): Tweak to avoid warning.
9327
9328 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
9329
9330         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
9331
9332 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
9333
9334         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
9335         overflow CFA advance instructions.
9336         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
9337
9338 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
9339
9340         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
9341         * sysdeps/i386/pthread_spin_lock.c: Likewise.
9342         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
9343         defined.
9344
9345         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
9346         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
9347         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
9348         DW_CFA_advance_loc for .Laddl-.Lsubl.
9349
9350 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
9351
9352         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
9353         position-independent unwind data for static libraries.
9354         Add missing unwind info.  Add comments.
9355
9356         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
9357         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
9358         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9359         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9360
9361 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
9362
9363         * Makefile: Make sure all cancellation points are compiled with
9364         exception and asynchronous unwind tables.
9365
9366         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
9367         which mishandles loading of global object addresses in PIC.
9368         (THREAD_SETMEM_NC): Likewise.
9369
9370 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
9371
9372         * pthread.h: Define new data structure for cleanup buffer.  Declare
9373         new cleanup handler interfaces.
9374         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
9375         (struct pthread): Add cleanup_jmp_buf pointer.  Define
9376         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
9377         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
9378         it.  Declare old cleanup handler installation functions.
9379         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
9380         handling.
9381         * cleanup_defer.c: Likewise.
9382         * cleanup_compat.c: New file.  Old cleanup code.
9383         * cleanup_def_compat.c: New file.  Old cleanup code.
9384         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
9385         if own thread descriptor.
9386         * unwind.c: New file.
9387         * forward.c: Add __pthread_unwind.
9388         * init.c (pthread_functions): Add __pthread_unwind.
9389         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
9390         Add ptr___pthread_unwind.
9391         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
9392         and unwind function.
9393         * Makefile (libpthread-routines): Add cleanup_compat,
9394         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
9395         table generation if necessary.
9396         * version.c: Record whether unwind support is compiled in.
9397         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
9398         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
9399         handler interfaces.
9400         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
9401         complication to generate unwind information for syscall wrappers.
9402         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
9403         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
9404         __cleanup_fct_attribute.
9405
9406         * Makefile: Add rules to build and run tst-cleanup0.
9407         * tst-cleanup0.c: New file.
9408         * tst-cleanup0.expect: New file.
9409
9410         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
9411         caller.  Optimize to avoid often unecessary local variable.
9412
9413 2003-04-11  Roland McGrath  <roland@redhat.com>
9414
9415         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
9416         sets variable `multidir'; include that.
9417         (generated): Add it.
9418         ($(objpfx)$(multidir)/crti.o): New target.
9419         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
9420
9421 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
9422
9423         * tst-attr2.c (do_test): Add cast to avoid warning.
9424         * tst-mutex4.c (do_test): Likewise.
9425
9426 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
9427
9428         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
9429         in child.
9430
9431 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
9432
9433         * Makefile (tests): Add tst-detach1.
9434         * tst-detach1.c: New file.
9435
9436 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
9437
9438         * sysdeps/pthread/pthread.h: Remove duplicate
9439         pthread_cleanup_{push,pop} definitions.
9440
9441         * tst-barrier2.c: Eliminate warnings.
9442         * tst-cancel4.c: Likewise.
9443         * tst-cond4.c: Likewise.
9444         * tst-cond6.c: Likewise.
9445         * tst-detach1.c: Likewise.
9446         * tst-rwlock4.c: Likewise.
9447         * tst-rwlock6.c: Likewise.
9448         * tst-rwlock7.c: Likewise.
9449         * tst-sem3.c: Likewise.
9450         * tst-spin2.c: Likewise.
9451         * tst-umask1.c: Likewise.
9452
9453 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
9454
9455         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
9456
9457 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
9458
9459         * descr.h (struct pthread): Move cancelhandling member to the front.
9460
9461 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
9462
9463         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
9464         malloc_parent, and malloc_child statically.
9465         (__register_atfork_malloc): New function.
9466         (free_mem): Don't free any of the malloc_* variables on the list.
9467         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
9468         Define HAVE_register_atfork_malloc.
9469
9470 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
9471
9472         * sysdeps/pthread/createthread.c (create_thread): Add some more
9473         comments explaining when to set multiple_threads and when not.
9474
9475         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
9476         THREAD_ATOMIC_BIT_SET if not already defined.
9477         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
9478         THREAD_ATOMIC_BIT_SET:
9479         * sysdeps/x86_64/tls.h: Likewise.
9480         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
9481         THREAD_ATOMIC_CMPXCHG_VAL.
9482         (_pthread_cleanup_pop_restore): Likewise.
9483         * cancellation.c (__pthread_enable_asynccancel): Likewise.
9484         (__pthread_enable_asynccancel_2): Likewise.
9485         (__pthread_disable_asynccancel): Likewise.
9486         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
9487         (__libc_disable_asynccancel): Likewise.
9488         * init.c (sigcancel_handler): Likewise.
9489         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
9490         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
9491
9492 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
9493
9494         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
9495         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
9496         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
9497         * Makefile (tests): Add tst-cancel11.
9498         * tst-cancel11.c: New file.
9499
9500 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
9501
9502         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
9503         round, not the first.  Use specific_used flag instead of local
9504         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
9505         (__free_tcb): Don't call deallocate_tsd here.
9506         (start_thread): Call deallocate_tsd here.
9507         * pthread_setspecific.c: Set specific_used flag really only when
9508         needed.
9509         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
9510         * tst-tsd3.c: New file.
9511         * tst-tsd4.c: New file.
9512
9513 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
9514
9515         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
9516         Use atomic_exchange_and_add instead of __lll_add.
9517         (__lll_mutex_timedlock): Likewise.
9518         Patch by Ian Wienand.
9519
9520 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
9521
9522         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
9523         (SINGLE_THREAD_P): Fix typo.
9524         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
9525
9526 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
9527
9528         * Makefile (tests): Add tst-align.
9529         * tst-align.c: New file.
9530         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
9531
9532         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
9533         function correctly.
9534
9535         * tst-tsd2.c: Add casts to avoid warnings.
9536
9537 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
9538
9539         * descr.h (struct pthread): Move most often used elements to the front.
9540
9541 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
9542
9543         * Makefile (libpthread-routines): Add pthread_atfork.
9544         (libpthread-static-only-routines): Add pthread_atfork.
9545
9546 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
9547
9548         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
9549         of TLS_DTV_AT_TP.
9550         (INSTALL_DTV): Add parens.
9551         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
9552         Use passed descr instead of THREAD_SELF.
9553         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
9554         (__lll_mutex_timedlock_wait): Correct expected value after
9555         spurious wakeup.
9556         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
9557         Release lock before waking up the waiters.
9558         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
9559         criteria.  Reorderstruct passed to cleanup handler.  Fix
9560         handling of cancellation and failung pthread_mutex_unlock call.
9561         Use __pthread_enable_asynccancel_2 instead of
9562         __pthread_enable_asynccancel.
9563         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
9564         Return result of lock re-get if it fails.
9565         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
9566         for __pthread_cleanup_push.
9567         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
9568         completely broken rwlock implementation.
9569         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
9570         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
9571         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
9572         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
9573         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
9574         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
9575         versioned_symbol macro.
9576         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
9577         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
9578
9579 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
9580
9581         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
9582         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
9583         and __helper_tid.
9584         (struct timer): Remove th and bar field.
9585         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
9586         debugging code.  Create only one helper thread.
9587         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
9588         helper thread.
9589         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
9590         Renamed.  Define statically.  Use thread info from siginfo.
9591         (__helper_once): New variable.
9592         (__helper_tid): New variable.
9593         (__reset_helper_control): New function.
9594         (__start_helper_thread): New function.
9595
9596         * pthread_create.c (start_thread): Don't use setjmp inside
9597         __builtin_expect to work around gcc bug.
9598
9599         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
9600         timer_delete syscall fails, but not with ENOSYS, set
9601         __no_posix_timers.
9602
9603         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
9604         (timer_settime): Fix typo.
9605         * sysdeps/unix/sysv/linux/timer_getoverr.c
9606         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
9607
9608 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
9609
9610         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
9611         offset of cleanupbuf.__prev.
9612
9613 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
9614
9615         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
9616         of included file.
9617
9618 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
9619
9620         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
9621         NULL provide default definition to syscall.
9622
9623 2003-03-25  Roland McGrath  <roland@redhat.com>
9624
9625         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
9626         (timer_id2ptr): Fix typo.
9627
9628 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
9629
9630         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
9631         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
9632         * sysdeps/ia64/pthreaddef.h: Likewise.
9633         * sysdeps/powerpc/pthreaddef.h: Likewise.
9634         * sysdeps/s390/pthreaddef.h: Likewise.
9635         * sysdeps/sh/pthreaddef.h: Likewise.
9636         * sysdeps/x86_64/pthreaddef.h: Likewise.
9637         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
9638         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
9639         being changed.
9640         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
9641         SIGTIMER is not unblocked.
9642         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
9643         RT signal taken.
9644         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
9645         be send.
9646         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
9647         pass pointer through as ID.
9648         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
9649         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
9650         * sysdeps/unix/sysv/linux/timer_create.c: New file.
9651         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
9652         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
9653         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
9654         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
9655         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
9656         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
9657         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
9658         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
9659         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
9660         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
9661         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
9662         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
9663         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
9664         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
9665         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
9666         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
9667         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
9668         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
9669         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
9670         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
9671         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
9672         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
9673         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
9674         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
9675         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
9676         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
9677         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
9678         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
9679         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
9680         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
9681
9682         * pthreadP.h: Remove FRAME_LEFT definition.
9683         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
9684         already left frame.  Programs which have this problem are not POSIX
9685         compliant.
9686         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
9687
9688 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
9689
9690         * sysdeps/pthread/tst-timer.c: Check return values of the
9691         functions we test.
9692
9693 2003-03-23  Roland McGrath  <roland@redhat.com>
9694
9695         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
9696         * tst-tls3mod.c: Likewise.
9697         * tst-tls1.c: Likewise.
9698         * tst-tls2.c: Likewise.
9699
9700         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
9701         undefined behavior.
9702
9703         * tst-join5.c (tf1, tf2): Add a cast.
9704
9705         * Makeconfig (includes): Append -I$(..)nptl to this variable.
9706
9707         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
9708         Don't test anything.
9709         * tst-cond4.c: Likewise.
9710         * tst-cond6.c: Likewise.
9711         * tst-flock2.c: Likewise.
9712         * tst-mutex4.c: Likewise.
9713         * tst-rwlock4.c: Likewise.
9714         * tst-signal1.c: Likewise.
9715         * tst-spin2.c: Likewise.
9716         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
9717
9718         * tst-mutex4.c: Use test-skeleton.c.
9719         * tst-spin2.c: Likewise.
9720         * tst-sysconf.c: Likewise.
9721         * tst-barrier2.c: Likewise.
9722         * tst-cond4.c: Likewise.
9723         * tst-cond6.c: Likewise.
9724         * tst-rwlock4.c: Likewise.
9725         * tst-unload.c: Likewise.
9726         * tst-flock2.c (do_test): Use return instead of exit.
9727
9728 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
9729
9730         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
9731
9732 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
9733
9734         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
9735         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
9736         instead of __lll_compare_and_swap.
9737         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
9738         Likewise.
9739         Removed definition if __lll_compare_and_swap.
9740
9741         * cancellation.c: Adjust for new form of compare&exchange macros.
9742         * cleanup_defer.c: Likewise.
9743         * init.c: Likewise.
9744         * libc-cancellation.c: Likewise.
9745         * old_pthread_cond_broadcast.c: Likewise.
9746         * old_pthread_cond_signal.c: Likewise.
9747         * old_pthread_cond_timedwait.c: Likewise.
9748         * old_pthread_cond_wait.c: Likewise.
9749         * pthread_cancel.c: Likewise.
9750         * pthread_create.c: Likewise.
9751         * pthread_detach.c: Likewise.
9752         * pthread_join.c: Likewise.
9753         * pthread_key_delete.c: Likewise.
9754         * pthread_setcancelstate.c: Likewise.
9755         * pthread_setcanceltype.c: Likewise.
9756         * pthread_timedjoin.c: Likewise.
9757         * pthread_tryjoin.c: Likewise.
9758         * sysdeps/pthread/createthread.c: Likewise.
9759
9760 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
9761
9762         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
9763         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
9764         definitions.  Replace uses with calls to atomic_* functions.
9765         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
9766         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
9767         __lll_test_and_set calls with atomic_exchange_and_add and
9768         atomic_exchange calls respectively.
9769         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
9770         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
9771         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
9772         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
9773         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
9774         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
9775         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
9776
9777         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
9778         returns the old value.
9779
9780 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
9781
9782         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
9783         int for variable OLDVAL and correct inline assembler contraint.
9784         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
9785         type int for variable OLD.
9786
9787         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
9788         only for s390-32.
9789         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
9790         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
9791         instead of multiple_threads field in the TCB.
9792
9793 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
9794
9795         * sysdeps/i386/i686/bits/atomic.h: Removed.
9796         * sysdeps/i386/i586/bits/atomic.h: Removed.
9797         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
9798         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
9799         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
9800         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
9801         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
9802         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
9803         * atomic.h: Removed.  Moved to glibc.
9804
9805         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
9806         support for clock selection.
9807
9808         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
9809         signalling waiters.
9810
9811 2003-03-18  Roland McGrath  <roland@redhat.com>
9812
9813         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
9814         Add __lll_rel_instr first.  Add memory clobber.
9815         (lll_mutex_unlock): Use __lll_test_and_set.
9816         From Paul Mackerras <paulus@samba.org>.
9817
9818         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
9819         unconditionally.
9820         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
9821         (SINGLE_THREAD_P):  Add `header.' prefix.
9822         From Paul Mackerras <paulus@samba.org>.
9823
9824         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
9825         pthread_timedjoin_np to ...
9826         (libpthread: GLIBC_2.3.3): ... here.
9827         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
9828
9829         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9830         Avoid shadowing VAL variable.
9831
9832         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
9833         New macro.
9834
9835 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
9836
9837         * Makefile (tests): Add tst-cond11.
9838         * tst-cond11.c: New file.
9839
9840         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
9841         struct passed to cleanup handler to eliminate one more
9842         instruction.
9843         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9844
9845         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
9846         (pthrad_cond_t): Replace __unused field with __clock.
9847
9848         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
9849         waken all waiters in cleanup handler.
9850         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
9851         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9852
9853         * pthread_condattr_getclock.c: New file.
9854         * pthread_condattr_setclock.c: New file.
9855         * sysdeps/pthread/pthread.h: Declare these new functions.
9856         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
9857         * Makefile (libpthread-routines): Add the new functions.
9858         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
9859         Renamed field to value.  Document use of the bits.
9860         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
9861         change.
9862         * pthread_condattr_setpshared.c: Likewise.
9863         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
9864         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
9865         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9866         Add __clock field.
9867         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
9868         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
9869         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
9870         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
9871         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
9872         Implement clock selection.
9873         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
9874         * pthread-errnos.sym: Add ENOSYS.
9875         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9876         _POSIX_CLOCK_SELECTION.
9877         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9878
9879         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
9880         invalid .size directive.
9881
9882 2003-03-17  Roland McGrath  <roland@redhat.com>
9883
9884         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
9885         Formatting tweaks.
9886
9887 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
9888
9889         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
9890         Use __lll_add instead of spelling it out.  Use protected symbol names.
9891         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
9892         Use __lll_add.
9893         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
9894         Renamed from lll_compare_and_swap.  Use new name where necessary.
9895         (__lll_add): Defined.
9896         (__lll_dec_if_positive): Defined.
9897         (__lll_test_and_set): Defined.
9898         * sysdeps/ia64/pthread_spin_init.c: Removed.
9899         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
9900         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
9901         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
9902         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
9903         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
9904         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
9905         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
9906         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
9907         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
9908         __sync_lock_release_si.
9909         Patch by Jakub Jelinek.
9910
9911         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
9912         Fix timeout handling.
9913         (__lll_timedwait_tid): Likewise.
9914         (lll_unlock_wake_cb): Wake up other waiters if necessary.
9915         Patch by Jakub Jelinek.
9916
9917         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
9918
9919 2003-03-17  Roland McGrath  <roland@redhat.com>
9920
9921         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
9922         * sysdeps/pthread/pthread_spin_init.c: New file.
9923         * sysdeps/pthread/pthread_spin_unlock.c: New file.
9924         * sysdeps/powerpc/Makefile: New file.
9925         * sysdeps/powerpc/pthread_spin_lock.c: New file.
9926         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
9927         * sysdeps/powerpc/pthreaddef.h: New file.
9928         * sysdeps/powerpc/tcb-offsets.sym: New file.
9929         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
9930         * sysdeps/powerpc/tls.h: New file.
9931         * sysdeps/powerpc/bits/atomic.h: New file.
9932         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
9933         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
9934         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
9935
9936         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
9937         * sysdeps/unix/sysv/linux/sem_post.c: New file.
9938         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
9939         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
9940         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
9941         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
9942         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
9943         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
9944         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
9945         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
9946         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
9947         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
9948         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
9949         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
9950         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
9951
9952         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
9953         not gettimeofday.
9954         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
9955         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
9956         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
9957         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
9958         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
9959
9960 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
9961
9962         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
9963         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
9964         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9965         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9966         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
9967
9968 2003-03-16  Roland McGrath  <roland@redhat.com>
9969
9970         * tst-fork4.c: Include <string.h>.
9971         * tst-signal2.c: Likewise.
9972         * tst-mutex5.c (do_test): exit -> return.
9973         * tst-mutex2.c: Include <stdlib.h>.
9974
9975 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
9976
9977         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9978         (__lll_mutex_timedlock_wait): Correct expected value after
9979         spurious wakeup.  Otherwise we would never wait again.
9980
9981         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
9982         zone versus inline asm stupidity.  Use correct instructions.
9983
9984         * tst-rwlock6.c: Add some more status output.
9985
9986 2003-03-15  Roland McGrath  <roland@redhat.com>
9987
9988         * sysdeps/pthread/configure.in: New file.
9989         * sysdeps/pthread/configure: New file (generated).
9990
9991 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
9992
9993         * allocatestack.c (allocate_stack): Store the exact stack size of
9994         user allocated stacks.
9995
9996 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
9997
9998         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
9999         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
10000         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
10001         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
10002         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
10003         Use `header.' prefix.
10004         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
10005
10006 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
10007
10008         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
10009         __builtin_frame_address, use stack pointer.
10010
10011         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
10012         instead of __builtin_frame_pointer.
10013
10014 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
10015
10016         * tst-basic1.c (do_test): Add cast to avoid warning.
10017         * tst-basic2.c (do_test): Likewise.
10018
10019         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
10020         amount of stack correction.
10021
10022         * tst-fork4.c: Use test-skeleton.c.
10023
10024 2003-03-14  Roland McGrath  <roland@redhat.com>
10025
10026         * init.c: Fix typo "#eli" for "#else".
10027
10028 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
10029
10030         * allocatestack.c (__stack_user): Use hidden_data_def.
10031         * pthread_create.c (__pthread_keys): Likewise.
10032
10033         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
10034
10035 2003-03-14  Roland McGrath  <roland@redhat.com>
10036
10037         * tst-fork4.c: New file.
10038         * Makefile (tests): Add it.
10039
10040         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
10041         we always define the padding space.
10042         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
10043         stopped supporting its own extensions fully.
10044         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
10045         struct also called `header', so `header.multiple_threads' is the field
10046         name to use on all machines.
10047         * allocatestack.c (allocate_stack): Use `header.' prefix.
10048         * sysdeps/pthread/createthread.c (create_thread): Likewise.
10049         * pthread_create.c (__pthread_create_2_1): Likewise.
10050         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
10051         (THREAD_SELF): Likewise.
10052         * sysdeps/x86_64/tls.h: Likewise.
10053         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
10054         (SINGLE_THREAD_P): Likewise.
10055         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
10056         (SINGLE_THREAD_P): Likewise.
10057         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
10058         (SINGLE_THREAD_P): Likewise.
10059
10060         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
10061         value directly.
10062
10063 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
10064
10065         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
10066         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
10067
10068         * pthread_create.c (start_thread): setjmp is expected to return 0.
10069
10070         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
10071         (THREAD_GETMEM_NC): Likewise.
10072
10073 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
10074
10075         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
10076         and the size of the stack which must be allocated is a multiple,
10077         allocate one more page.
10078         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
10079         MULTI_PAGE_ALIASING.
10080
10081 2003-03-13  Roland McGrath  <roland@redhat.com>
10082
10083         * pthread_create.c (start_thread): Set EXITING_BIT after the
10084         event-reporting (and destructors), not before.
10085
10086 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
10087
10088         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
10089         lll_futex_wake): Declare register variables as long int instead of
10090         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
10091         Make syscall arguments clobbered by the syscall.
10092         (lll_futex_wait): Define using lll_futex_timed_wait.
10093
10094         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
10095         to void *.
10096
10097         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
10098         PPID if [! NDEBUG].
10099
10100         * allocatestack.c (nptl_ncreated): Only declare if
10101         COLORING_INCREMENT != 0.
10102
10103         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
10104         (__libc_enable_asynccancel_2): Remove prototype.
10105
10106         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
10107         ctid to match kernel.
10108
10109 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
10110
10111         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
10112         libc_multiple_threads.
10113         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
10114         __libc_multiple_threads to...
10115         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
10116
10117         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
10118         versioning.
10119         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
10120         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
10121
10122         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
10123         (__pthread_once_internal): Define.
10124
10125         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
10126         macros instead of .symver directly.
10127         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
10128         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
10129
10130         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
10131         * sysdeps/x86_64/tcb-offsets.sym: New file.
10132         * sysdeps/x86_64/Makefile: New file.
10133
10134         * sysdeps/i386/tcb-offsets.sym: Add SELF.
10135         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
10136         to access own pthread_t in TCB.
10137         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10138         Likewise.
10139         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
10140         Likewise.
10141         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
10142
10143 2003-03-12  Roland McGrath  <roland@redhat.com>
10144
10145         * pthread-errnos.sym: New file.
10146         * Makefile (gen-as-const-headers): New variable, list that file.
10147         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
10148         header <pthread-errnos.h> instead of defining errno values here.
10149         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
10150         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
10151         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
10152         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
10153         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
10154         Likewise.
10155         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10156         Likewise.
10157         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
10158         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
10159         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10160         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10161         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
10162         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
10163         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
10164         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
10165         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
10166         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
10167         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
10168         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
10169         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
10170         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
10171         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
10172         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
10173         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
10174         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
10175         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
10176         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
10177         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
10178         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
10179         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
10180         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
10181         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
10182         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
10183         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
10184
10185         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
10186         CLONE_CHILD_SETTID worked.
10187
10188 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
10189
10190         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
10191         file.
10192         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
10193         file.
10194
10195         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
10196         (pthread_cond_t): Add padding.
10197
10198         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
10199         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
10200         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
10201
10202         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
10203         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
10204         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
10205         (__pthread_rwlock_timedrdlock): Likewise.
10206         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
10207         (__pthread_rwlock_wrlock): Likewise.
10208         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
10209         (__pthread_rwlock_rdlock): Likewise.
10210
10211         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
10212
10213         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
10214         result of lock re-get if it fails.
10215
10216 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
10217
10218         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
10219         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
10220         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
10221         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
10222         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
10223         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
10224         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
10225         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
10226         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
10227         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
10228
10229         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
10230         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
10231
10232         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
10233         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
10234         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
10235         (create_thread): Likewise.
10236         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
10237         * init.c (__pthread_initialize_minimal_internal): Initialize
10238         __libc_multiple_threads_ptr if necessary.
10239         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
10240         __pthread_multiple_threads and __libc_multiple_threads_ptr.
10241         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
10242         __libc_multiple_threads.
10243         (__libc_pthread_init): Return pointer to __libc_pthread_init if
10244         necessary.
10245
10246         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
10247         (THREAD_SETMEM_NC): Likewise.
10248
10249         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
10250         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
10251         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
10252         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
10253
10254         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
10255         Eliminate one entire instruction.
10256
10257         * cancellation.c (__pthread_enable_asynccancel_2): New function.
10258         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
10259         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
10260         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
10261         instead of __pthread_enable_asynccancel.
10262         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
10263         (__pthread_cond_wait): Likewise.
10264         * sysdeps/pthread/pthread_cond_timedwait.c
10265         (__pthread_cond_timedwait): Likewise.
10266         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
10267
10268         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
10269         (__condvar_cleanup): Wake up all waiters in case we got signaled
10270         after being woken up but before disabling asynchronous
10271         cancellation.
10272         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
10273         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
10274         (__condvar_cleanup): Likewise.
10275
10276         * init.c (__NR_set_tid_address): If already defined, don't redefine.
10277         Make it an error if architecture has no #if case.  Add x86-64.
10278
10279         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
10280         pt-initfini.s generation.
10281
10282         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
10283         (TLS_INIT_TP): Fix typo.
10284
10285 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
10286
10287         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
10288         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
10289
10290         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
10291         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
10292         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
10293         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
10294         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
10295         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
10296         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
10297         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
10298
10299 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
10300
10301         * sysdeps/pthread/pthread_cond_timedwait.c
10302         (__pthread_cond_timedwait): Return the result of the final
10303         locking.  If it succeeds, the regular function return value.
10304
10305         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
10306         Return result of the final locking.
10307         * version.c (__nptl_main): Work around problems with the strange
10308         INTERNAL_SYSCALL macro on ppc32.
10309         * init.c (__pthread_initialize_minimal_internal): Unblock
10310         SIGCANCEL in case the parent blocked it.
10311         Reported by Paul Mackerras <paulus@samba.org>.
10312
10313         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
10314         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
10315         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
10316
10317 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
10318
10319         * sysdeps/pthread/pthread_cond_timedwait.c
10320         (__pthread_cond_timedwait): Unlock and fail if
10321         __pthread_mutex_unlock_internal failed.
10322
10323         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
10324         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
10325         Use ARCH_CLONE.
10326         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
10327         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
10328         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
10329         ALLOCATE_STACK): New macros.
10330         (TLS_TPADJ): New macro.
10331         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
10332         (allocate_stack): Handle TLS_DTV_AT_TP and
10333         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
10334         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
10335         Don't set PD->self.
10336         * init.c [__ia64__] (__NR_set_tid_address): Define.
10337
10338         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
10339         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
10340         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
10341         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
10342         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
10343         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
10344         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
10345         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
10346         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
10347         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
10348         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
10349         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
10350         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
10351         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
10352         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
10353         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
10354         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
10355         * sysdeps/ia64/bits/atomic.h: New file.
10356         * sysdeps/ia64/Makefile: New file.
10357         * sysdeps/ia64/pthread_spin_init.c: New file.
10358         * sysdeps/ia64/pthread_spin_lock.c: New file.
10359         * sysdeps/ia64/pthread_spin_trylock.c: New file.
10360         * sysdeps/ia64/pthread_spin_unlock.c: New file.
10361         * sysdeps/ia64/pthreaddef.h: New file.
10362         * sysdeps/ia64/tcb-offsets.sym: New file.
10363         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
10364         * sysdeps/ia64/tls.h: New file.
10365
10366         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
10367         to syscall instead of no arguments.
10368
10369 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
10370
10371         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
10372         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
10373         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
10374         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
10375
10376         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
10377         unused code.
10378
10379         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
10380
10381         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
10382         lowlevelbarrier.sym.
10383         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
10384         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
10385         Include lowlevelbarrier.h and don't define offsets locally.
10386         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
10387
10388         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
10389         (__lll_mutex_lock_wait): Reverse order of first two parameters.
10390         (__lll_mutex_timedlock_wait): Likewise.
10391         (lll_mutex_lock): Adjust asm for that.
10392         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
10393         (lll_lock): Adjust asm for operand order change.
10394         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
10395         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
10396
10397         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
10398         Reverse order of parameters.
10399         (__lll_timedwait_tid): Remove regparms attribute.
10400         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
10401         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
10402
10403         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
10404         (__lll_timedwait_tid): Remove one unnecessary instruction.
10405
10406         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
10407         __lll_mutex_timedlock_wait only for NOT_IN_libc.
10408         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
10409         lowlevelmutex.S.
10410
10411         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
10412         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
10413         for NOT_IN_libc.
10414         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
10415         lowlevellock.S.
10416
10417         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
10418         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
10419         for libc.so.
10420         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
10421         define LOCK here (if UP is not defined).  The actual code is in
10422         lowlevelmutex.S.
10423
10424         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
10425         LOCK is already defined.  Don't define lll_unlock_wake_cb and
10426         __lll_timedwait_tid for libc.so.
10427         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
10428         define LOCK here (if UP is not defined).  The actual code is in
10429         lowlevellock.S.
10430
10431         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
10432         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
10433         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
10434         instead of lowlevelsem.h.
10435         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
10436         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
10437         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
10438
10439         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
10440         lowlevelrwlock.sym.
10441         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
10442         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
10443         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
10444
10445         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
10446         register loading.
10447         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
10448         last changed.  D'oh.
10449
10450         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
10451
10452         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
10453         of __libc_locking_needed.
10454         (lll_trylock): Initialize %eax to zero.
10455
10456         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
10457         pthread_cond_t definition.
10458
10459 2003-03-10  Roland McGrath  <roland@redhat.com>
10460
10461         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
10462         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
10463         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
10464         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
10465         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
10466
10467         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
10468         Instead of setting PD->multiple_threads, set globals
10469         __pthread_multiple_threads and __libc_multiple_threads.
10470         * sysdeps/pthread/createthread.c (create_thread): Likewise.
10471         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
10472         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
10473
10474         * descr.h (struct pthread): Conditionalize first member on
10475         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
10476         containing an anonymous tcbhead_t.  Move `list' member out.
10477         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
10478         * allocatestack.c: Remove use of `header.data.' prefix.
10479         * pthread_create.c: Likewise.
10480         * init.c (__pthread_initialize_minimal_internal): Likewise.
10481         * sysdeps/pthread/createthread.c (create_thread): Likewise.
10482         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
10483         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
10484         * sysdeps/x86_64/tls.h: Likewise.
10485         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
10486         (SINGLE_THREAD_P): Likewise.
10487         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
10488         (SINGLE_THREAD_P): Likewise.
10489         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
10490         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
10491
10492 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
10493
10494         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
10495
10496         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
10497         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
10498
10499         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
10500         leftovers from the ia32 code.
10501
10502         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
10503         memory load.
10504         (clear_once_control): Don't load %esi.
10505
10506         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
10507         handling.
10508
10509         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
10510
10511         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
10512         * sysdeps/unix/sysv/linux/createthread.c: ...here.
10513
10514         * Makefile (tests): Add tst-cond10.
10515         * tst-cond10.c: New file.
10516
10517 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
10518
10519         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
10520         * tst-signal3.c (do_test): Likewise.
10521         * tst-sem5.c (do_test): Likewise.
10522         * tst-kill6.c (do_test): Likewise.
10523         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
10524
10525         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
10526         of inc/dec.
10527         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10528         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
10529         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
10530         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
10531         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
10532         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
10533         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
10534         Likewise.
10535         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10536         Likewise.
10537         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
10538         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
10539         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
10540         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
10541         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
10542         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10543         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10544         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10545
10546         * allocatestack.c (allocate_stack): If mprotect() fails free the
10547         TLS memory.
10548
10549 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
10550
10551         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
10552
10553         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
10554         lll_wake_tid.  This was used only to work around kernel limits in
10555         the early days.
10556         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
10557         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
10558         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
10559         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
10560
10561         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
10562         (__pthread_initialize_minimal_internal): Change initialization of
10563         __static_tls_align_m1 appropriately.
10564         * pthreadP.h (__static_tls_align_m1): Renamed from
10565         __static_tls_align.
10566         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
10567         instead of __static_tls_align-1.
10568
10569 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
10570
10571         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
10572
10573         * pthread_create.c: Define __pthread_keys using nocommon
10574         attribute, not by placing it explicitly in bss.
10575         Remove DEFINE_DEALLOC definition.  Not needed anymore.
10576
10577         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
10578         Use it in mmap call to allocate stacks.
10579
10580         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
10581
10582         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
10583         result of the thread function.
10584
10585 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
10586
10587         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
10588         version is just fine.
10589
10590         * sysdeps/unix/sysv/linux/libc_pthread_init.c
10591         (__pthread_child_handler): Renamed from pthread_child_handler,
10592         exported, and marked hidden.  Change all users.
10593         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
10594         free __pthread_child_handler from child list.
10595
10596 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
10597
10598         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
10599
10600         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
10601         Fix handling of cancellation and failing pthread_mutex_unlock call.
10602         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
10603         (__pthread_cond_wait): Likewise.
10604
10605         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
10606         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
10607         lll_futex_timed_wait call.
10608         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
10609         (pthread_rwlock_timedwrlock): Likewise.
10610
10611         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
10612         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
10613         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
10614
10615         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
10616         check of lll_futex_wake return value.
10617
10618 2003-03-03  Roland McGrath  <roland@redhat.com>
10619
10620         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
10621
10622         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
10623         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
10624         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
10625
10626 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
10627
10628         * sysdeps/pthread/timer_create.c (timer_create): Return correct
10629         error for CPU clocks.
10630
10631         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
10632         _POSIX_MONOTONIC_CLOCK.
10633         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
10634
10635         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
10636         recent kernels.
10637
10638 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
10639
10640         * descr.h (struct pthread): Move cleanup field to the front.
10641
10642 2003-03-01  Roland McGrath  <roland@redhat.com>
10643
10644         * sem_open.c (sem_open): Braino fix.
10645
10646 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
10647
10648         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
10649         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
10650         __pthread_cleanup_pop functionality.
10651         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
10652
10653         * descr.h (struct pthread): Move tid field to the front now that
10654         it is often used.
10655
10656         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
10657         (__lll_mutex_timedlock_wait): Remove.
10658         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
10659         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
10660         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
10661         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
10662         (lll_unlock_wake_cb): Don't save and restore %esi.
10663         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
10664         %esi.
10665         (__lll_timedwait_tid): Add alignment.
10666         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
10667         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
10668         %esi.
10669         (__lll_timedwait_tid): Removed.
10670         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
10671         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
10672         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
10673         (pthread_barrier_wait): Don't save, load, and restore %esi for
10674         last thread.
10675         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
10676         (__pthread_cond_signal): Don't save, load, and restore %esi.
10677         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
10678         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
10679         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
10680         Don't save, load, and restore %esi.
10681
10682 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
10683
10684         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
10685         Release lock before waking up the waiters.
10686
10687         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
10688
10689         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
10690         (reader_thread): Likewise.
10691
10692         * sysdeps/pthread/pthread_rwlock_unlock.c
10693         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
10694         to wake up readers if there are none.
10695
10696         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
10697         Release internal lock before wake threads.
10698
10699 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
10700
10701         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
10702         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
10703         predefined.
10704         * tst-rwlock9.c: Likewise.
10705         * tst-rwlock10.c: New file.
10706         * tst-rwlock11.c: New file.
10707
10708         * Makefile (tests): Add tst-dlsym1.
10709         * tst-dlsym1.c: New file.
10710
10711         * init.c (__pthread_initialize_minimal_internal): Set
10712         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
10713         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
10714
10715 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
10716
10717         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
10718
10719         * tst-cond2.c: Fix sychronization with child.
10720
10721         * tst-rwlock8.c (reader_thread): Remove unused variable.
10722
10723         * Makefile: Add rules to build and run tst-tls3.
10724         * tst-tls3.c: New file.
10725         * tst-tls3mod.c: New file.
10726
10727         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
10728         * tst-rwlock8.c: New file.
10729         * tst-rwlock9.c: New file.
10730         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
10731         complete broken rwlock implementation.
10732         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10733         Likewise.
10734         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
10735         Likewise.
10736         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
10737         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
10738         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
10739         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
10740         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
10741         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
10742         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
10743
10744 2003-02-23  Roland McGrath  <roland@redhat.com>
10745
10746         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
10747
10748 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
10749
10750         * Makefile (tests): Add tst-context1.
10751         * tst-context1.c: New file.
10752
10753         * Makefile (tests): Add tst-tls1 and tst-tls2.
10754         * tst-tls1.c: New file.
10755         * tst-tls2.c: New file.
10756
10757         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
10758         for failed cmpxchg.
10759
10760         * pthread_create.c (start_thread): Set EXITING_BIT early.
10761
10762         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
10763         (THREAD_GETMEM_NC): Likewise.
10764
10765 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
10766
10767         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
10768         off 3 more bytes by using offset-less instructions when possible.
10769
10770         * Makefile: Add dependency for $(objpfx)version.d.
10771
10772         * eintr.c (eintr_source): Add unnecessary return but the compiler
10773         insists.
10774
10775         * tst-kill3.c: Include <unistd.h>.
10776
10777 2003-02-21  Roland McGrath  <roland@redhat.com>
10778
10779         * pthread_create.c (start_thread): Call __libc_thread_freeres.
10780
10781 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
10782
10783         * Makefile (tests): Add tst-eintr1.
10784         (distribute): Add eintr.c.
10785         * tst-eintr1.c: New file.
10786         * eintr.c: New file.
10787
10788         * pthread_cancel.c (pthread_cancel): Use tkill directly.
10789
10790         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
10791         Disallow sending SIGCANCEL.
10792
10793         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
10794         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
10795         * tst-kill1.c: New file.
10796         * tst-kill2.c: New file.
10797         * tst-kill3.c: New file.
10798         * tst-kill5.c: New file.
10799         * tst-kill6.c: New file.
10800         * tst-basic7.c: Renamed to...
10801         * tst-kill4.c: ...this.
10802
10803 2003-02-21  Roland McGrath  <roland@redhat.com>
10804
10805         * Makefile (install-lib-ldscripts): New variable.
10806
10807 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
10808
10809         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
10810         * pthread_cancel.c: Use INVALID_TD_P.
10811         * pthread_detach.c: Likewise.
10812         * pthread_getschedparam.c: Likewise.
10813         * pthread_setschedparam.c: Likewise.
10814         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
10815         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
10816         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
10817         * pthread_timedjoin.c: Likewise.
10818
10819         * tst-basic7.c: Include <signal.h>.
10820
10821         * pthread_join.c (pthread_join): Limited checking for invalid
10822         descriptors.
10823         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
10824
10825 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
10826
10827         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
10828         beginning of the loop.  Clear the entire first block of TSD.
10829         * Makefile (tests): Add tst-key4.
10830         * tst-key4.c: New file.
10831
10832 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
10833
10834         * Makefile (tests): Add tst-basic7.
10835         * tst-basic7.c: New file.
10836
10837         * pthread_create.c (deallocate_tsd): Mark as internal_function.
10838         Add some more __builtin_expect.
10839
10840         * pthreadP.h: Define dummy version of DEBUGGING_P.
10841
10842 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
10843
10844         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
10845         _POSIX_THREAD_PRIORITY_SCHEDULING.
10846         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
10847         _XOPEN_REALTIME_THREADS.
10848         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
10849
10850         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
10851         kernel returns EINVAL for PID <= 0, work around it.
10852
10853         * Makefile (tests): Add tst-signal5.
10854         * tst-signal5.c: New file.
10855
10856         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
10857         and LOGIN_NAME_MAX.
10858
10859         * tst-cancel1.c (tf): Block all signals.
10860
10861         * Makefile (tests): Add tst-basic6.
10862         * tst-basic6.c: New file.
10863
10864         * tst-basic1.c: Add test for process ID.
10865
10866         * Makefile (tests): Add tst-cancel10.
10867         * tst-cancel10.c: New file.
10868
10869         * Makefile (tests): Add tst-signal4.
10870         * tst-signal4.c: New file.
10871
10872         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
10873         __sigismember instead of sigismember.  Add __builtin_expect.
10874
10875 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
10876
10877         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
10878         pthread_setcancelstate, and pthread_rwlock_setpshared.
10879
10880         * tst-cancel7.c (do_test): Make sure the pid file exists before
10881         canceling the thread.
10882
10883         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
10884         pthread_rwlock_timedrdlock tests.
10885         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
10886         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10887         Check for invalid tv_nsec field.
10888         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
10889         Likewise.
10890
10891         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
10892         recursive mutex of overflow.
10893
10894         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
10895
10896         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
10897         going into an endless loop.
10898         * Makefile (tests): Add tst-cancel9.
10899         * tst-cancel9.c: New file.
10900
10901         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
10902
10903 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
10904
10905         * tst-mutex5.c (do_test): Add more timedlock tests.
10906
10907         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
10908         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
10909
10910         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
10911         use INLINE_SYSCALL.  Error number is returned, not -1.
10912
10913         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
10914         and __deallocate_stack with internal_function.
10915         * pthread_create.c: Adjust definitions appropriately.
10916         * allocatestack.c: Likewise.
10917
10918         * pthread_join.c: Add one more __builtin_expect.
10919         * pthread_timedjoin.c: Likewise.
10920
10921         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
10922         not data of sequence number does not match.
10923         Add one __builtin_expect.
10924
10925         * Makefile (tests): Add tst-clock1.
10926         * tst-clock1.c: New file.
10927
10928         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
10929         negative arguments.
10930         * Makefile (tests): Add tst-basic5.
10931         * tst-basic5.c: New file.
10932
10933 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
10934
10935         * Makefile (tests): Add tst-basic4.
10936         * tst-basic4.c: New file.
10937
10938         * pthreadP.h: Add declaraction for __nptl_nthreads.
10939         * pthread_create.c: Define __nptl_nthreads
10940         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
10941         after thread is done.  If then zero, call exit(0).
10942         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
10943         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
10944         * init.c (pthread_functions): Initialize ptr_nthreads.
10945         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
10946         (__reclaim_stacks): Decrement __nptl_nthreads.
10947         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
10948         Define.
10949         * Makefile (tests): Add tst-basic3.
10950         * tst-basic3.c: New file.
10951
10952         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
10953         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
10954         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
10955         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
10956         if asynchronous canceling is enabled.
10957         * pthread_join.c (pthread_join): When recognizing circular joins,
10958         take into account the other thread might be already canceled.
10959         * Makefile (tests): Add tst-join5.
10960         * tst-join5.c: New file.
10961
10962         * Makefile (tests): Add tst-join4.
10963         * tst-join4.c: New file.
10964
10965 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
10966
10967         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
10968
10969 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
10970
10971         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
10972         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
10973         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
10974         warning.
10975         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
10976         to avoid warning.
10977         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
10978         error if lll_futex_wake failed.
10979
10980 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
10981
10982         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
10983         handling of cancellation and failung pthread_mutex_unlock call.
10984         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
10985         * Makefile (tests): Add tst-cond8 and tst-cond9.
10986         * tst-cond8.c: New file.
10987         * tst-cond9.c: New file.
10988
10989         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
10990
10991         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
10992         non-standard initializers with __USE_GNU.
10993
10994         * Makefile (tests): Add tst-cleanup3.
10995         * tst-cleanup3.c: New file.
10996
10997 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
10998
10999         * Makefile (tests): Add tst-attr1 and tst-attr2.
11000         * tst-attr1.c: New file.
11001         * tst-attr2.c: New file.
11002
11003         * Makefile: Add rules to build and run tst-atfork2 test.
11004         * tst-atfork2.c: New file.
11005         * tst-atfork2mod.c: New file.
11006
11007         * sysdeps/unix/sysv/linux/unregister-atfork.c
11008         (__unregister_atfork): Free the memory allocated for the handlers
11009         after removing them from the lists.
11010
11011         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
11012         cleanup function.
11013
11014         * tst-atfork1.c (do_test): Wait for the child we forked.
11015         Report error in child.
11016
11017         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
11018
11019         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
11020
11021 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
11022
11023         * Makefile (tests): Add tst-cancel8.
11024         * tst-cancel8.c: New file.
11025
11026         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
11027         clearing of control variable.
11028         * Makefile (tests): Add tst-once3 and tst-once4.
11029         * tst-once3.c: New file.
11030         * tst-once4.c: New file.
11031
11032 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
11033
11034         * sysdeps/sh/Makefile: New file.
11035         * sysdeps/sh/bits/atomic.h: New file.
11036         * sysdeps/sh/pthread_spin_init.c: New file.
11037         * sysdeps/sh/pthread_spin_lock.c: New file.
11038         * sysdeps/sh/pthread_spin_trylock.S: New file.
11039         * sysdeps/sh/pthread_spin_unlock.S: New file.
11040         * sysdeps/sh/pthreaddef.h: New file.
11041         * sysdeps/sh/tcb-offsets.sym: New file.
11042         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
11043         * sysdeps/sh/tls.h: New file.
11044         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
11045         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
11046         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
11047         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
11048         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
11049         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
11050         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
11051         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
11052         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
11053         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
11054         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
11055         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
11056         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
11057         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
11058         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
11059         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
11060         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
11061         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
11062         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
11063         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
11064         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
11065         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
11066         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
11067         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
11068         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
11069         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
11070         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
11071         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
11072         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
11073         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
11074
11075 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
11076
11077         * tst-cond2.c: Rearrange code to not rely on behavior undefined
11078         according to POSIX.
11079
11080         * tst-basic2.c (do_test): Lock mutex before creating the thread.
11081
11082 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
11083
11084         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
11085         (TLS_GET_FS): New #define.
11086         (TLS_SET_FS): New #define.
11087         Correct value of __NR_set_thread_area.
11088
11089         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
11090
11091 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
11092
11093         * Makefile (tests): Add tst-popen1.
11094         * tst-popen1.c: New file.
11095
11096         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
11097         but inactive generalization.
11098         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
11099         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
11100         Minor optimization, remove one instruction.
11101         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
11102
11103 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
11104
11105         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
11106
11107 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
11108
11109         * init.c (__NR_set_tid_address): Add #ifdef for s390.
11110         * sysdeps/pthread/pthread_barrier_wait.c: New file.
11111         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
11112         * sysdeps/pthread/pthread_cond_signal.c: New file.
11113         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
11114         * sysdeps/pthread/pthread_cond_wait.c: New file.
11115         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
11116         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
11117         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
11118         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
11119         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
11120         * sysdeps/s390/Makefile: New file.
11121         * sysdeps/s390/bits/atomic.h: New file.
11122         * sysdeps/s390/pthread_spin_init.c: New file.
11123         * sysdeps/s390/pthread_spin_lock.c: New file.
11124         * sysdeps/s390/pthread_spin_trylock.c: New file.
11125         * sysdeps/s390/pthread_spin_unlock.c: New file.
11126         * sysdeps/s390/pthreaddef.h: New file.
11127         * sysdeps/s390/tcb-offsets.sym: New file.
11128         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
11129         * sysdeps/s390/tls.h: New file.
11130         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
11131         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
11132         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
11133         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
11134         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
11135         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
11136         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
11137         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
11138         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
11139         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
11140         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
11141         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
11142         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
11143         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
11144         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
11145         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
11146         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
11147         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
11148         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
11149         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
11150         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
11151         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
11152         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
11153
11154 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
11155
11156         * atomic.h: Add a couple more default implementations.
11157         (atomic_compare_and_exchange_acq): Use
11158         __arch_compare_and_exchange_32_acq in return value definition.  It
11159         always exists.
11160         (atomic_bit_set): Renamed from atomic_set_bit.
11161         Add missing atomic_ prefixes.
11162
11163         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
11164         thread library is available, use correct value to mark initialized
11165         once variable.
11166
11167 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
11168
11169         * allocatestack.c (allocate_stack): Use __getpagesize instead of
11170         __sysconf to determine pagesize.
11171
11172         * pthread_create.c: Include <atomic.h>.
11173         * allocatestack.c (allocate_stack): Implement coloring of the
11174         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
11175         size minus one.  Adjust users.
11176         * sysdeps/i386/i686/Makefile: New file.
11177
11178 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
11179
11180         * allocatestack.c: Improve comment throughout the file.
11181
11182         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
11183         (__lll_lock_wait): Add branch prediction.
11184         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
11185         (__lll_lock_wait): Likewise.
11186         (lll_unlock_wake_cb): Removed.
11187
11188 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
11189
11190         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
11191         _POSIX_THREAD_PRIORITY_SCHEDULING.
11192
11193 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
11194
11195         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
11196         Fix return type of ptr___pthread_getspecific.
11197
11198 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
11199
11200         * Makefile (tests): Add tst-umask1.
11201         (tst-umask1-ARGS): Define.
11202         * tst-umask1.c: New file.
11203
11204 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
11205
11206         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
11207         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
11208         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
11209         pthread_rwlock_unlock.
11210         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
11211         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
11212         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
11213         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
11214         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
11215         New file.
11216         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
11217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
11218         New file.
11219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
11220         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
11221         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
11222         New file.
11223         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
11224         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
11225         New file.
11226         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
11227         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
11228         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
11229         New file.
11230         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
11231         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
11232         New file.
11233         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
11234
11235         * Makefile (libpthread-routines): Remove lowlevelcond and
11236         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
11237         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
11238         and pthread_cond_broadcast.
11239         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
11240         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
11241         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
11242         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
11243         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
11244         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
11245         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
11246         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
11247         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
11248         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
11249         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
11250         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
11251         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
11252         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
11253         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
11254         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
11255         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
11256         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
11257         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
11258         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
11259         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
11260         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
11261         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
11262         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
11263         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
11264         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
11265         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
11266         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
11267         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
11268         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
11269         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
11270
11271         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
11272         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
11273         of the code is moved to ...
11274         * sysdeps/pthread/createthread.c: ...here.  New file.
11275
11276 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
11277
11278         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
11279         (__new_sem_post): Clear %eax before returning.
11280         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
11281
11282         * Makefile (tests): Add tst-cleanup2.
11283         * tst-cleanup2.c: New file.
11284
11285         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
11286         Interpret first parameter correctly.
11287
11288 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
11289
11290         * Makefile (headers): Add bits/semaphore.h.
11291
11292 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
11293
11294         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
11295         if not SHARED.
11296
11297 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
11298
11299         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
11300         must be used and mapping failed.
11301         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
11302
11303         * Makefile (CFLAGS-pthread_self.os): Define this, not
11304         CFLAGS-pthread_self.c.
11305
11306 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
11307
11308         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
11309         lll_unlock_wake_cb.
11310
11311         * Makefile (libpthread-routines): Add version.  Add rules to build
11312         version.os and banner.h.
11313         * version.c: New file.
11314
11315 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
11316
11317         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
11318         the alias unconditional.
11319         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
11320
11321 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
11322
11323         * Makefile (CFLAGS-pthread_self.c): New definition.
11324
11325 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
11326
11327         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
11328         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
11329         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
11330         * init.c (__pthread_initialize_minimal_internal): Likewise.
11331
11332 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
11333
11334         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
11335
11336         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
11337         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
11338         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
11339         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
11340         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
11341         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
11342
11343 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
11344
11345         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
11346         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
11347         * tst-cancel-wrappers.sh: Remove all exceptions.
11348
11349 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
11350
11351         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
11352         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
11353
11354         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
11355         Use __libc_pthread_functions array if SHARED.
11356
11357         * pthreadP.h: Move pthread_cond_2_0_t definition to...
11358         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
11359
11360         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
11361         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
11362         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
11363         __libc_ptf_call instead of __libc_maybe_call.
11364         (PTF): New #define.
11365         (__libc_cleanup_region_start): Wrap function name with PTF call.
11366         (__libc_cleanup_region_end): Likewise.
11367         (__libc_cleanup_end): Likewise.
11368
11369         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
11370         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
11371         * pthread_key_create.c: Add __pthread_key_create_internal alias.
11372         * pthreadP.h: Add prototypes.
11373
11374         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
11375         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
11376         __pthread_rwlock_unlock aliases.
11377         * pthreadP.h: Add prototypes for new aliases.
11378
11379         * pthreadP.h (struct pthead_functions): Moved to...
11380         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
11381         * init.c (pthread_functions): Add initializers for new elements.
11382
11383         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
11384         __pthread_cleanup_pop_restore aliases.
11385         * pthreadP.h: Add prototypes.
11386
11387         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
11388         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
11389         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
11390         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
11391         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
11392         * pthreadP.h: Adjust prototypes and callers.
11393
11394 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
11395
11396         * Makefile (tests): Add tst-cancel7.
11397         (tst-cancel7-ARGS): New variable.
11398         * tst-cancel7.c: New file.
11399
11400         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
11401         around gcc defficiencies.
11402         * old_pthread_cond_signal.c: Likewise.
11403         * old_pthread_cond_timedwait.c: Likewise.
11404         * old_pthread_cond_wait.c: Likewise.
11405
11406         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
11407
11408 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
11409
11410         * Makefile (tests): Add tst-cond7.
11411         * tst-cond7.c: New file.
11412
11413         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
11414         (condvar_cleanup): Get condvar address from the right place.
11415
11416         * atomic.h: Correct definitions of atomic_full_barrier,
11417         atomic_read_barrier, atomic_write_barrier.
11418
11419         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
11420         race-free.
11421         * old_pthread_cond_signal.c: Likewise.
11422         * old_pthread_cond_timedwait.c: Likewise.
11423         * old_pthread_cond_wait.c: Likewise.
11424
11425 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
11426
11427         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
11428
11429 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
11430
11431         * pthreadP.h (pthread_cond_2_0_t): New type.
11432         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
11433         Use new type for the 2.0 condvar function prototypes.
11434         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
11435         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
11436         parameter.
11437         * old_pthread_cond_destroy.c: Likewise.
11438         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
11439         * old_pthread_cond_signal.c: Likewise.
11440         * old_pthread_cond_timedwait.c: Likewise.
11441         * old_pthread_cond_wait.c: Likewise.
11442
11443         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
11444         (__pthread_cond_wait): Don't save cancellation mode and seq value
11445         in same location.
11446
11447         * herrno.c (__h_errno_location): Don't define as weak.
11448
11449 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
11450
11451         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
11452         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
11453         and pthread_cond_wait.
11454         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
11455         Renamed to...
11456         (__pthread_cond_broadcast_2_0): ... this.
11457         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
11458         Renamed to...
11459         (__pthread_cond_destroy_2_0): ... this.
11460         * old_pthread_cond_init.c (__old_pthread_cond_init):
11461         Renamed to...
11462         (__pthread_cond_init_2_0): ... this.
11463         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
11464         Renamed to...
11465         (__pthread_cond_signal_2_0): ... this.
11466         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
11467         Renamed to...
11468         (__pthread_cond_wait_2_0): ... this.
11469         * pthread_cond_destroy.c: Include shlib-compat.h.
11470         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
11471         * pthread_cond_init.c: Include shlib-compat.h.
11472         (pthread_cond_init): Change strong_alias into versioned_symbol.
11473         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
11474         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
11475         fields.
11476         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
11477         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
11478         __pthread_cond_wait_2_0): New prototypes.
11479         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
11480         __old_pthread_cond_init, __old_pthread_cond_signal,
11481         __old_pthread_cond_wait): Removed.
11482         * init.c: Include shlib-compat.h.
11483         (pthread_functions): Guard ptr___pthread_attr_init_2_0
11484         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
11485         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
11486         ptr___pthread_cond_*_2_0 fields.
11487         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
11488         pthread_cond_*@GLIBC_2.0 compatibility symbols.
11489
11490         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
11491         LIBC_SIGACTION was not yet defined.
11492         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
11493         [!defined LIBC_SIGACTION] (__sigaction): New function and
11494         libc_hidden_weak.
11495         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
11496         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
11497
11498 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
11499
11500         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
11501
11502 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
11503
11504         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
11505         New, larger type definition.
11506         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
11507         implementation.
11508         * Versions [libpthread]: Add definitions for new pthread_cond_*
11509         interfaces for version GLIBC_2.3.2.
11510         * pthread_cond_init.c: Update initialization for new type definition.
11511         * Makefile (libpthread-routines): Remove pthread_cond_wait,
11512         pthread_cond_timedwait, pthread_cond_signal, and
11513         pthread_cond_broadcast.  Add old_pthread_cond_init,
11514         old_pthread_cond_destroy, old_pthread_cond_wait,
11515         old_pthread_cond_timedwait, old_pthread_cond_signal, and
11516         old_pthread_cond_broadcast.
11517         * old_pthread_cond_broadcast.c: New file.
11518         * old_pthread_cond_destroy.c: New file.
11519         * old_pthread_cond_init.c: New file.
11520         * old_pthread_cond_signal.c: New file.
11521         * old_pthread_cond_timedwait.c: New file.
11522         * old_pthread_cond_wait.c: New file.
11523         * pthreadP.h: Add prototypes for the compatibility interfaces.
11524
11525         * pthread_cond_destroy.c: Don't include <errno.h>.
11526
11527 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
11528
11529         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
11530         unnecessary zero offset when addressing MUTEX.
11531
11532 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
11533
11534         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
11535         __register_atfork.
11536         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
11537         for __register_atfork.
11538
11539 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
11540
11541         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
11542         instead of ASSEMBLER test macro.
11543
11544         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
11545         __libc_current_sigrtmax): Add libc_hidden_def.
11546
11547         * sysdeps/pthread/list.h: Remove assert.h include.
11548
11549 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
11550
11551         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
11552         __pthread_initialize_minimal_internal not
11553         __pthread_initialize_minimal.
11554
11555 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
11556
11557         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
11558         __pthread_initialize_minimal as hidden.
11559
11560         * init.c (__pthread_initialize_minimal_internal): Don't mark as
11561         constructor.
11562
11563 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
11564
11565         * Makefile ($(inst_libdir)/libpthread.so): Depend on
11566         $(common-objpfx)format.lds, include that into the output script.
11567         Fix comment.
11568         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
11569
11570 2002-12-28  Andreas Jaeger  <aj@suse.de>
11571
11572         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
11573         nsec resolution changes.
11574         (xstat64_conv): Likewise.
11575         (xstat32_conv): Likewise.
11576         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
11577         struct kernel_stat.
11578         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
11579         structs stat and stat64.
11580         * time/time.h (__timespec_defined): Define for __USE_MISC.
11581         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
11582
11583 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
11584
11585         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
11586         argument.
11587         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
11588         (pthread_exit): Use strong_alias to avoid warnings.
11589         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
11590         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
11591         ptr___pthread_attr_init_2_*.
11592         * init.c (pthread_functions): Adjust.
11593
11594 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
11595
11596         * forward.c: Make all functions available by default again.  It
11597         caused too much trouble.
11598
11599         * pt-siglongjmp.c: Removed.
11600
11601 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
11602
11603         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
11604         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
11605         * sysdeps/i386/Makefile: New file.
11606         * sysdeps/i386/tcb-offsets.sym: New file.
11607         * sysdeps/pthread/tcb-offsets.h: New file.
11608         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
11609         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
11610
11611         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
11612         __register_atfork...
11613         (GLIBC_2.3.2): ...here.
11614
11615 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
11616
11617         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
11618         pthread_attr_setstackaddr with __attribute_deprecated__.
11619
11620 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
11621
11622         * pt-system.c (system): Remove cancellation handling.
11623         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
11624         cancellation routines.
11625
11626 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
11627
11628         * descr.h: Include <dl-sysdep.h>.
11629         (struct pthread): Move header.data.list to the back of the struct.
11630         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
11631         (MULTIPLE_THREADS_OFFSET): Adjust offset.
11632         (SYSINFO_OFFSEET): Likewise.
11633
11634 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
11635
11636         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
11637         Define.
11638         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
11639         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
11640         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
11641         (USE_DL_SYSINFO): Undef.
11642
11643 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
11644
11645         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
11646         $(common-objpfx)libc.so.
11647         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
11648         it is bigger than pipe buffer size even on arches with bigger
11649         page size.
11650         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
11651
11652 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
11653
11654         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
11655         correct errno access for case that USE___THREAD is not defined.
11656
11657 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
11658
11659         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
11660         Patch by Marijn Ros <marijn@mad.scientist.com>.
11661
11662 2002-12-22  Roland McGrath  <roland@redhat.com>
11663
11664         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
11665
11666 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
11667
11668         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
11669
11670 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
11671
11672         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
11673         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
11674         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
11675
11676         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
11677         of int $0x80.
11678         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
11679         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
11680         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
11681         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
11682         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
11683         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
11684         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
11685         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
11686
11687         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
11688         sysenter.
11689         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
11690
11691         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
11692
11693         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
11694         in new TCB.
11695         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
11696         that sysinfo is properly initialized.
11697         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
11698         to 1 only for ld.so.
11699
11700         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
11701         RTLD_CORRECT_DYNAMIC_WEAK.
11702
11703 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
11704
11705         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
11706         Use return 0 as 6th argument to FORWARD4.
11707         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
11708
11709 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
11710
11711         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
11712         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
11713         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
11714         (INIT_SYSINFO): New #define.
11715         (TLS_TP_INIT): Use INIT_SYSINFO.
11716         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
11717         At test to make sure SYSINFO_OFFSET value is correct.
11718         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
11719
11720 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
11721
11722         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
11723         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
11724         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
11725         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
11726         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
11727         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
11728         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
11729
11730 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
11731
11732         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
11733         macro instead of using int $0x80 directly.
11734
11735         * sysdeps/pthread/bits/stdio-lock.h: New file.
11736         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
11737         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
11738         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
11739         * Makefile (routines): Add libc-lowlevelmutex.
11740
11741         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
11742         __i686.get_pc_thunk.dx.
11743
11744 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
11745
11746         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
11747         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
11748         ($(objpfx)tst-cancel-wrappers.out): New rule.
11749         * tst-cancel-wrappers.sh: New test.
11750         * tst-locale1.c: Include signal.h.
11751         (uselocale): Test static linking of __libc_current_sigrt*.
11752
11753 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
11754
11755         * Makefile (tests): Add tst-cancel6.
11756         * tst-cancel6.c: New file
11757
11758 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
11759
11760         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
11761         Define meaningfully for assembler as well.
11762         * pthreadP.h (struct pthread_functions): Remove
11763         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
11764         and ptr_pthread_attr_init_2_1 fields.
11765         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
11766         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
11767         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
11768         (FORWARD3): Define using FORWARD4.
11769         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
11770         versions.
11771         * pt-system.c: Remove duplicate stdlib.h include.
11772
11773 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
11774
11775         * sem_init.c: Define sem_init@GLIBC_2.0.
11776         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
11777         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
11778
11779         * flockfile.c: Moved to...
11780         * sysdeps/pthread/flockfile.c: ...here.  New file.
11781         * funlockfile.c: Moved to...
11782         * sysdeps/pthread/funlockfile.c: ...here.  New file.
11783         * ftrylockfile.c: Moved to...
11784         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
11785
11786 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
11787
11788         * libc-cancellation.c: Guard both function with
11789         #if !defined NOT_IN_libc.
11790         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
11791         automatically provided pthread wrappers.
11792         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
11793         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
11794         nor in libpthread.
11795         * pt-open.c: Removed.
11796         * pt-fcntl.c: Removed.
11797         * pt-fsync.c: Removed.
11798         * pt-lseek.c: Removed.
11799         * pt-msgrcv.c: Removed.
11800         * pt-msgsnd.c: Removed.
11801         * pt-msync.c: Removed.
11802         * pt-nanosleep.c: Removed.
11803         * pt-open64.c: Removed.
11804         * pt-pause.c: Removed.
11805         * pt-pread.c: Removed.
11806         * pt-pread64.c: Removed.
11807         * pt-pwrite.c: Removed.
11808         * pt-pwrite64.c: Removed.
11809         * pt-read.c: Removed.
11810         * pt-recv.c: Removed.
11811         * pt-recvfrom.c: Removed.
11812         * pt-recvmsg.c: Removed.
11813         * pt-send.c: Removed.
11814         * pt-sendto.c: Removed.
11815         * pt-sigtimedwait.c: Removed.
11816         * pt-sigwait.c: Removed.
11817         * pt-wait.c: Removed.
11818         * pt-waitpid.c: Removed.
11819         * pt-write.c: Removed.
11820         * pt-accept.c: Removed.
11821         * pt-close.c: Removed.
11822         * pt-connect.c: Removed.
11823         * pt-lseek64.c: Removed.
11824         * pt-sendmsg.c: Removed.
11825         * pt-tcdrain.c: Removed.
11826
11827 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
11828
11829         * init.c (__pthread_initialize_minimal_internal): Renamed from
11830         __pthread_initialize_minimal.  Make old name an alias.  This
11831         converts a normal relocation into a relative relocation.
11832
11833         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
11834
11835         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
11836         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
11837         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
11838         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
11839         pt-sigwaitinfo, pt-waitid, and pt-writev.
11840         * pt-creat.c: Removed.
11841         * pt-poll.c: Removed.
11842         * pt-pselect.c: Removed.
11843         * pt-readv.c: Removed.
11844         * pt-select.c: Removed.
11845         * pt-sigpause.c: Removed.
11846         * pt-sigsuspend.c: Removed.
11847         * pt-sigwaitinfo.c: Removed.
11848         * pt-waitid.c: Removed.
11849         * pt-writev.c: Removed.
11850
11851         * init.c (pthread_functions): New variable.
11852         (__pthread_initialize_minimal): Pass pointer to pthread_functions
11853         (or NULL) to __libc_pthread_init.
11854         * forward.c: Rewrite to use __libc:pthread_functions array to get
11855         function addresses.
11856         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
11857         prototype.
11858         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
11859         Take new parameter.  Copy content of variable pointed to by it
11860         to __libc_pthread_init.
11861
11862         * pthreadP.h (struct pthread_functions): New type.
11863         (__libc_pthread_init): Declare.
11864
11865         * pthread_attr_destroy.c: Add namespace protected alias.
11866         * pthread_attr_getdetachstate.c: Likewise.
11867         * pthread_attr_getinheritsched.c: Likewise.
11868         * pthread_attr_getschedparam.c: Likewise.
11869         * pthread_attr_getschedpolicy.c: Likewise.
11870         * pthread_attr_getscope.c: Likewise.
11871         * pthread_attr_setdetachstate.c: Likewise.
11872         * pthread_attr_setinheritsched.c: Likewise.
11873         * pthread_attr_setschedparam.c: Likewise.
11874         * pthread_attr_setschedpolicy.c: Likewise.
11875         * pthread_attr_setscope.c: Likewise.
11876         * pthread_cond_broadcast.c: Likewise.
11877         * pthread_cond_destroy.c: Likewise.
11878         * pthread_cond_init.c: Likewise.
11879         * pthread_cond_signal.c: Likewise.
11880         * pthread_cond_wait.c: Likewise.
11881         * pthread_condattr_destroy.c: Likewise.
11882         * pthread_condattr_init.c: Likewise.
11883         * pthread_equal.c: Likewise.
11884         * pthread_exit.c: Likewise.
11885         * pthread_getschedparam.c: Likewise.
11886         * pthread_self.c: Likewise.
11887         * pthread_setcancelstate.c: Likewise.
11888         * pthread_setschedparam.c: Likewise.
11889         * pthread_mutex_destroy.c: Likewise.
11890         * pthread_mutex_init.c: Likewise.
11891         * pthreadP.h: Add prototypes for the aliases.
11892
11893         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
11894         multiple_threads member in correct TCB to 1.
11895
11896         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
11897         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
11898         member of thread decriptor, otherwise return unconditionally 1.
11899
11900 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
11901
11902         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
11903         regular Linux version.  Remove file.
11904         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
11905         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
11906         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
11907         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
11908         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
11909         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
11910         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
11911         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
11912         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
11913         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
11914         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
11915         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
11916         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
11917         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
11918         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
11919         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
11920         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
11921         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
11922         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
11923         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
11924         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
11925         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
11926         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
11927         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
11928         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
11929         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
11930         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
11931         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
11932         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
11933         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
11934
11935 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
11936
11937         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
11938         * sysdeps/unix/sysv/linux/open.c: Removed.
11939         * sysdeps/unix/sysv/linux/fsync.c: Removed.
11940         * sysdeps/unix/sysv/linux/lseek.c: Removed.
11941         * sysdeps/unix/sysv/linux/msync.c: Removed.
11942         * sysdeps/unix/sysv/linux/read.c: Removed.
11943         * sysdeps/unix/sysv/linux/close.c: Removed.
11944         * sysdeps/unix/sysv/linux/creat.c: Removed.
11945         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
11946         * sysdeps/unix/sysv/linux/pause.c: Removed.
11947         * sysdeps/unix/sysv/linux/select.c: Removed.
11948         * sysdeps/unix/sysv/linux/write.c: Removed.
11949
11950 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
11951
11952         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
11953         element in TCB to see whether locking is needed.
11954
11955         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
11956         MULTIPLE_THREADS_OFFSET value is correct.
11957
11958         * sysdeps/unix/sysv/linux/close.c: New file.
11959         * sysdeps/unix/sysv/linux/connect.S: New file.
11960         * sysdeps/unix/sysv/linux/creat.c: New file.
11961         * sysdeps/unix/sysv/linux/fsync.c: New file.
11962         * sysdeps/unix/sysv/linux/llseek.c: New file.
11963         * sysdeps/unix/sysv/linux/lseek.c: New file.
11964         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
11965         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
11966         * sysdeps/unix/sysv/linux/msync.c: New file.
11967         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
11968         * sysdeps/unix/sysv/linux/open.c: New file.
11969         * sysdeps/unix/sysv/linux/open64.c: New file.
11970         * sysdeps/unix/sysv/linux/pause.c: New file.
11971         * sysdeps/unix/sysv/linux/poll.c: New file.
11972         * sysdeps/unix/sysv/linux/pread.c: New file.
11973         * sysdeps/unix/sysv/linux/pread64.c: New file.
11974         * sysdeps/unix/sysv/linux/pselect.c: New file.
11975         * sysdeps/unix/sysv/linux/pwrite.c: New file.
11976         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
11977         * sysdeps/unix/sysv/linux/readv.c: New file.
11978         * sysdeps/unix/sysv/linux/recv.S: New file.
11979         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
11980         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
11981         * sysdeps/unix/sysv/linux/select.c: New file.
11982         * sysdeps/unix/sysv/linux/send.S: New file.
11983         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
11984         * sysdeps/unix/sysv/linux/sendto.S: New file.
11985         * sysdeps/unix/sysv/linux/sigpause.c: New file.
11986         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
11987         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
11988         * sysdeps/unix/sysv/linux/sigwait.c: New file.
11989         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
11990         * sysdeps/unix/sysv/linux/system.c: New file.
11991         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
11992         * sysdeps/unix/sysv/linux/wait.c: New file.
11993         * sysdeps/unix/sysv/linux/waitid.c: New file.
11994         * sysdeps/unix/sysv/linux/waitpid.c: New file.
11995         * sysdeps/unix/sysv/linux/writev.c: New file.
11996         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
11997
11998         * pt-readv.c: Fix comment.
11999
12000 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
12001
12002         * tst-cleanup1.c: Include stdlib.h.
12003
12004         * tst-cancel5.c: New test.
12005         * Makefile (tests): Add tst-cancel5.
12006         (tst-cancel5): Link against libc.so libpthread.so in that order.
12007
12008 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
12009
12010         * forward.c (test_loaded): Prevent recursive calls.
12011
12012         * Makefile (routines): Add libc-cancellation.
12013         * libc-cancellation.c: New file.
12014         * descr.h (struct pthread): Add multiple_threads field.
12015         * allocatestack.c (allocate_stack): Initialize multiple_header field of
12016         new thread descriptor to 1.
12017         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
12018         Initialize multiple_thread field after successful thread creation.
12019         * cancellation.c (__do_cancel): Move to pthreadP.h.
12020         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
12021         (__pthread_disable_asynccancel): Add internal_function attribute.
12022         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
12023         * pthread_setcancelstate.c: Likewise.
12024         * pthread_setcanceltype.c: Likewise.
12025         * pthread_exit.c: Likewise.
12026         * pthreadP.h (CANCELLATION_P): Likewise.
12027         (__do_cancel): Define as static inline.
12028         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
12029         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
12030         declarations.
12031         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
12032         fields.  Define MULTIPLE_THREADS_OFFSET.
12033         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
12034         declaration.
12035         * sysdeps/unix/sysv/linux/accept.S: New file.
12036         * sysdeps/unix/sysv/linux/read.c: New file.
12037         * sysdeps/unix/sysv/linux/write.c: New file.
12038         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
12039         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
12040         initialization of __libc_locking_needed.
12041         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
12042         __libc_locking_needed, use multiple_threads field in TCB.
12043         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
12044
12045 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
12046
12047         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
12048         version.
12049         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
12050
12051         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
12052         access to __libc_locking_needed for PIC.
12053
12054 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
12055
12056         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
12057         declare for libc.so.
12058         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
12059         expression.
12060         (__libc_lock_lock): Put into statement expression.
12061         (__libc_lock_unlock): Remove trailing semicolon.
12062         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
12063
12064 2002-12-12  Roland McGrath  <roland@redhat.com>
12065
12066         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
12067         "m" constraint to refer to __libc_locking_needed.  Declare it here.
12068
12069 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
12070
12071         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
12072         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
12073         Initialize __libc_locking_needed.
12074         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
12075         instead of __register_pthread_fork_handler.
12076         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
12077         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
12078         fork-gen with libc_pthread_init.
12079         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
12080         of __register_pthread_fork_handler.
12081         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
12082         of __register_pthread_fork_handler.
12083         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
12084         __libc_locking_needed to determine whether lock prefix can be avoided.
12085         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
12086
12087 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
12088
12089         * Makefile (tests): Add tst-cleanup1.
12090         * tst-cleanup1.c: New file.
12091         * cancellation.c (__cleanup_thread): Removed.
12092         (__do_cancel): Remove call to __cleanup_thread.
12093         * pthreadP.h: Remove __cleanup_thread prorotype.
12094
12095         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
12096         Remember function and argument even if cancellation handler
12097         function is not available.
12098         (__libc_cleanup_region_end): Execute registered function directly if
12099         pthread functions are not available.
12100         (__libc_cleanup_end): Likewise.
12101
12102         * init.c (__pthread_initialize_minimal): Fix initialization in
12103         static lib by preventing gcc from being too clever.
12104
12105 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
12106
12107         * init.c (__pthread_initialize_minimal): Remove unneccesary
12108         sigaddset call.
12109
12110         * Makefile (tests): We can run tst-locale2 now.
12111
12112 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
12113
12114         * Versions: Remove duplicated sigwait entry.
12115
12116 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
12117
12118         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
12119         inside libpthread.
12120
12121         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
12122
12123         * pthreadP.h: Declare __pthread_enable_asynccancel and
12124         __pthread_disable_asynccancel.
12125         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
12126         (CANCEL_RESET): Use __pthread_disable_asynccancel.
12127         * cancellation.c (__pthread_enable_asynccancel): New function.
12128         (__pthread_disable_asynccancel): New function.
12129         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
12130         * pt-close.c: Likewise.
12131         * pt-connect.c: Likewise.
12132         * pt-creat.c: Likewise.
12133         * pt-fcntl.c: Likewise.
12134         * pt-fsync.c: Likewise.
12135         * pt-lseek.c: Likewise.
12136         * pt-lseek64.c: Likewise.
12137         * pt-msgrcv.c: Likewise.
12138         * pt-msgsnd.c: Likewise.
12139         * pt-msync.c: Likewise.
12140         * pt-nanosleep.c: Likewise.
12141         * pt-open.c: Likewise.
12142         * pt-open64.c: Likewise.
12143         * pt-pause.c: Likewise.
12144         * pt-poll.c: Likewise.
12145         * pt-pread.c: Likewise.
12146         * pt-pread64.c: Likewise.
12147         * pt-pselect.c: Likewise.
12148         * pt-pwrite.c: Likewise.
12149         * pt-pwrite64.c: Likewise.
12150         * pt-read.c: Likewise.
12151         * pt-readv.c: Likewise.
12152         * pt-recv.c: Likewise.
12153         * pt-recvfrom.c: Likewise.
12154         * pt-recvmsg.c: Likewise.
12155         * pt-select.c: Likewise.
12156         * pt-send.c: Likewise.
12157         * pt-sendmsg.c: Likewise.
12158         * pt-sendto.c: Likewise.
12159         * pt-sigpause.c: Likewise.
12160         * pt-sigsuspend.c: Likewise.
12161         * pt-sigtimedwait.c: Likewise.
12162         * pt-sigwait.c: Likewise.
12163         * pt-sigwaitinfo.c: Likewise.
12164         * pt-system.c: Likewise.
12165         * pt-tcdrain.c: Likewise.
12166         * pt-wait.c: Likewise.
12167         * pt-waitid.c: Likewise.
12168         * pt-waitpid.c: Likewise.
12169         * pt-write.c: Likewise.
12170         * pt-writev.c: Likewise.
12171         * pthread_join.c: Likewise.
12172         * pthread_timedjoin.c: Likewise.
12173
12174         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
12175         (__xpg_sigpause): New function.
12176         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
12177
12178 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
12179
12180         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
12181
12182         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
12183         _GI_pthread_cleanup_pop to pthreadP.h.
12184
12185         * ftrylockfile.c: Use _IO_lock_trylock instead of
12186         pthread_mutex_trylock.
12187
12188         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
12189         (CANCEL_RESET): Likewise.
12190         (__pthread_setcanceltype_): Declare.
12191         (__pthread_mutex_lock_internal): Declare.
12192         (__pthread_mutex_unlock_internal): Declare.
12193         (__pthread_once_internal): Declare.
12194         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
12195         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
12196
12197         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
12198         and pthread_mutex_unlock.
12199         * pthread_cond_wait.c: Likewise.
12200         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
12201         * pthread_mutex_unlock.c: Likewise.
12202
12203         * pthread_setcanceltype.c: Add additional alias
12204         __pthread_setcanceltype.
12205
12206         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
12207         * sem_open.c (sem_open): Likewise.
12208         Use __libc_open, __libc_write, and __libc_close instead of
12209         open, write, and close respectively.
12210
12211         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
12212         Rewrite as statement expression since it must return a value.
12213
12214         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
12215         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
12216         __pthread_kill.
12217
12218         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
12219         alias __pthread_once_internal.
12220
12221         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
12222
12223 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
12224
12225         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
12226         * tst-stdio1.c: New file.
12227         * tst-stdio2.c: New file.
12228
12229         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
12230
12231         * Makefile (tests): Comment out tst-locale2 for now.
12232         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
12233
12234         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
12235         -D_IO_MTSAFE_IO.
12236         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
12237         Use _IO_lock_init instead of explicit assignment.
12238
12239         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
12240         Define __libc_lock_* and __libc_lock_recursive macros with
12241         lowlevellock macros, not pthread mutexes.
12242
12243         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
12244         of pthread_mutex_lock.
12245         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
12246         instead of pthread_mutex_unlock.
12247
12248 2002-12-06  Roland McGrath  <roland@redhat.com>
12249
12250         * allocatestack.c (__stack_user): Use uninitialized defn.
12251         * init.c (__pthread_initialize_minimal): Initialize it here.
12252
12253 2002-12-05  Roland McGrath  <roland@redhat.com>
12254
12255         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
12256         string.
12257         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
12258
12259         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
12260         missing & here too.
12261
12262 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
12263
12264         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
12265         lowlevellock.
12266         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
12267         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
12268         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
12269         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
12270         for __libc_lock_* macros.
12271         * Makefile (routines): Add libc-lowlevellock.
12272
12273 2002-10-09  Roland McGrath  <roland@redhat.com>
12274
12275         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
12276         Under [__PIC__], call the function via the pointer fetched for
12277         comparison rather than a call by name that uses the PLT.
12278         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
12279         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
12280         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
12281         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
12282         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
12283
12284 2002-12-04  Roland McGrath  <roland@redhat.com>
12285
12286         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
12287
12288         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
12289         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
12290
12291         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
12292
12293 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
12294
12295         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
12296         a completely opaque, non-integer type.
12297         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
12298
12299 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
12300
12301         * sysdeps/i386/tls.h: Include stdlib.h.
12302         * sysdeps/x86_64/tls.h: Likewise.
12303
12304 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
12305
12306         * Makefile (tests): Add tst-locale2.
12307         (tests-static): Likewise.
12308         * tst-locale2.c: New file.
12309
12310         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
12311         volatile and add memory clobbers to lock operations.
12312
12313 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
12314
12315         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
12316         * sysdeps/i386/i486/bits/atomic.h: New file.
12317         * sysdeps/i386/i586/bits/atomic.h: New file.
12318         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
12319         include i486 version.
12320         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
12321         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
12322         Patch by Marijn Ros <marijn@mad.scientist.com>.
12323
12324         * allocatestack.c (get_cached_stack): Don't crash if we first
12325         found a stack with a larger size then needed.
12326         Reported by Hui Huang <hui.huang@sun.com>.
12327
12328         * Makefile (tests): Add tst-sysconf.
12329         * tst-sysconf.c: New file.
12330
12331         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
12332         PTHREAD_THREADS_MAX.
12333
12334 2002-12-02  Roland McGrath  <roland@redhat.com>
12335
12336         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
12337         Declare using hidden_proto instead of attribute_hidden, so there are
12338         non-.hidden static symbols for gdb to find.
12339         (__pthread_keys): Likewise.
12340         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
12341         * allocatestack.c (__stack_user): Likewise.
12342         * pthread_create.c (__pthread_keys): Likewise.
12343         (__nptl_threads_events, __nptl_last_event): Make these static instead
12344         of hidden.
12345         * pthread_key_create.c (__pthread_pthread_keys_max,
12346         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
12347
12348 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
12349
12350         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
12351         statically.
12352         * tst-locale1.c: New file.
12353
12354         * pthread_cond_timedwait.c: Include <stdlib.h>.
12355
12356         * Makefile (tests): Add tst-fork2 and tst-fork3.
12357         * tst-fork2.c: New file.
12358         * tst-fork3.c: New file.
12359
12360 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
12361
12362         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
12363
12364         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
12365         require it to 200112L.
12366
12367         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
12368         instruction only if HAVE_CMOV is defined.
12369         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
12370
12371         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
12372
12373         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
12374
12375         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
12376
12377         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
12378
12379 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
12380
12381         * sysdeps/x86_64/bits/atomic.h: New file.
12382
12383         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
12384         16-bit operations.
12385
12386         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
12387         possible since gettid cannot fail.
12388
12389         * sysdeps/x86_64/pthreaddef.h: New file.
12390
12391         * sysdeps/i386/pthreaddef.h (gettid): Removed.
12392
12393         * sysdeps/x86_64/pthread_spin_init.c: New file.
12394         * sysdeps/x86_64/pthread_spin_lock.c: New file.
12395         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
12396         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
12397
12398         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
12399         Add missing lock prefix.  Minute optimization.
12400
12401         * tst-spin2.c (main): Also check successful trylock call.
12402
12403         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
12404         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
12405
12406         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
12407         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
12408
12409         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
12410         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
12411         value in case of an error.  Add support for INTERNAL_SYSCALL.
12412
12413         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
12414         value in case of an error.
12415
12416         * sysdeps/x86_64/tls.h: New file.
12417
12418 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
12419
12420         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
12421         takes the array member name and the index as parameters.
12422         (THREAD_SETMEM_NC): Likewise.
12423         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
12424         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
12425         interfaces.
12426
12427         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
12428         to decide which code to use.
12429         (THREAD_SETMEM_NC): Likewise.
12430
12431         * allocatestack.c (queue_stack): Don't remove stack from list here.
12432         Do it in the caller.  Correct condition to prematurely terminate
12433         loop to free stacks.
12434         (__deallocate_stack): Remove stack from list here.
12435
12436 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
12437
12438         * Makefile (tests): Add tst-stack1.
12439         * tst-stack1.c: New file.
12440
12441         * allocatestack.c (allocate_stack): Initialize the TCB on a user
12442         provided stack.
12443
12444         * pthread_attr_getstack.c: Return bottom of the thread area.
12445
12446 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
12447
12448         * Makefile (libpthread-routines): Add pt-allocrtsig and
12449         pthread_kill_other_threads.
12450         * pt-allocrtsig.c: New file.
12451         * pthread_kill_other_threads.c: New file.
12452         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
12453         all three functions.
12454         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
12455         allocrtsig.
12456         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
12457         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
12458         and __libc_allocate_rtsig_private.
12459         * Versions (libpthread): Export pthread_kill_other_threads_np,
12460         __libc_current_sigrtmin, and __libc_current_sigrtmax.
12461
12462 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
12463
12464         * allocatestack.c (allocate_stack): stackaddr in attribute points to
12465         the end of the stack.  Adjust computations.
12466         When mprotect call fails dequeue stack and free it.
12467         * pthread_attr_setstack.c: Store top of the stack in stackaddr
12468         attribute.
12469         * pthread_getattr_np.c: Likewise.
12470
12471         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
12472         surprises.
12473
12474 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
12475
12476         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
12477         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
12478
12479 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
12480
12481         * pthread_getspecific.c: Optimize access to first 2nd-level array.
12482         * pthread_setspecific.c: Likewise.
12483
12484 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
12485
12486         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
12487         definitions.  Get them from the official place.
12488         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
12489
12490         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
12491         Use new CLONE_ flags in clone() calls.
12492
12493         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
12494         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
12495
12496         * Versions: Add pthread_* functions for libc.
12497         * forward.c: New file.
12498
12499         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
12500         errno-loc.
12501         * herrno.c: New file.
12502         * res.c: New file.
12503
12504         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
12505         sem_trywait, and sem_timedwait.  Add herrno and res.
12506         * sem_init.c: Don't initialize lock and waiters members.
12507         * sem_open.c: Likewise.
12508         * sem_post.c: Removed.
12509         * sem_wait.c: Removed.
12510         * sem_trywait.c: Removed.
12511         * sem_timedwait.c: Removed.
12512         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
12513         Includes full implementations of sem_post, sem_wait, sem_trywait,
12514         and sem_timedwait.
12515         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
12516         for new implementation.
12517         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
12518         and waiters fields.
12519
12520         * tst-sem3.c: Improve error message.
12521         * tst-signal3.c: Likewise.
12522
12523         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
12524         to tell the kernel about the termination futex and to initialize tid
12525         member.  Don't initialize main_thread.
12526         * descr.h (struct pthread): Remove main_thread member.
12527         * cancelllation.c (__do_cancel): Remove code handling main thread.
12528         The main thread is not special anymore.
12529
12530         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
12531         size of the stacks to stack_cache_actsize.
12532
12533         * pt-readv.c: Add missing "defined".
12534         * pt-sigwait.c: Likewise.
12535         * pt-writev.c: Likewise.
12536
12537 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
12538
12539         * Versions: Export __connect from libpthread.
12540         Patch by Luca Barbieri <ldb@ldb.ods.org>.
12541
12542         * Makefile (libpthread-routines): Add pt-raise.
12543         * sysdeps/unix/sysv/linux/raise.c: New file.
12544         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
12545         * sysdeps/generic/pt-raise.c: New file.
12546
12547         * pthread_cond_init.c: Initialize all data elements of the condvar
12548         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
12549
12550         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
12551         * pthread_create.c: Likewise.
12552
12553         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
12554         * tst-key1.c: New file.
12555         * tst-key2.c: New file.
12556         * tst-key3.c: New file.
12557
12558         * Versions: Export pthread_detach for version GLIBC_2.0.
12559         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
12560
12561 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
12562
12563         * pthread_key_create.c: Terminate search after an unused key was found.
12564         Patch by Luca Barbieri <ldb@ldb.ods.org>.
12565
12566         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
12567         Patch by Luca Barbieri <ldb@ldb.ods.org>.
12568
12569 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
12570
12571         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
12572         dynamic lookup for errno in PIC.
12573
12574         * allocatestack.c (get_cached_stack): Rearrange code slightly to
12575         release the stack lock as soon as possible.
12576         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
12577         the static TLS block.
12578         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
12579
12580         * cancellation.c: Renamed from cancelation.c.
12581         * Makefile: Adjust accordingly.
12582         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
12583         * cleanup_defer.c: Use CANCELLATION_P.
12584         * pthread_testcancel.c: Likewise.
12585         * descr.h: Fix spelling in comments.
12586         * init.c: Likewise.
12587         * pthread_getattr_np.c: Likewise.
12588         * pthread_getschedparam.c: Likewise.
12589         * pthread_setschedparam.c: Likewise.
12590         * Versions: Likewise.
12591
12592         * pt-pselect.c: New file.
12593         * Makefile (libpthread-routines): Add pt-pselect.
12594         * Versions: Add pselect.
12595
12596         * tst-cancel4.c: New file.
12597         * Makefile (tests): Add tst-cancel4.
12598
12599 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
12600
12601         * pthread_mutex_lock.c: Always record lock ownership.
12602         * pthread_mutex_timedlock.c: Likewise.
12603         * pthread_mutex_trylock.c: Likewise.
12604
12605         * pt-readv.c: New file.
12606         * pt-writev.c: New file.
12607         * pt-creat.c: New file.
12608         * pt-msgrcv.c: New file.
12609         * pt-msgsnd.c: New file.
12610         * pt-poll.c: New file.
12611         * pt-select.c: New file.
12612         * pt-sigpause.c: New file.
12613         * pt-sigsuspend.c: New file.
12614         * pt-sigwait.c: New file.
12615         * pt-sigwaitinfo.c: New file.
12616         * pt-waitid.c: New file.
12617         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
12618         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
12619         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
12620         * Versions: Add all the new functions.
12621
12622         * tst-exit1.c: New file.
12623         * Makefile (tests): Add tst-exit1.
12624
12625         * sem_timedwait.c: Minor optimization for more optimal fastpath.
12626
12627 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
12628
12629         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
12630
12631         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
12632         call.  pthread_join is an official cancellation point.
12633         * pthread_timedjoin.c: Likewise.
12634
12635         * pthread_cond_wait.c: Revert order in which internal lock are dropped
12636         and the condvar's mutex are retrieved.
12637         * pthread_cond_timedwait.c: Likewise.
12638         Reported by dice@saros.East.Sun.COM.
12639
12640 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
12641
12642         * pthreadP.h: Cut out all type definitions and move them...
12643         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
12644         * pthreadP.h: Include <internaltypes.h>.
12645
12646         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
12647         performance tweaks.
12648
12649         * sem_trywait.c: Shuffle #includes around to get right order.
12650         * sem_timedwait.c: Likewise.
12651         * sem_post.c: Likewise.
12652         * sem_wait.c: Likewise.
12653
12654         * nptl 0.3 released.
12655
12656         * Makefile (tests): Add tst-signal3.
12657         * tst-signal3.c: New file.
12658
12659 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
12660
12661         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
12662         the asms modify the sem object.
12663         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
12664
12665         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
12666         the actual members.
12667         * pthreadP.h (struct sem): New type.  Actual semaphore type.
12668         * semaphoreP.h: Include pthreadP.h.
12669         * sem_getvalue.c: Adjust to sem_t change.
12670         * sem_init.c: Likewise.
12671         * sem_open.c: Likewise.
12672         * sem_post.c: Likewise.
12673         * sem_timedwait.c: Likewise.
12674         * sem_trywait.c: Likewise.
12675         * sem_wait.c: Likewise.
12676
12677 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
12678
12679         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
12680         * tst-basic2.c: New file.
12681         * tst-exec1.c: New file.
12682         * tst-exec2.c: New file.
12683         * tst-exec3.c: New file.
12684
12685         * tst-fork1.c: Remove extra */.
12686
12687         * nptl 0.2 released.  The API for IA-32 is complete.