Implement interfaces to set and get names of threads.
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
2
3         [BZ #11390]
4         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
5         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
6         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
7         pthread_setname.
8         * Makefile (libpthread-routines): Add pthread_getname and
9         pthread_setname.
10         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
11
12 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
13
14         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
15         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
16         * sysdeps/pthread/Makefile: Remove csu section and rt section's
17         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
18
19 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
20
21         * pthread_cond_timedwait.c: Add check for
22         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
23         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
24         INTERNAL_SYSCALL.
25
26 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
27
28         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
29         and the call fails wake eventually waiting setxid threads.  Don't free
30         stack here if we try starting a thread.
31         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
32         if the clone call failed.
33
34 2010-03-08  Andreas Schwab  <schwab@redhat.com>
35
36         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
37         * allocatestack.c (get_cached_stack): Set setxid_futex.
38         (allocate_stack): Likewise.
39
40 2010-03-05  Andreas Schwab  <schwab@redhat.com>
41             Ulrich Drepper  <drepper@redhat.com>
42
43         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
44         it is creating a thread or it is just being created.
45         * pthread_create.c (start_thread): Wake setxid thread if it is
46         waiting.
47         (__pthread_create_2_1): Initialize setxid_futex.
48         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
49         is waiting.
50
51 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
52
53         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
54         Fix unwind info.
55         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
56
57 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
58
59         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
60         Fix pthread_cond_timedwait with requeue-PI.
61         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
62         Fix pthread_cond_wait with requeue-PI.
63
64 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
65
66         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
67         and pthread_mutexattr_setrobust for GLIBC_2.12.
68         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
69         * pthread_mutexattr_getrobust.c: Define alias
70         pthread_mutexattr_getrobust.
71         * pthread_mutexattr_setrobust.c: Define alias
72         pthread_mutexattr_setrobust.
73
74 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
75
76         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
77
78 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
79
80         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
81
82 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
83
84         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
85         call __gmon_start__.
86         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
87
88 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
89
90         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
91         using memset.
92
93 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
94
95         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
96         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
97         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
98         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
99         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
100         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
101         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
102         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
103
104 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
105
106         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
107         Don't update nwaiters after invalid timeout is recognized.
108
109 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
110
111         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
112         __gmon_start__.
113
114 2009-11-27  Andreas Schwab  <schwab@redhat.com>
115
116         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
117         THREAD_SELF->cancelhandling after returning from futex call.
118
119 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
120
121         * tst-sem13.c: New file.
122         * Makefile (tests): Add tst-sem13.
123
124 2009-11-22  Roland McGrath  <roland@redhat.com>
125
126         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
127         instead of recapitulating its contents.
128
129 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
130
131         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
132         optimizations and cleanups.
133
134 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
135
136         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
137         Remove redundant code. Fix cfi offsets.
138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
139         Fix cfi offsets.
140
141 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
142
143         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
144         reduce size of unwind info.
145
146         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
147         cfi directives.
148         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
149         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
150
151 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
152
153         [BZ #4457]
154         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
155         LIBGCC_S_SO.
156         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
157
158 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
159
160         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
161
162         [BZ #3270]
163         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
164         steps to avoid races with creation and terminations.
165         * nptl-init.c (sighandler_setxid): Adjust.
166         Patch by Daniel Jacobowitz.
167
168 2009-09-07  Andreas Schwab  <schwab@redhat.com>
169
170         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
171
172 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
173             Joseph Myers  <joseph@codesourcery.com>
174
175         [BZ #7094]
176         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
177         Initialize the sigev_notify field for newly created timer to make sure
178         the timer gets deleted from the active timer's list upon timer_delete.
179
180 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
181
182         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
183         Correct a logic error.
184
185 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
186
187         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
188         of the field in local variables.
189         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
190         variable and don't unconditionally clear it.
191
192 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
193
194         * pthread_create.c (start_thread): Hint to the kernel that memory for
195         the stack can be reused.  We do not mark all the memory.  The part
196         still in use and some reserve are kept.
197
198 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
199
200         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
201
202 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
203
204         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
205         directives.
206
207 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
208
209         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
210         directives.
211         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
212
213 2009-08-10  Andreas Schwab  <schwab@redhat.com>
214
215         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
216         (__pthread_cond_signal): Don't clobber register used for syscall
217         number.
218
219 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
220
221         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
222         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
223
224         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
225         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
226         register.
227
228 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
229
230         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
231         enabled by the special *_asynccancel functions.
232         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
233         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
234
235         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
236
237 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
238
239         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
240         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
241         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
242         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
243         since we can assume the special __*_{en,dis}able_asynccancel
244         functions.
245         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
246         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
247         and PTHREAD_CANCELED.
248
249 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
250
251         * descr.h: Better definition of *_BITMASK macros for cancellation.
252
253 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
254
255         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
256
257         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
258         dynamic linker might have to save.
259         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
260         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
261         printing.
262
263         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
264
265 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
266
267         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
268         New function.
269         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
270         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
271         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
272         requeue_pi for robust mutexes.
273         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
274         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
275         Don't only skip __pthread_mutex_cond_lock.  Call instead
276         __pthread_mutex_cond_lock_adjust.
277         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
278
279         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
280         optimization of PI mutex handling.
281
282 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
283
284         [BZ #10418]
285         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
286         instead of of _acq variants of cmpxchg.
287
288 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
289
290         * sysdeps/x86_64/configure.in: New file.
291
292         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
293         path when not using absolute timeout futex.
294
295 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
296
297         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
298         optimizations of last changes.
299         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
300
301 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
302
303         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
304         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
305         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
306         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
307         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
308         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
309         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
310         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
311
312         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
313         (__pthread_cond_timedwait): Make more robust.
314
315 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
316
317         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
318         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
319         directly use absolute timeout.
320
321         * tst-sem5.c (do_test): Add test for premature timeout.
322         * Makefile: Linu tst-sem5 with librt.
323
324         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
325         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
326         directly use absolute timeout.
327         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
328         (pthread_rwlock_timedrdlock): Likewise.
329
330         * tst-cond11.c (run_test): Add test to check that the timeout is
331         long enough.
332
333         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
334         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
335         directly use absolute timeout.
336
337         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
338         (__pthread_cond_wait): Convert to using exception handler instead of
339         registered unwind buffer.
340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
341         (__pthread_cond_timedwait): Likewise.
342
343 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
344
345         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
346         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
347         use absolute timeout.
348
349         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
350         handling of uncontested semaphore.
351
352         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
353         (__condvar_cleanup): Rewrite to use cfi directives instead of
354         hand-coded unwind tables.
355         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
356         Likewise.
357         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
358         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
359         Likewise.
360
361 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
362
363         * Makefile (libpthread-routines): Add pthread_sigqueue.
364         * Versions: Add pthread_sigqueue for GLIBC_2.11.
365         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
366         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
367
368 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
369
370         [BZ #10262]
371         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
372         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
373         cannot be assumed.
374         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
375
376 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
377
378         * libc-cancellation.c: Move __libc_cleanup_routine to...
379         * libc-cleanup.c: ...here.  New file.
380         * Makefile (routines): Add libc-cleanup.
381
382         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
383         test.
384         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
385         * sysdeps/pthread/librt-cancellation.c: Likewise.
386
387         [BZ #9924]
388         * nptl-init.c: Renamed from init.c.
389         * Makefile: Change all occurences of init.c to nptl-init.c.
390
391 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
392
393         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
394         to test when deciding on the delay.
395         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
396         * pthread_cancel.c: Close race between deciding on sending a signal
397         and setting the CANCELING_BIT bit.
398
399         * cancellation.c (__pthread_disable_asynccancel): Don't return if
400         thread is canceled.
401         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
402
403 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
404
405         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
406         is available.
407         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
408         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
409         * sysdeps/i386/tls.h: Likewise.
410         (tcbhead_t): Add __private_tm member.
411
412 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
413
414         * sem_open.c (sem_open): Rewrite initialization of initsem to
415         avoid warnings.
416
417         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
418         Avoid warning by using may_alias attribute on ptrhack.
419
420 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
421
422         [BZ #10090]
423         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
424         Check policy and priority for validity.
425         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
426
427 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
428
429         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
430         (__pthread_cond_timedwait): Change to use cfi directives instead of
431         hand-coded unwind sections.
432
433 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
434
435         * init.c (nptl_freeres): Compile only for SHARED.
436
437 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
438
439         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
440         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
441         FUTEX_BITSET_MATCH_ANY.
442
443 2009-02-27  Roland McGrath  <roland@redhat.com>
444
445         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
446         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
447
448 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
449
450         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
451         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
452         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
453         200112L to 200809L.
454
455 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
456
457         * sysdeps/pthread/pthread.h: The robust mutex functions are in
458         POSIX 2008.
459
460 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
461
462         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
463         Unify name of include protector macro.
464
465 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
466
467         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
468         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
469
470 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
471
472         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
473         pointer variables.
474
475         * allocatestack.c (__free_stacks): Renamed from free_stacks.
476         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
477         * init.c (nptl_freeres): New function.
478         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
479         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
480         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
481         variable.
482         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
483         load DSO.  Assign last.
484         (__unwind_freeres): New function.
485
486         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
487         for better debugging.  No need to use stack_list_add here.
488
489 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
490
491         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
492         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
493         instead of computing relative timeout.
494         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
495         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
496
497 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
498
499         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
500
501 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
502
503         * sysdeps/pthread/list.h (list_add): Initialize new element first.
504         (list_add_tail): Removed.
505
506 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
507
508         * (in_flight_stack): New variable.
509         (stack_list_del): New function.  Use instead of list_del.
510         (stack_list_add): New function.  Use instead of list_add when adding to
511         stack_cache and stack_used lists.
512         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
513         when the fork call interrupted another thread.
514
515 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
516
517         * init.c (__pthread_initialize_minimal_internal): Optimize test
518         FUTEX_CLOCK_REALTIME a bit.
519
520 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
521
522         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
523         only passing five parameters to FUTEX_WAIT_BITSET call.
524
525         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
526         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
527         instead of computing relative timeout.
528
529 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
530
531         * init.c (__pthread_initialize_minimal_internal): Check for
532         FUTEX_CLOCK_REALTIME flag.
533         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
534         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
535         relative timeout.
536
537         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
538         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
539         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
540         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
541         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
542         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
543
544 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
545
546         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
547         loop body instead of ; to avoid gcc warnings.
548         (pthread_cleanup_pop_restore_np): Likewise.
549         Patch by Caolán McNamara <caolanm@redhat.com>.
550
551 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
552
553         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
554         fast path here, for robust/PI/PP mutexes call
555         __pthread_mutex_lock_full.  Don't use switch, instead use a series
556         of ifs according to their probability.
557         (__pthread_mutex_lock_full): New function.
558         * pthread_mutex_unlock.c: Include assert.h.
559         (__pthread_mutex_unlock_usercnt): Handle only the
560         fast path here, for robust/PI/PP mutexes call
561         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
562         of ifs according to their probability.
563         (__pthread_mutex_unlock_full): New function.
564         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
565         (__pthread_mutex_lock_full): Define.
566
567 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
568
569         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
570         implementation.  Add necessary padding and.
571         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
572         words.
573
574 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
575
576         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
577         and FUTEX_WAKE_BITSET.
578
579 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
580
581         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
582         and FUTEX_WAKE_BITSET.
583         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
584         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
585         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
586         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
587
588 2008-11-25  Roland McGrath  <roland@redhat.com>
589
590         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
591         Subdirectories moved to ports repository as
592         sysdeps/.../nptl subdirectories.
593
594 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
595
596         [BZ #7008]
597         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
598         of old value.
599         * pthread_cond_init.c (__pthread_cond_init): Fix
600         cond->__data.__nwaiters initialization.
601         * Makefile (tests): Add tst-cond23.
602         * tst-cond23.c: New test.
603
604 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
605
606         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
607         arguments.
608         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
609         arguments.
610
611 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
612
613         [BZ #6955]
614         * pthread_mutex_lock.c: Add support for private PI mutexes.
615         * pthread_mutex_timedlock.c: Likewise.
616         * pthread_mutex_trylock.c: Likewise.
617         * pthread_mutex_unlock.c: Likewise.
618         Patch mostly by Ben Jackson <ben@ben.com>.
619
620 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
621
622         [BZ #6843]
623         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
624         Increase stack size for helper thread.
625
626 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
627
628         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
629         assembly with a clobber list for access registers a0 and a1.
630
631 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
632
633         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
634         to force runp->refcntr to be read from memory.
635
636 2008-09-08  Richard Guenther  <rguenther@suse.de>
637
638         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
639         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
640         lll_timedlock, lll_robust_timedlock, lll_unlock,
641         lll_robust_unlock): Promote private to int.
642
643 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
644
645         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
646         ARCH_RETRY_MMAP definitions.
647         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
648         Define MAP_STACK when not defined.
649         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
650         handling of ARCH_RETRY_MMAP.
651
652 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
653
654         * tst-align2.c (f): Print message that f is reached.
655
656 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
657
658         [BZ #6740]
659         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
660         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
661
662 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
663
664         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
665         SOCK_CLOEXEC if possible.
666
667 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
668
669         * Makefile (tests): Add tst-rwlock2a.
670         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
671         * tst-rwlock2a.c: New file.
672
673 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
674
675         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
676
677 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
678
679         * sysdeps/pthread/pthread.h: Fix typo in comment.
680
681 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
682
683         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
684         of CPU set to the kernel.
685
686 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
687
688         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
689         cfi directives.
690         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
691         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
692         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
693         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
694         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
695         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
696
697 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
698
699         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
700         cfi directives.
701         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
702         Likewise.
703         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
704         Likewise.
705         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
706         Likewise.
707
708 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
709
710         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
711
712 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
713
714         David S. Miller  <davem@davemloft.net>
715
716         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
717
718 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
719
720         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
721         __pshared correctly.
722         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
723         Likewise.
724         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
725         Likewise.
726         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
727         Likewise.
728         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
729         Likewise.
730         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
731
732 2008-04-14  David S. Miller  <davem@davemloft.net>
733
734         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
735         (__old_sem_wait): Fix argument to lll_futex_wait().
736
737 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
738
739         * pthread_create.c: Require pthread_mutex_trylock and
740         pthread_key_delete for libgcc.
741
742 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
743
744         [BZ #6020]
745         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
746         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
747         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
748
749 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
750
751         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
752         <linux/limits.h> has defined it.
753         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
754         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
755         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
756         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
757
758 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
759
760         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
761         of ASSEMBLER.
762         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
763         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
764
765 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
766
767         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
768         HAVE_DL_DISCOVER_OSVERSION.
769         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
770         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
771
772 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
773
774         [BZ #5778]
775         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
776         _POSIX_CHOWN_RESTRICTED value to zero.
777
778 2008-01-31  Roland McGrath  <roland@redhat.com>
779
780         * Makefile (omit-deps): Variable removed.
781
782 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
783
784         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
785         unnecessary addr32 prefix.
786
787 2008-01-29  Roland McGrath  <roland@redhat.com>
788
789         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
790
791 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
792
793         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
794
795 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
796
797         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
798         a scratch register.
799         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
800         (__lll_lock_wait_private): Fix typo.
801         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
802         (pthread_barrier_wait): Likewise.  Adjust XADD use.
803         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
804         Adjust XADD use.
805         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
806         (pthread_rwlock_timedrdlock): Return correct return value.
807         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
808         (pthread_rwlock_timedwrlock): Likewise.
809
810 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
811
812         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
813         thread returns the program exits with an error code.
814
815 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
816
817         * pthread-errnos.sym: Add EOVERFLOW.
818         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
819         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
820         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
821         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
822
823 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
824
825         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
826         parameter.  Passed it as permission to mmap.
827         * allocatestack.c (allocate_stack): Pass prot as second parameter
828         to ARCH_RETRY_MMAP.
829
830 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
831
832         * tst-basic7.c: Allocate memory for the stack.
833
834         [BZ #5465]
835         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
836         (__pthread_cond_timedwait): Don't use VDSO.
837         Patch by Michal Januszewski.
838
839 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
840
841         [BZ #5455]
842         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
843         Allow label before pthread_cleanup_pop.
844         (pthread_cleanup_pop_restore_np): Likewise.
845
846 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
847
848         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
849         Store 2 before returning ETIMEDOUT.
850
851 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
852
853         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
854         Store 2 before returning ETIMEDOUT.
855         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
856         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
857         (__lll_lock_wait_private): Optimize.
858         (__lll_lock_wait): Likewise.
859
860 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
861
862         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
863         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
864         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
865
866 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
867
868         [BZ #5240]
869         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
870         If we time out, try one last time to lock the futex to avoid
871         losing a wakeup signal.
872         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
873         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
874
875         [BZ #5245]
876         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
877         if necessary.
878
879 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
880
881         [BZ #5245]
882         * allocatestack.c (allocate_stack): Change ENOMEM error in case
883         mmap failed to EAGAIN.
884         * Makefile (tests): Add tst-basic7.
885         * tst-basic7.c: New file.
886
887 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
888
889         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
890         Use __linkin_atfork.
891
892 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
893
894         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
895         missing line continuations.
896         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
897         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
898
899 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
900
901         [BZ #5220]
902         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
903         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
904         (struct timer): Add next element.
905         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
906         enqueue timer structure into __active_timer_sigev_thread list.
907         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
908         remove timer struct from __active_timer_sigev_thread.
909         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
910         Before using timer structure make sure it is still on the
911         __active_timer_sigev_thread list.  Keep lock until done.
912         Define __active_timer_sigev_thread and
913         __active_timer_sigev_thread_lock.
914
915 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
916
917         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
918         Redefine thread_atfork for use of ATFORK_MEM.
919         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
920         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
921         function.
922         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
923         Use atomic operation when removing first element of list.
924
925 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
926
927         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
928         routine instead of an alias to __new_sem_post.
929
930 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
931
932         * init.c (__pthread_initialize_minimal): Initialize word to appease
933         valgrind.
934
935 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
936
937         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
938         libc.so just clear NAME.
939         (__libc_rwlock_fini): Nop inside of libc.so.
940         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
941         all zeros.
942
943 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
944
945         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
946         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
947         unlocking failed.
948         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
949
950 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
951
952         [BZ #4938]
953         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
954         reclaimed stack if necessary.
955         * Makefile (tests): Add tst-tsd6.
956         * tst-tsd6.c: New file.
957
958 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
959
960         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
961         Add private argument.
962
963 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
964
965         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
966         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
967
968 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
969
970         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
971         (__lll_robust_timedlock): Pass private as last argument to
972         __lll_robust_timedlock_wait.
973         (__lll_unlock): Fix a pasto.
974
975 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
976
977         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
978         sparc_old_sem): New structs.
979         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
980         (__sem_wait_cleanup): New function.
981         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
982         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
983         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
984         lll_futex_wait.
985         (__old_sem_wait): New function.
986         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
987         nptl/sysdeps/unix/sysv/linux/sparc version.
988         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
989         Likewise.
990         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
991         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
992         (__new_sem_trywait): Use sparc_old_sem structure.
993         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
994         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
995         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
996         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
997         lll_futex_timed_wait.
998         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
999         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
1000         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1001         lll_futex_wake.
1002         (__old_sem_post): New function.
1003         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
1004         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
1005         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
1006         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
1007         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
1008         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
1009
1010 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1011
1012         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1013         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1014         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1015         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1016         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
1017         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1018         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1019         Use FUTEX_WAKE_OP.
1020         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1021         kernel-features.h and tcb-offsets.h.
1022         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1023         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1024         process private.
1025         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1026         tcb-offsets.h.
1027         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
1028         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1029         process private.
1030         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
1031         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1032         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1033         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1034         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1035         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1036         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1037
1038 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
1039
1040         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
1041         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1042         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
1043         lll_futex_timed_wait.
1044
1045         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
1046         __lll_robust_unlock): Rewrite as macros instead of inline functions.
1047         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
1048         __lll_robust_unlock, __lll_wait_tid): Likewise.
1049
1050 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1051
1052         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1053         Fix a pasto.
1054         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1055         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1056         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1057         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1058         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1059         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1060         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
1062         kernel-features.h.
1063         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1064         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1065         process private.  Switch DW_CFA_advance_loc1 and some
1066         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1067         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1068         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
1069         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1070         process private.  Switch DW_CFA_advance_loc{1,2} and some
1071         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1072         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
1073         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1074         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1075         Likewise.
1076         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1077         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1078         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1079         Likewise.
1080         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1081         (__pthread_cond_broadcast): Compare %r8 instead of
1082         dep_mutex-cond_*(%rdi) with $-1.
1083         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1084         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1085         of oring.
1086
1087 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1088
1089         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1090
1091 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1092
1093         * allocatestack.c: Include kernel-features.h.
1094         * pthread_create.c: Likewise.
1095         * pthread_mutex_init.c: Likewise.
1096         * init.c: Likewise.
1097         * pthread_cond_timedwait.c: Likewise.
1098         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1099         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1100         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1101         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1102         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1103         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1104         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1105         Likewise.
1106         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1107         Likewise.
1108         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1109         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1110         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1111         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1112
1113 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1114
1115         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1116         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1117         byte elements.  One of them is the new __shared element.
1118         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1119         adjust names of other padding elements.
1120         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1121         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1122         byte elements.  One of them is the new __shared element.
1123         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1124         adjust names of other padding elements.
1125         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1126         Renamed __pad1 element to __shared, adjust names of other padding
1127         elements.
1128         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1129         (pthread_rwlock_t): Likewise.
1130         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1131         typo.
1132
1133 2007-08-09  Anton Blanchard  <anton@samba.org>
1134
1135         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1136
1137 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1138
1139         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1140         <kernel-features.h>.
1141         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1142
1143 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1144
1145         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1146         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1147         dealing with robust mutexes.
1148         * pthread_mutex_timedlock.c: Likewise.
1149         * pthread_mutex_trylock.c: Likewise.
1150         * pthread_mutex_unlock.c: Likewise.
1151         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1152
1153 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1154
1155         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1156         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1157         (PTHREAD_MUTEX_PSHARED): Define.
1158         * pthread_mutex_init.c (__pthread_mutex_init): Set
1159         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1160         mutexes.
1161         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1162         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1163         as second argument to lll_lock.
1164         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1165         instead of its __data.__lock field.
1166         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1167         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1168         to lll_robust_lock.
1169         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1170         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1171         instead of mutex->__data.__kind directly, pass
1172         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1173         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1174         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1175         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1176         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1177         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1178         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1179         of mutex->__data.__kind directly.
1180         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1181         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1182         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1183         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1184         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1185         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1186         and lll_futex_wake.
1187         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1188         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1189         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1190         directly.
1191         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1192         Take mutex as argument instead of its __data.__lock field, pass
1193         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1194         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1195         __data.__lock field.
1196         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1197         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1198         to lll_robust_cond_lock.
1199         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1200         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1201         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1202         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1203         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1204         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1205         lll_futex_wait.
1206         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1207         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1208         lll_futex_wake.
1209         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1210         pshared variable, pass it to lll_lock, lll_unlock,
1211         lll_futex_timedwait and lll_futex_wake.
1212         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1213         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1214         and lll_futex_wake.
1215         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1216         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1217         macro.
1218         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1219         lll_futex_wake_unlock): Likewise.
1220         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1221         Likewise.
1222         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1223         lll_futex_wake_unlock): Likewise.
1224         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1225         Likewise.
1226         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1227         lll_futex_wake_unlock): Likewise.
1228         (lll_futex_wake): Fix a typo.
1229         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1230         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1231         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1232         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1233         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1234         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1235         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1236         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1237         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1238         (__pthread_cond_timedwait): Likewise.
1239         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1240         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1241
1242 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1243
1244         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1245         Don't use CGOTSETUP and CGOTRESTORE macros.
1246         (CGOTSETUP, CGOTRESTORE): Remove.
1247         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1248         @local symbol.
1249
1250 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1251
1252         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1253         definitions for private futexes.
1254         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1255         kernel-features.h and lowlevellock.h.  Use private futexes if
1256         they are available.
1257         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1258         (__lll_mutex_lock_wait): Rename to
1259         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1260         (__lll_mutex_timedlock_wait): Rename to ...
1261         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1262         Don't compile in for libc.so.
1263         (__lll_mutex_unlock_wake): Rename to ...
1264         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1265         (__lll_timedwait_tid): Use __NR_gettimeofday.
1266         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1267         the header from assembler.  Renamed all lll_mutex_* resp.
1268         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1269         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1270         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1271         Define.
1272         (__lll_lock_wait_private): Add prototype.
1273         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1274         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1275         __lll_unlock_wake): Likewise.
1276         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1277         if private is constant LLL_PRIVATE.
1278         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1279         lll_timedlock, lll_robust_timedlock): Add private argument.
1280         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1281         if private is constant LLL_PRIVATE.
1282         (lll_robust_unlock, lll_robust_dead): Add private argument.
1283         (lll_lock_t): Remove.
1284         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1285         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1286         lll_cond_wake, lll_cond_broadcast): Remove.
1287         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1288         kernel-features.h and lowlevellock.h.
1289         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1290         (LOAD_FUTEX_WAIT): Define.
1291         (__lll_robust_mutex_lock_wait): Rename to ...
1292         (__lll_robust_lock_wait): ... this.  Add private argument.
1293         Use LOAD_FUTEX_WAIT macro.
1294         (__lll_robust_mutex_timedlock_wait): Rename to ...
1295         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1296         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1297         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1298         lowlevellock.h.
1299         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1300         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1301         __lll_mutex_{lock,unlock}_*.
1302         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1303         lowlevellock.h and pthread-errnos.h.
1304         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1305         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1306         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1307         __lll_mutex_{lock,unlock}_*.
1308         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1309         lowlevellock.h and pthread-errnos.h.
1310         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1311         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1312         __lll_mutex_{lock,unlock}_*.
1313         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1314         lowlevellock.h.
1315         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1316         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1317         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1318         (__condvar_tw_cleanup): Likewise.
1319         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1320         lowlevellock.h.
1321         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1322         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1323         __lll_mutex_{lock,unlock}_*.
1324         ( __condvar_w_cleanup): Likewise.
1325         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1326         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1327         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1328         lowlevellock.h.
1329         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1330         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1331         __lll_mutex_{lock,unlock}_*.
1332         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1333         lowlevellock.h.
1334         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1335         FUTEX_PRIVATE_FLAG): Remove.
1336         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1337         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1338         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1339         lowlevellock.h.
1340         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1341         FUTEX_PRIVATE_FLAG): Remove.
1342         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1343         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1344         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1345         lowlevellock.h.
1346         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1347         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1348         __lll_mutex_{lock,unlock}_*.
1349         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1350         lowlevellock.h.
1351         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1352         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1353         __lll_mutex_{lock,unlock}_*.
1354         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1355         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1356         (__new_sem_post): Use standard initial exec code sequences.
1357         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1358         lowlevellock.h.
1359         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1360         FUTEX_PRIVATE_FLAG): Remove.
1361         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1362         exec code sequences.
1363         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1364         (__new_sem_trywait): Use standard initial exec code sequences.
1365         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1366         (__new_sem_wait): Use standard initial exec code sequences.
1367
1368 2007-07-31  Anton Blanchard  <anton@samba.org>
1369
1370         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1371         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1372         atomic_full_barrier.
1373
1374 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1375
1376         * allocatestack.c (stack_cache_lock): Change type to int.
1377         (get_cached_stack, allocate_stack, __deallocate_stack,
1378         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1379         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1380         as second argument to lll_lock and lll_unlock macros on
1381         stack_cache_lock.
1382         * pthread_create.c (__find_in_stack_list): Likewise.
1383         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1384         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1385         as second argument.
1386         * descr.h (struct pthread): Change lock and setxid_futex field
1387         type to int.
1388         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1389         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1390         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1391         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1392         Likewise.
1393         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1394         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1395         * pthreadP.h (__attr_list_lock): Change type to int.
1396         * pthread_attr_init.c (__attr_list_lock): Likewise.
1397         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1398         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1399         lll_{,un}lock.
1400         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1401         also for lll_futex_{wake,wait}.
1402         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1403         a pointer to const.
1404         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1405         LLL_SHARED as second argument to lll_{,un}lock.
1406         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1407         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1408         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1409         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1410         Likewise.
1411         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1412         as second argument to lll_{,un}lock macros on pd->lock.
1413         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1414         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1415         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1416         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1417         Likewise.
1418         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1419         Likewise.
1420         * pthread_once.c (once_lock): Change type to int.
1421         (__pthread_once): Pass LLL_PRIVATE as second argument to
1422         lll_{,un}lock macros on once_lock.
1423         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1424         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1425         rwlock->__data.__shared as second argument to them and similarly
1426         for lll_futex_w*.
1427         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1428         Likewise.
1429         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1430         Likewise.
1431         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1432         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1433         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1434         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1435         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1436         to lll_{,un}lock macros on __sem_mappings_lock.
1437         * sem_open.c (check_add_mapping): Likewise.
1438         (__sem_mappings_lock): Change type to int.
1439         * semaphoreP.h (__sem_mappings_lock): Likewise.
1440         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1441         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1442         instead of lll_*mutex_*, pass LLL_SHARED as last
1443         argument.
1444         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1445         pass LLL_SHARED as last argument.
1446         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1447         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1448         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1449         pass LLL_SHARED as last argument.
1450         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1451         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1452         LLL_SHARED as last argument.
1453         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1454         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1455         Similarly.
1456         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1457         __libc_lock_lock_recursive, __libc_lock_unlock,
1458         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1459         argument to lll_{,un}lock.
1460         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1461         _IO_lock_unlock): Likewise.
1462         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1463         compound literal.
1464         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1465         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1466         __fork_lock.
1467         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1468         free_mem): Likewise.
1469         (__fork_lock): Change type to int.
1470         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1471         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1472         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1473         lll_futex_wake.
1474         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1475         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1476         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1477         New function.
1478         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1479         pass it through to lll_futex_*wait, only compile in when
1480         IS_IN_libpthread.
1481         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1482         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1483         argument and pass it through to lll_futex_*wait.
1484         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1485         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1486         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1487         inline functions to __lll_* resp. __lll_robust_*.
1488         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1489         (lll_mutex_dead): Add private argument.
1490         (__lll_lock_wait_private): New prototype.
1491         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1492         __lll_robust_lock_timedwait): Add private argument to prototypes.
1493         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1494         call __lll_lock_wait_private, otherwise pass private to
1495         __lll_lock_wait.
1496         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1497         __lll_robust_timedlock): Add private argument, pass it to
1498         __lll_*wait functions.
1499         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1500         call __lll_unlock_wake_private, otherwise pass private to
1501         __lll_unlock_wake.
1502         (__lll_robust_unlock): Add private argument, pass it to
1503         __lll_robust_unlock_wake.
1504         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1505         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1506         argument, pass it through to __lll_* inline function.
1507         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1508         (lll_lock_t): Remove.
1509         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1510         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1511         lll_cond_wake, lll_cond_broadcast): Remove.
1512         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1513         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1514         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1515         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1516         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1517         the header from assembler.  Renamed all lll_mutex_* resp.
1518         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1519         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1520         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1521         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1522         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1523         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1524         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1525         Remove prototype.
1526         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1527         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1528         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1529         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1530         MULTIPLE_THREADS_OFFSET as another asm operand.
1531         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1532         MULTIPLE_THREADS_OFFSET as last asm operand, call
1533         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1534         otherwise pass private as another argument to __lll_lock_wait.
1535         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1536         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1537         private as another argument to __lll_*lock_wait call.
1538         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1539         MULTIPLE_THREADS_OFFSET as another asm operand, call
1540         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1541         otherwise pass private as another argument to __lll_unlock_wake.
1542         (lll_robust_unlock): Add private argument, pass private as another
1543         argument to __lll_unlock_wake.
1544         (lll_robust_dead): Add private argument, use __lll_private_flag
1545         macro.
1546         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1547         LLL_MUTEX_LOCK_INITIALIZER.
1548         (lll_lock_t): Remove.
1549         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1550         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1551         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1552         lll_cond_wake, lll_cond_broadcast): Remove.
1553         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1554         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1555         2007-05-2{3,9} changes.
1556         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1557         kernel-features.h and lowlevellock.h.
1558         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1559         (LOAD_FUTEX_WAIT): Rewritten.
1560         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1561         define.
1562         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1563         (__lll_mutex_lock_wait): Rename to ...
1564         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1565         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1566         (__lll_mutex_timedlock_wait): Rename to ...
1567         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1568         contains private argument.  Don't compile in for libc.so.
1569         (__lll_mutex_unlock_wake): Rename to ...
1570         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1571         Don't compile in for libc.so.
1572         (__lll_timedwait_tid): Use __NR_gettimeofday.
1573         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1574         kernel-features.h and lowlevellock.h.
1575         (LOAD_FUTEX_WAIT): Define.
1576         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1577         define.
1578         (__lll_robust_mutex_lock_wait): Rename to ...
1579         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1580         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1581         macro.
1582         (__lll_robust_mutex_timedlock_wait): Rename to ...
1583         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1584         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1585         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1586         lowlevellock.h.
1587         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1588         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1589         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1590         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1591         to __lll_lock_wait in %edx.
1592         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1593         Include lowlevellock.h and pthread-errnos.h.
1594         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1595         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1596         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1597         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1598         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1599         __lll_unlock_wake.
1600         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1601         Include lowlevellock.h and pthread-errnos.h.
1602         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1603         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1604         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1605         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1606         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1607         __lll_unlock_wake.
1608         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1609         Include lowlevellock.h.
1610         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1611         Don't define.
1612         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1613         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1614         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1615         __lll_unlock_wake.  Use __NR_gettimeofday.
1616         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1617         Include lowlevellock.h.
1618         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1619         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1620         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1621         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1622         and __lll_unlock_wake.
1623         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1624         Include lowlevellock.h.
1625         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1626         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1627         MUTEX(%ebx) address in %edx rather than %ecx to
1628         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1629         and __lll_unlock_wake.  Move return value from %ecx to %edx
1630         register.
1631         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1632         Include lowlevellock.h.
1633         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1634         Don't define.
1635         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1636         MUTEX(%ebp) address in %edx rather than %ecx to
1637         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1638         and __lll_unlock_wake.  Move return value from %ecx to %edx
1639         register.  Use __NR_gettimeofday.
1640         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1641         Include lowlevellock.h.
1642         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1643         Don't define.
1644         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1645         MUTEX(%ebp) address in %edx rather than %ecx to
1646         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1647         and __lll_unlock_wake.  Move return value from %ecx to %edx
1648         register.  Use __NR_gettimeofday.
1649         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1650         Include lowlevellock.h.
1651         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1652         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1653         MUTEX(%edi) address in %edx rather than %ecx to
1654         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1655         and __lll_unlock_wake.
1656         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1657         Include lowlevellock.h.
1658         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1659         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1660         MUTEX(%ebx) address in %edx rather than %ecx to
1661         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1662         and __lll_unlock_wake.  Move return value from %ecx to %edx
1663         register.
1664         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1665         lowlevellock.h.
1666         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1667         define.
1668         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1669         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1670         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1671         lowlevellock.h.
1672         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1673         (sem_timedwait): Use __NR_gettimeofday.
1674         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1675         lowlevellock.h.
1676         (LOCK): Don't define.
1677         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1678         lowlevellock.h.
1679         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1680         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1681         are waiters.
1682         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1683         2007-05-2{3,9} changes.
1684         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1685         kernel-features.h and lowlevellock.h.
1686         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1687         (LOAD_FUTEX_WAIT): Rewritten.
1688         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1689         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1690         (__lll_mutex_lock_wait): Rename to ...
1691         (__lll_lock_wait): ... this.  %esi is now private argument.
1692         Don't compile in for libc.so.
1693         (__lll_mutex_timedlock_wait): Rename to ...
1694         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1695         Don't compile in for libc.so.
1696         (__lll_mutex_unlock_wake): Rename to ...
1697         (__lll_unlock_wake): ... this.  %esi contains private argument.
1698         Don't compile in for libc.so.
1699         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1700         kernel-features.h and lowlevellock.h.
1701         (LOAD_FUTEX_WAIT): Define.
1702         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1703         (__lll_robust_mutex_lock_wait): Rename to ...
1704         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1705         Use LOAD_FUTEX_WAIT macro.
1706         (__lll_robust_mutex_timedlock_wait): Rename to ...
1707         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1708         private, use LOAD_FUTEX_WAIT macro.
1709         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1710         lowlevellock.h.
1711         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1712         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1713         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1714         __lll_lock_wait and __lll_unlock_wake.
1715         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1716         Include lowlevellock.h and pthread-errnos.h.
1717         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1718         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1719         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1720         pass LLL_SHARED in %esi to both __lll_lock_wait and
1721         __lll_unlock_wake.
1722         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1723         Include lowlevellock.h and pthread-errnos.h.
1724         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1725         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1726         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1727         pass LLL_SHARED in %esi to both __lll_lock_wait and
1728         __lll_unlock_wake.
1729         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1730         Include lowlevellock.h.
1731         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1732         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1733         pass LLL_SHARED in %esi to both __lll_lock_wait and
1734         __lll_unlock_wake.
1735         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1736         Include lowlevellock.h.
1737         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1738         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1739         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1740         and __lll_unlock_wake.
1741         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1742         Include lowlevellock.h.
1743         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1744         Don't define.
1745         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1746         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1747         and __lll_unlock_wake.
1748         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1749         Include lowlevellock.h.
1750         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1751         Don't define.
1752         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1753         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1754         and __lll_unlock_wake.
1755         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1756         Include lowlevellock.h.
1757         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1758         Don't define.
1759         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1760         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1761         and __lll_unlock_wake.
1762         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1763         Include lowlevellock.h.
1764         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1765         Don't define.
1766         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1767         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1768         and __lll_unlock_wake.
1769         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1770         Include lowlevellock.h.
1771         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1772         Don't define.
1773         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1774         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1775         and __lll_unlock_wake.
1776         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1777         lowlevellock.h.
1778         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1779         define.
1780         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1781         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1782         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1783         lowlevellock.h.
1784         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1785         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1786         lowlevellock.h.
1787         (LOCK): Don't define.
1788         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1789         lowlevellock.h.
1790         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1791         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1792         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1793         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1794         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1795         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1796         (__lll_lock_wait_private): New function.
1797         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1798         it to lll_futex_*wait.  Don't compile in for libc.so.
1799         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1800         Remove.
1801         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1802         (struct sparc_pthread_barrier): Remove.
1803         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1804         struct sparc_pthread_barrier.  Pass
1805         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1806         and lll_futex_wait macros.
1807         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1808         Remove.
1809         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1810         Include sparc pthread_barrier_wait.c instead of generic one.
1811
1812 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1813
1814         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1815
1816         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1817         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1818         %ecx.
1819         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1820         (pthread_rwlock_timedwrlock): Likewise.
1821         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1822         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1823
1824 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1825
1826         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1827
1828 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1829
1830         * tst-locale2.c (useless): Add return statement.
1831
1832 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1833
1834         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1835         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1836         * pthread_create.c (start_thread): Likewise.
1837         * init.c (sighandler_setxid): Likewise.
1838         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1839         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1840         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1841         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1842         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1843         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1844         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1845         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1846         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1847         Likewise.
1848         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1849         Likewise.
1850         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1851         Likewise.
1852         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1853         __rtld_notify): Likewise.
1854         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1855         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1856         __pthread_once): Likewise.
1857         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1858         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1859         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1860         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1861         (lll_futex_wait): Add private argument, define as wrapper around
1862         lll_futex_timed_wait.
1863         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1864         use __lll_private_flag macro.
1865         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1866         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1867         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1868         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1869         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1870         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1871         (lll_futex_wait): Add private argument, define as wrapper around
1872         lll_futex_timed_wait.
1873         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1874         use __lll_private_flag macro.
1875         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1876         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1877         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1878         Define.
1879         (lll_futex_timed_wait, lll_futex_wake): Use it.
1880         (lll_private_futex_wait, lll_private_futex_timed_wait,
1881         lll_private_futex_wake): Removed.
1882         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1883         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1884         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1885         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1886         (lll_futex_wait): Add private argument, define as wrapper around
1887         lll_futex_timed_wait.
1888         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1889         use __lll_private_flag macro.
1890         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1891         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1892         to lll_futex_*.
1893         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1894         (lll_private_futex_wait, lll_private_futex_timed_wait,
1895         lll_private_futex_wake): Removed.
1896         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1897         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1898         (lll_private_futex_wait, lll_private_futex_timed_wait,
1899         lll_private_futex_wake): Removed.
1900         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1901         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1902         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1903         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1904         (lll_futex_wait): Add private argument, define as wrapper around
1905         lll_futex_timed_wait.
1906         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1907         use __lll_private_flag macro.
1908         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1909         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1910         to lll_futex_*.
1911         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1912         Define.
1913         (lll_futex_timed_wait, lll_futex_wake): Use it.
1914         (lll_private_futex_wait, lll_private_futex_timed_wait,
1915         lll_private_futex_wake): Removed.
1916
1917 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1918
1919         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1920         of the structure for sparc32.
1921
1922 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1923
1924         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1925
1926 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1927
1928         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1929         code used when private futexes are assumed.
1930         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1931         Likewise.
1932
1933 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1934
1935         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1936         (__lll_private_flag): Define.
1937         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1938         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1939         __lll_private_flag.
1940         (lll_private_futex_wait, lll_private_futex_timedwait,
1941         lll_private_futex_wake): Define as wrapper around non-_private
1942         macros.
1943         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1944         (__lll_private_flag): Define.
1945         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1946         (lll_private_futex_wait, lll_private_futex_timedwait,
1947         lll_private_futex_wake): Define as wrapper around non-_private
1948         macros.
1949
1950 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1951
1952         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1953         parameter to lll_futex_wait call.
1954         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1955
1956         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1957         Replace lll_futex_wait with lll_private_futex_wait.
1958         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1959         Add LLL_SHARED parameter to lll_futex_wake().
1960
1961         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1962         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1963         lll_private_futex_wake.
1964         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1965         bit from private parm before syscall.
1966         (lll_futex_timed_wait): Likewise.
1967         (lll_futex_wake): Likewise.
1968         (lll_futex_wake_unlock): Likewise.
1969         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1970         (lll_robust_mutex_unlock): Likewise.
1971         (lll_mutex_unlock_force): Likewise.
1972         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1973
1974 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1975
1976         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1977         compilation when unconditionally using private futexes.
1978         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1979         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1980         Likewise.
1981         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1982         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1983
1984 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1985
1986         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1987         Define.
1988
1989 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1990
1991         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1992         kernel-features.h.
1993
1994 2007-05-16  Roland McGrath  <roland@redhat.com>
1995
1996         * init.c (__nptl_initial_report_events): New variable.
1997         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1998         to that.
1999
2000 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
2001
2002         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
2003         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2004
2005 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
2006
2007         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
2008         implementation.
2009
2010 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
2011
2012         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
2013         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
2014         * pthread_mutex_timedlock.c: Likewise.
2015         * pthread_mutex_trylock.c: Likewise.
2016         * pthread_mutex_unlock.c: Likewise.
2017
2018 2007-06-17  Andreas Schwab  <schwab@suse.de>
2019
2020         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
2021         sections.
2022
2023 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
2024
2025         * allocatestack.c (allocate_stack): Make code compile if
2026         __ASSUME_PRIVATE_FUTEX is set.
2027
2028 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2029
2030         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
2031         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
2032         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
2033         (__pthread_rwlock_wrlock): Likewise.
2034         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2035         (pthread_rwlock_timedrdlock): Likewise.
2036         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2037         (pthread_rwlock_timedwrlock): Likewise.
2038         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
2039         (__pthread_rwlock_unlock): Likewise.
2040
2041 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2042
2043         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
2044         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
2045         Split __flags into __flags, __shared, __pad1 and __pad2.
2046         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
2047         futexes if they are available.
2048         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
2049         in libc-lowlevellock.S allow using private futexes.
2050         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2051         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
2052         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
2053         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
2054         lll_private_futex_timed_wait and lll_private_futex_wake.
2055         (lll_robust_mutex_unlock): Fix typo.
2056         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
2057         field in futex command setup.
2058         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
2059         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
2060         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2061         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
2062         if they are available.  Remove clear_once_control.
2063         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
2064         futexes if they are available.
2065         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2066         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2067         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2068         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2069         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
2070         Wake only when there are waiters.
2071         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
2072         support.  Indicate that there are waiters.  Remove unnecessary
2073         extra cancellation test.
2074         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
2075         left-over duplication of __sem_wait_cleanup.
2076
2077 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2078
2079         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2080         parameter to lll_futex_wait, lll_futex_timed_wait, and
2081         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2082         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2083         lll_private_futex_wake.
2084         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2085         * allocatestack.c: Adjust use of lll_futex_* macros.
2086         * init.c: Likewise.
2087         * lowlevellock.h: Likewise.
2088         * pthread_barrier_wait.c: Likewise.
2089         * pthread_cond_broadcast.c: Likewise.
2090         * pthread_cond_destroy.c: Likewise.
2091         * pthread_cond_signal.c: Likewise.
2092         * pthread_cond_timedwait.c: Likewise.
2093         * pthread_cond_wait.c: Likewise.
2094         * pthread_create.c: Likewise.
2095         * pthread_mutex_lock.c: Likewise.
2096         * pthread_mutex_setprioceiling.c: Likewise.
2097         * pthread_mutex_timedlock.c: Likewise.
2098         * pthread_mutex_unlock.c: Likewise.
2099         * pthread_rwlock_timedrdlock.c: Likewise.
2100         * pthread_rwlock_timedwrlock.c: Likewise.
2101         * pthread_rwlock_unlock.c: Likewise.
2102         * sysdeps/alpha/tls.h: Likewise.
2103         * sysdeps/i386/tls.h: Likewise.
2104         * sysdeps/ia64/tls.h: Likewise.
2105         * sysdeps/powerpc/tls.h: Likewise.
2106         * sysdeps/pthread/aio_misc.h: Likewise.
2107         * sysdeps/pthread/gai_misc.h: Likewise.
2108         * sysdeps/s390/tls.h: Likewise.
2109         * sysdeps/sh/tls.h: Likewise.
2110         * sysdeps/sparc/tls.h: Likewise.
2111         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2112         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2113         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2114         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2115         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2116         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2117         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2118         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2119         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2120         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2121         Likewise.
2122         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2123         * sysdeps/x86_64/tls.h: Likewise.
2124
2125 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2126
2127         * pthread_getattr_np.c: No need to install a cancellation handler,
2128         this is no cancellation point.
2129         * pthread_getschedparam.c: Likewise.
2130         * pthread_setschedparam.c: Likewise.
2131         * pthread_setschedprio.c: Likewise.
2132         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2133         lll_unlock_wake_cb.
2134         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2135         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2136         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2137         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2138         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2139         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2140         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2141         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2142         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2143         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2144         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2145         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2146
2147         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2148         whether there are more than one thread makes no sense here since
2149         we only call the slow path if the locks are taken.
2150         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2151
2152         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2153         COND_NWAITERS_SHIFT.
2154         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2155         COND_CLOCK_BITS.
2156         * pthread_cond_init.c: Likewise.
2157         * pthread_cond_timedwait.c: Likewise.
2158         * pthread_cond_wait.c: Likewise.
2159         * pthread_condattr_getclock.c: Likewise.
2160         * pthread_condattr_setclock.c: Likewise.
2161         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2162         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2163         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2164         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2165         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2166
2167 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2168
2169         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2170         unistd.h.
2171
2172         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2173         insn suffix.
2174         (THREAD_GSCOPE_GET_FLAG): Remove.
2175         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2176         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2177         changes.
2178         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2179         (THREAD_GSCOPE_GET_FLAG): Remove.
2180         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2181         instead of THREAD_GSCOPE_GET_FLAG.
2182         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2183         it.
2184         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2185         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2186         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2187         THREAD_GSCOPE_WAIT): Define.
2188         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2189         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2190         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2191         THREAD_GSCOPE_WAIT): Define.
2192         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2193         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2194         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2195         THREAD_GSCOPE_WAIT): Define.
2196         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2197         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2198         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2199         THREAD_GSCOPE_WAIT): Define.
2200
2201 2007-05-24  Richard Henderson  <rth@redhat.com>
2202
2203         * descr.h (struct pthread): Add header.gscope_flag.
2204         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2205         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2206         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2207         THREAD_GSCOPE_WAIT): Define.
2208
2209 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2210
2211         * init.c: Make it compile with older kernel headers.
2212
2213         * tst-initializers1.c: Show through exit code which test failed.
2214
2215         * pthread_rwlock_init.c: Also initialize __shared field.
2216         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2217         element in rwlock structure into four byte elements.  One of them is
2218         the new __shared element.
2219         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2220         Likewise.
2221         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2222         __shared, adjust names of other padding elements.
2223         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2224         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2225         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2226         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2227         FUTEX_PRIVATE_FLAG.
2228         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2229         futex to use private operations if possible.
2230         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2231         Likewise.
2232         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2233         Likewise.
2234         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2235         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2236         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2237         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2238         Likewise.
2239         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2240         Likewise.
2241         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2242         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2243
2244 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2245
2246         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2247         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2248         * pthread_rwlock_timedrdlock.c: Likewise.
2249         * pthread_rwlock_tryrdlock.c: Likewise.
2250
2251         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2252         optimization.
2253
2254         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2255         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2256         duplication of __sem_wait_cleanup.
2257
2258         * allocatestack.c: Revert last change.
2259         * init.c: Likewise.
2260         * sysdeps/i386/tls.h: Likewise.
2261         * sysdeps/x86_64/tls.h: Likewise.
2262         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2263         header structure.
2264         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2265
2266         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2267         Add private field.
2268         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2269         * pthread_barrier_init.c: Set private flag if pshared and private
2270         futexes are supported.
2271         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2272         private field in futex command setup.
2273         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2274
2275 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2276
2277         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2278         support.
2279         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2280         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2281         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2282         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2283         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2284
2285         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2286         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2287         fields in the structure.
2288         (__old_sem_init): New function.
2289         * sem_open.c: Initialize all fields of the structure.
2290         * sem_getvalue.c: Adjust for renamed element.
2291         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2292         (gen-as-const-headers): Add structsem.sym.
2293         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2294         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2295         struct new_sem.  Add struct old_sem.
2296         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2297         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2298         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2299         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2300         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2301         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2302         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2303         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2304         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2305         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2306         * tst-sem10.c: New file.
2307         * tst-sem11.c: New file.
2308         * tst-sem12.c: New file.
2309         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2310         of struct sem.
2311
2312 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2313             Jakub Jelinek  <jakub@redhat.com>
2314
2315         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2316         Move __pthread_enable_asynccancel right before futex syscall.
2317         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2318         Likewise.
2319
2320 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2321
2322         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2323         THREAD_COPY_PRIVATE_FUTEX): Define.
2324         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2325         THREAD_COPY_PRIVATE_FUTEX): Define.
2326         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2327         * init.c (__pthread_initialize_minimal_internal): Use
2328         THREAD_SET_PRIVATE_FUTEX.
2329
2330         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2331         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2332         THREAD_GSCOPE_FLAG_WAIT): Define.
2333         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2334         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2335         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2336         PTR_DEMANGLE.
2337         (THREAD_GSCOPE_GET_FLAG): Define.
2338         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2339         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2340         instead of ->header.gscope_flag directly.
2341
2342 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2343
2344         * init.c (__pthread_initialize_minimal_internal): Check whether
2345         private futexes are available.
2346         * allocatestack.c (allocate_stack): Copy private_futex field from
2347         current thread into the new stack.
2348         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2349         futexes if they are available.
2350         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2351         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2352         in libc-lowlevellock.S allow using private futexes.
2353         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2354         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2355         FUTEX_PRIVATE_FLAG.
2356         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2357         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2358         if they are available.
2359         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2360         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2361         * sysdeps/i386/tcb-offsets.sym: Likewise.
2362         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2363         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2364
2365 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2366
2367         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2368         Remove ptr_wait_lookup_done again.
2369         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2370         (__pthread_initialize_minimal_internal): Initialize
2371         _dl_wait_lookup_done pointer in _rtld_global directly.
2372         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2373         Remove code to code _dl_wait_lookup_done.
2374         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2375         encrypted for now.
2376
2377 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2378
2379         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2380         pthread_mutex_init failed with ENOTSUP.
2381
2382 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2383
2384         * allocatestack.c (__wait_lookup_done): New function.
2385         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2386         Add ptr_wait_lookup_done.
2387         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2388         * pthreadP.h: Declare __wait_lookup_done.
2389         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2390         Define macros to implement reference handling of global scope.
2391         * sysdeps/x86_64/tls.h: Likewise.
2392         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2393         Initialize GL(dl_wait_lookup_done).
2394
2395 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2396
2397         [BZ #4512]
2398         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2399         is detected.
2400         * pthread_mutex_timedlock.c: Likewise.
2401         * pthread_mutex_trylock.c: Likewise.
2402         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2403
2404         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2405         * tst-robust9.c: New file.
2406         * tst-robustpi9.c: New file.
2407
2408         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2409         unnecessary extra cancellation test.
2410
2411 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2412
2413         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2414         extra cancellation test.
2415         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2416
2417 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2418
2419         * descr.h (struct pthread): Rearrange members to fill hole in
2420         64-bit layout.
2421
2422         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2423         (__pthread_setaffinity_new): If syscall was successful and
2424         RESET_VGETCPU_CACHE is defined, use it before returning.
2425         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2426
2427 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2428
2429         [BZ #4455]
2430         * tst-align2.c: Include stackinfo.h.
2431         * tst-getpid1.c: Likewise.
2432
2433 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2434
2435         [BZ #4455]
2436         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2437         * tst-getpid1.c (do_test): Likewise.
2438
2439         [BZ #4456]
2440         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2441         (allocate_stack): Likewise.
2442
2443 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2444
2445         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2446         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2447         (__lll_robust_timedlock_wait): Likewise.
2448         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2449
2450 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2451
2452         [BZ #4465]
2453         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2454         * tst-cancel4.c (tf_fdatasync): New test.
2455
2456 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2457
2458         [BZ #4392]
2459         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2460         check mutexes like normal mutexes.
2461
2462         [BZ #4306]
2463         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2464         Initialize the whole sigevent structure to appease valgrind.
2465
2466 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2467
2468         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2469         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2470
2471 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2472
2473         * tst-locale1.c: Avoid warnings.
2474         * tst-locale2.c: Likewise.
2475
2476 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2477
2478         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2479         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2480
2481 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2482
2483         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2484         __extern_always_inline where appropriate.
2485         * sysdeps/pthread/pthread.h: Likewise.
2486
2487 2007-03-13  Richard Henderson  <rth@redhat.com>
2488
2489         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2490         separate cfi regions for the two subsections.
2491
2492 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2493
2494         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2495         new thread, don't just decrement it.
2496         Patch by Suzuki K P <suzuki@in.ibm.com>.
2497
2498 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2499
2500         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2501         PTHFCT_CALL definition.
2502
2503 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2504
2505         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2506         available, don't use it.
2507
2508 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2509
2510         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2511         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2512         call into the kernel to delay.
2513
2514 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2515
2516         * tst-initializers1.c: We want to test the initializers as seen
2517         outside of libc, so undefined _LIBC.
2518
2519         * pthread_join.c (cleanup): Avoid warning.
2520
2521 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2522
2523         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2524         (__lll_timedwait_tid): Add unwind info.
2525
2526         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2527         function table, mangle the pointers.
2528         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2529         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2530         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2531         demangle pointers before use.
2532         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2533         demangle pointer.
2534         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2535         * sysdeps/pthread/setxid.h: Likewise.
2536
2537 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2538
2539         * tst-rwlock7.c: Show some more information in case of correct
2540         behavior.
2541
2542 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2543
2544         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2545         (lll_futex_timed_wait): Undo part of last change, don't negate
2546         return value.
2547
2548 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2549
2550         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2551         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2552
2553 2006-12-28  David S. Miller  <davem@davemloft.net>
2554
2555         * shlib-versions: Fix sparc64 linux target specification.
2556
2557 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2558
2559         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2560         Adjust include path for pthread_barrier_wait.c move.
2561
2562 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2563
2564         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2565         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2566
2567 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2568
2569         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2570         6 argument cancellable syscalls.
2571         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2572         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2573         6 argument cancellable syscalls.
2574         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2575
2576 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2577
2578         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2579         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2580
2581 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2582
2583         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2584         __sync_lock_release instead of __sync_lock_release_si.
2585
2586 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2587
2588         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2589         Define.
2590         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2591         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2592         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2593         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2594         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2595         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2596         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2597         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2598         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2599         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2600         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2601
2602 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2603
2604         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2605         * pthread_barrier_wait.c: ...here.
2606         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2607         * pthread_cond_broadcast.c: ...here.
2608         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2609         * pthread_cond_signal.c: ...here.
2610         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2611         * pthread_cond_timedwait.c: ...here.
2612         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2613         * pthread_cond_wait.c: ...here.
2614         * sysdeps/pthread/pthread_once.c: Move to...
2615         * pthread_once.c: ...here.
2616         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2617         * pthread_rwlock_rdlock.c: ...here.
2618         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2619         * pthread_rwlock_timedrdlock.c: ...here.
2620         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2621         * pthread_rwlock_timedwrlock.c: ...here.
2622         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2623         * pthread_rwlock_unlock.c: ...here.
2624         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2625         * pthread_rwlock_wrlock.c: ...here.
2626         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2627         * pthread_spin_destroy.c: ...here.
2628         * sysdeps/pthread/pthread_spin_init.c: Move to...
2629         * pthread_spin_init.c: ...here.
2630         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2631         * pthread_spin_unlock.c: ...here.
2632         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2633         * pthread_getcpuclockid.c: ...here.
2634
2635         * init.c: USE_TLS support is now always enabled.
2636         * tst-tls5.h: Likewise.
2637         * sysdeps/alpha/tls.h: Likewise.
2638         * sysdeps/i386/tls.h: Likewise.
2639         * sysdeps/ia64/tls.h: Likewise.
2640         * sysdeps/powerpc/tls.h: Likewise.
2641         * sysdeps/s390/tls.h: Likewise.
2642         * sysdeps/sh/tls.h: Likewise.
2643         * sysdeps/sparc/tls.h: Likewise.
2644         * sysdeps/x86_64/tls.h: Likewise.
2645
2646 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2647
2648         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2649         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2650         failed.
2651
2652         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2653         Define to THREAD_SELF->header.multiple_threads.
2654         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2655         Likewise.
2656         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2657         Likewise.
2658         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2659         (SINGLE_THREAD_P): Likewise.
2660         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2661         (SINGLE_THREAD_P): Likewise.
2662         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2663         (SINGLE_THREAD_P): Likewise.
2664         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2665         (SINGLE_THREAD_P): Likewise.
2666         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2667         Likewise.
2668         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2669         (SINGLE_THREAD_P): Likewise.
2670         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2671         (SINGLE_THREAD_P): Likewise.
2672         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2673         Likewise.
2674
2675 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2676
2677         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2678         by default rather than 2_3_3.
2679
2680 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2681
2682         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2683         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2684         atomic_* instead of catomic_* macros.
2685
2686 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2687
2688         [BZ #3285]
2689         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2690         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2691         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2692         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2693         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2694         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2695         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2696         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2697         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2698         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2699         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2700         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2701         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2702
2703 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2704
2705         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2706         cancelable syscalls with six parameters.
2707
2708         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2709         operations instead of atomic_*.
2710
2711 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2712
2713         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2714
2715 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2716
2717         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2718         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2719         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2720         New file.
2721         * pthread_attr_setstack.c: Allow overwriting the version number of the
2722         new symbol.
2723         * pthread_attr_setstacksize.c: Likewise.
2724         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2725         it.
2726         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2727         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2728
2729 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2730
2731         [BZ #3251]
2732         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2733         Patch by Petr Baudis.
2734
2735 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2736
2737         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2738
2739         * tst-cancel2.c (tf): Loop as long as something was written.
2740
2741 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2742
2743         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2744         mutexes wake all mutexes.
2745         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2746         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2747         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2748
2749 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2750
2751         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2752         to guarantee the thread is always canceled.
2753
2754 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2755
2756         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2757         Include stdlib.h.
2758         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2759         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2760         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2761         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2762         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2763
2764 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2765
2766         [BZ #3123]
2767         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2768         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2769         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2770         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2771         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2772         * Makefile (tests): Add tst-cond22.
2773         * tst-cond22.c: New file.
2774
2775 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2776
2777         [BZ #3124]
2778         * descr.h (struct pthread): Add parent_cancelhandling.
2779         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2780         cancelhandling value to child.
2781         * pthread_create.c (start_thread): If parent thread was canceled
2782         reset the SIGCANCEL mask.
2783         * Makefile (tests): Add tst-cancel25.
2784         * tst-cancel25.c: New file.
2785
2786 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2787             Ulrich Drepper  <drepper@redhat.com>
2788
2789         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2790         counterp if it is already zero.
2791         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2792
2793 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2794             Roland McGrath  <roland@redhat.com>
2795
2796         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2797         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2798         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2799         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2800         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2801         lll_robust_mutex_timedlock, lll_mutex_unlock,
2802         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2803         Add _L_*_ symbols around the subsection.
2804         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2805         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2806
2807 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2808             Roland McGrath  <roland@redhat.com>
2809
2810         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2811         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2812         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2813         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2814         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2815         lll_robust_mutex_timedlock, lll_mutex_unlock,
2816         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2817         Add _L_*_ symbols around the subsection.
2818         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2819         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2820
2821 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2822
2823         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2824         change because it can disturb too much existing code.  If real hard
2825         reader preference is needed we'll introduce another type.
2826         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2827         (pthread_rwlock_timedwrlock): Likewise.
2828         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2829         Likewise.
2830
2831 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2832
2833         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2834         reader preference.
2835         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2836         (pthread_rwlock_timedwrlock): Likewise.
2837         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2838         Likewise.
2839
2840 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2841
2842         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2843         Only define ifdef SHARED.
2844
2845 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2846
2847         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2848         (free_stacks): ...here.
2849         (__free_stack_cache): New function.
2850         * pthreadP.h: Declare __free_stack_cache.
2851         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2852         ptr_freeres.
2853         * init.c (pthread_functions): Initialize ptr_freeres.
2854         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2855         New freeres function.
2856
2857 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2858
2859         [BZ #3018]
2860         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2861
2862 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2863
2864         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2865         _XOPEN_REALTIME_THREADS.
2866
2867 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2868
2869         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2870         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2871         HAVE_CLOCK_GETTIME_VSYSCALL.
2872         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2873
2874 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2875
2876         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2877         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2878         * descr.h (struct priority_protection_data): New type.
2879         (struct pthread): Add tpp field.
2880         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2881         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2882         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2883         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2884         TPP mutexes.
2885         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2886         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2887         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2888         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2889         * tpp.c: New file.
2890         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2891         boosted by TPP.
2892         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2893         * pthread_mutexattr_getprioceiling.c
2894         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2895         in the SCHED_FIFO priority range.
2896         * pthread_mutexattr_setprioceiling.c
2897         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2898         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2899         if mutex is not TPP.  Ceiling is now in __data.__lock.
2900         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2901         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2902         is now in __data.__lock.  Add locking.
2903         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2904         * Makefile (libpthread-routines): Add tpp.
2905         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2906         * tst-tpp.h: New file.
2907         * tst-mutexpp1.c: New file.
2908         * tst-mutexpp6.c: New file.
2909         * tst-mutexpp10.c: New file.
2910         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2911         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2912
2913 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2914
2915         [BZ #2843]
2916         * pthread_join.c (pthread_join): Account for self being canceled
2917         when checking for deadlocks.
2918         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2919         (tf1): Don't print anything after pthread_join returns, this would be
2920         another cancellation point.
2921         (tf2): Likewise.
2922         * tst-join6.c: New file.
2923         * Makefile (tests): Add tst-join6.
2924
2925 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2926
2927         [BZ #2892]
2928         * pthread_setspecific.c (__pthread_setspecific): Check
2929         out-of-range index before checking for unused key.
2930
2931         * sysdeps/pthread/gai_misc.h: New file.
2932
2933 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2934
2935         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2936         file.  Don't use sysctl.
2937         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2938         overwrite the file if this is likely not true.
2939
2940 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2941
2942         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2943         * Makefile (tests): Add tst-getpid3.
2944         * tst-getpid3.c: New file.
2945
2946 2006-07-30  Roland McGrath  <roland@redhat.com>
2947
2948         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2949
2950         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2951         (pause_not_cancel): New macro.
2952         (nanosleep_not_cancel): New macro.
2953         (sigsuspend_not_cancel): New macro.
2954         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2955         nanosleep_not_cancel macro from <not-cancel.h>.
2956         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2957         macro from <not-cancel.h>.
2958
2959 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2960             Jakub Jelinek  <jakub@redhat.com>
2961
2962         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2963         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2964         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2965         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2966         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2967         * pthread_mutex_lock.c: Likewise.
2968         * pthread_mutex_timedlock.c: Likewise.
2969         * pthread_mutex_trylock.c: Likewise.
2970         * pthread_mutex_unlock.c: Likewise.
2971         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2972         all mutexes.
2973         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2974         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2975         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2976         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2977         pthread-pi-defines.sym.
2978         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2979         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2980         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2981         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2982         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2983         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2984         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2985         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2986         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2987         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2988         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2989         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2990         * tst-mutex2.c: Likewise.
2991         * tst-mutex3.c: Likewise.
2992         * tst-mutex4.c: Likewise.
2993         * tst-mutex5.c: Likewise.
2994         * tst-mutex6.c: Likewise.
2995         * tst-mutex7.c: Likewise.
2996         * tst-mutex7a.c: Likewise.
2997         * tst-mutex8.c: Likewise.
2998         * tst-mutex9.c: Likewise.
2999         * tst-robust1.c: Likewise.
3000         * tst-robust7.c: Likewise.
3001         * tst-robust8.c: Likewise.
3002         * tst-mutexpi1.c: New file.
3003         * tst-mutexpi2.c: New file.
3004         * tst-mutexpi3.c: New file.
3005         * tst-mutexpi4.c: New file.
3006         * tst-mutexpi5.c: New file.
3007         * tst-mutexpi6.c: New file.
3008         * tst-mutexpi7.c: New file.
3009         * tst-mutexpi7a.c: New file.
3010         * tst-mutexpi8.c: New file.
3011         * tst-mutexpi9.c: New file.
3012         * tst-robust1.c: New file.
3013         * tst-robust2.c: New file.
3014         * tst-robust3.c: New file.
3015         * tst-robust4.c: New file.
3016         * tst-robust5.c: New file.
3017         * tst-robust6.c: New file.
3018         * tst-robust7.c: New file.
3019         * tst-robust8.c: New file.
3020         * Makefile (tests): Add the new tests.
3021
3022         * pthread_create.c (start_thread): Add some casts to avoid warnings.
3023         * pthread_mutex_destroy.c: Remove unneeded label.
3024
3025 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
3026
3027         * pthread_mutex_init.c (__pthread_mutex_init): Move some
3028         computations to compile time.
3029
3030 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
3031
3032         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
3033
3034 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
3035
3036         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
3037
3038 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
3039
3040         * pthread_key_create.c (__pthread_key_create): Do away with
3041         __pthread_keys_lock.
3042
3043         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3044         (__kernel_cpumask_size): Mark as hidden.
3045         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3046
3047         * sem_open.c (__sem_mappings_lock): Mark as hidden.
3048         * semaphoreP.h (__sem_mappings_lock): Likewise.
3049
3050 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
3051
3052         * pthread_atfork.c: Mark __dso_handle as hidden.
3053
3054 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
3055
3056         [BZ #2644]
3057         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
3058         the reload problem.  Change the one path in pthread_cancel_init
3059         which causes the problem.  Force gcc to reload.  Simplify callers.
3060         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
3061         (_Unwind_GetBSP): Undo last patch.
3062
3063 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3064
3065         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
3066         function pointer is reloaded after pthread_cancel_init calls.
3067
3068         [BZ #2644]
3069         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
3070         pointers are reloaded after pthread_cancel_init calls.
3071
3072 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
3073
3074         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
3075         __always_inline.
3076
3077 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3078
3079         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3080         Allocate new object which is passed to timer_sigev_thread so that
3081         the timer can be deleted before the new thread is scheduled.
3082
3083 2006-04-26  Roland McGrath  <roland@redhat.com>
3084
3085         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3086
3087 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3088
3089         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3090         suffix for conditional jumps.
3091         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3092         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3093         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3094         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3095         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3096         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3097
3098         * init.c (sigcancel_handler): Compare with correct PID even if the
3099         thread is in the middle of a fork call.
3100         (sighandler_setxid): Likewise.
3101         Reported by Suzuki K P <suzuki@in.ibm.com> .
3102
3103 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3104
3105         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3106
3107 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3108
3109         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3110         fails [Coverity CID 105].
3111
3112 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3113
3114         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3115
3116 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3117
3118         [BZ #2505]
3119         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3120         Define __lll_rel_instr using lwsync.
3121
3122 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3123
3124         * allocatestack.c (allocate_stack): Always initialize robust_head.
3125         * descr.h: Define struct robust_list_head.
3126         (struct pthread): Use robust_list_head in robust mutex list definition.
3127         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3128         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3129         (__pthread_initialize_minimal_internal): Register robust_list with
3130         the kernel.
3131         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3132         Declare __set_robust_list_avail.
3133         * pthread_create.c (start_thread): Register robust_list of new thread.
3134         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3135         waiters.
3136         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3137         number of users, it's unreliable.
3138         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3139         set_robust_list syscall is available.
3140         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3141         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3142         Set robust_head.list_op_pending before trying to lock a robust mutex.
3143         * pthread_mutex_timedlock.c: Likewise.
3144         * pthread_mutex_trylock.c: Likewise.
3145         * pthread_mutex_unlock.c: Likewise for unlocking.
3146         * Makefile (tests): Add tst-robust8.
3147         * tst-robust8.c: New file.
3148
3149 2006-03-08  Andreas Schwab  <schwab@suse.de>
3150
3151         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3152         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3153
3154 2006-03-05  Roland McGrath  <roland@redhat.com>
3155
3156         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3157         and $config_os doesn't match *linux*.
3158
3159 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3160
3161         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3162         Use __syscall_error.
3163         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3164         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3165         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3166         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3167         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3168         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3169
3170 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3171
3172         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3173
3174 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3175
3176         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3177         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3178         mutex.
3179         (__lll_robust_timedlock_wait): Likewise.
3180         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3181         (__lll_robust_lock_wait): Likewise.
3182         (__lll_robust_timedlock_wait): Likewise.
3183         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3184         (__lll_robust_lock_wait): Likewise.
3185         (__lll_robust_timedlock_wait): Likewise.
3186
3187 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3188
3189         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3190         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3191         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3192         lll_robust_mutex_unlock): Define.
3193         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3194
3195 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3196
3197         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3198         instead of <clone.S>.
3199
3200 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3201
3202         * Makefile (libpthread-routines): Add
3203         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3204         and pthread_mutex_[sg]etprioceiling.
3205         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3206         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3207         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3208         pthread_mutex_setprioceiling.
3209         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3210         PTHREAD_PRIO_PROTECT): New enum values.
3211         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3212         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3213         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3214         prototypes.
3215         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3216         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3217         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3218         Define.
3219         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3220         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3221         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3222         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3223         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3224         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3225         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3226         protocol mutexes.
3227         * pthread_mutex_getprioceiling.c: New file.
3228         * pthread_mutex_setprioceiling.c: New file.
3229         * pthread_mutexattr_getprioceiling.c: New file.
3230         * pthread_mutexattr_setprioceiling.c: New file.
3231         * pthread_mutexattr_getprotocol.c: New file.
3232         * pthread_mutexattr_setprotocol.c: New file.
3233
3234 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3235
3236         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3237
3238 2006-02-27  Roland McGrath  <roland@redhat.com>
3239
3240         * sysdeps/pthread/Subdirs: List nptl here too.
3241         * configure (libc_add_on_canonical): New variable.
3242
3243         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3244
3245         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3246         self to get main source tree's file.
3247         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3248         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3249         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3250         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3251         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3252         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3253         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3254         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3255         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3256         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3257         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3258         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3259         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3260
3261         * Makefile: Use $(sysdirs) in vpath directive.
3262
3263         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3264         (CPPFLAGS-timer_routines.c): Likewise.
3265
3266         * Makeconfig (includes): Variable removed.
3267
3268 2006-02-26  Roland McGrath  <roland@redhat.com>
3269
3270         * sysdeps/generic/pt-raise.c: Moved to ...
3271         * pt-raise.c: ... here.
3272         * sysdeps/generic/lowlevellock.h: Moved to ...
3273         * lowlevellock.h: ... here.
3274
3275 2006-02-23  Roland McGrath  <roland@redhat.com>
3276
3277         * descr.h (struct pthread): Add final member `end_padding'.
3278         (PTHREAD_STRUCT_END_PADDING): Use it.
3279
3280 2006-02-20  Roland McGrath  <roland@redhat.com>
3281
3282         * sysdeps/mips: Directory removed, saved in ports repository.
3283         * sysdeps/unix/sysv/linux/mips: Likewise.
3284
3285 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3286
3287         * tst-robust1.c: Add second mutex to check that the mutex list is
3288         handled correctly.
3289
3290 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3291
3292         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3293         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3294         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3295         lll_robust_mutex_unlock): New macros.
3296         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3297         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3298         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3299         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3300         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3301
3302 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3303
3304         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3305         definitions.
3306         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3307
3308 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3309
3310         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3311         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3312         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3313         (lll_robust_mutex_unlock): Likewise.
3314
3315 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3316
3317         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3318         Set robust_list.__next rather than robust_list.
3319         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3320         (__pthread_list_t): New typedef.
3321         (pthread_mutex_t): Replace __next and __prev fields with __list.
3322         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3323         (__pthread_list_t): New typedef.
3324         (pthread_mutex_t): Replace __next and __prev fields with __list.
3325         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3326         (__pthread_list_t, __pthread_slist_t): New typedefs.
3327         (pthread_mutex_t): Replace __next and __prev fields with __list.
3328         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
3329         (__pthread_list_t, __pthread_slist_t): New typedefs.
3330         (pthread_mutex_t): Replace __next and __prev fields with __list.
3331         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3332         (__pthread_list_t, __pthread_slist_t): New typedefs.
3333         (pthread_mutex_t): Replace __next and __prev fields with __list.
3334         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3335         (__pthread_slist_t): New typedef.
3336         (pthread_mutex_t): Replace __next field with __list.
3337
3338 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3339
3340         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3341         PTHREAD_MUTEX_OWNERDEAD.
3342         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3343         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3344         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3345         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3346         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3347         to PTHREAD_MUTEX_INCONSISTENT.
3348         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3349         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3350         * pthread_mutex_trylock.c: Likewise.
3351         * pthread_mutex_timedlock.c: Likewise.
3352         * pthread_mutex_unlock.c: Likewise.
3353         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3354         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3355         lowlevelrobustlock.sym.
3356         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3357         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3358         definitions.
3359         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3360         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3361         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3362         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3363         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3364
3365 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3366
3367         * allocatestack.c (allocate_stack): Initialize robust_list.
3368         * init.c (__pthread_initialize_minimal_internal): Likewise.
3369         * descr.h (struct xid_command): Pretty printing.
3370         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3371         robust_list.  Adjust macros.
3372         * pthread_create.c (start_thread): Adjust robust_list handling.
3373         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3374         but the owner for all robust mutex types.
3375         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3376         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3377         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3378         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3379
3380         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3381         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3382
3383 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3384
3385         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3386         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3387
3388 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3389
3390         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3391         Return status.
3392         (lll_futex_timed_wait): Define.
3393
3394 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3395
3396         * tst-cancel4.c: Test ppoll.
3397
3398 2006-01-18  Andreas Jaeger  <aj@suse.de>
3399
3400         [BZ #2167]
3401         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3402         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3403         by Jim Gifford <patches@jg555.com>.
3404
3405 2006-01-13  Richard Henderson  <rth@redhat.com>
3406
3407         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3408
3409 2006-01-10  Roland McGrath  <roland@redhat.com>
3410
3411         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3412         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3413         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3414         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3415         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3416         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3417         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3418         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3419         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3420         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3421
3422 2006-01-09  Roland McGrath  <roland@redhat.com>
3423
3424         * tst-initializers1-c89.c: New file.
3425         * tst-initializers1-c99.c: New file.
3426         * tst-initializers1-gnu89.c: New file.
3427         * tst-initializers1-gnu99.c: New file.
3428         * Makefile (tests): Add them.
3429         (CFLAGS-tst-initializers1-c89.c): New variable.
3430         (CFLAGS-tst-initializers1-c99.c): New variable.
3431         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3432         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3433
3434         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3435         Use __extension__ on anonymous union definition.
3436         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3437         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3438         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3439         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3440         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3441
3442 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3443
3444         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3445         Don't give the union a name because it changes the mangled name.
3446         Instead name the struct for __data.
3447         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3448         Likewise.
3449         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3450         Likewise.
3451
3452 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3453
3454         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3455         stack bias to mc_ftp field.
3456
3457 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3458
3459         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3460         being too clever and reloading the futex value where it shouldn't.
3461
3462 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3463
3464         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3465         correct type.
3466
3467 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3468
3469         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3470         Add cfi directives.
3471
3472 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3473
3474         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3475         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3476         rename in tcbhead_t.
3477
3478         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3479         Don't give the union a name because it changes the mangled name.
3480         Instead name the struct for __data.
3481         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3482         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3483         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3484         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3485         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3486         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3487
3488 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3489
3490         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3491         Return status.
3492         (lll_futex_timed_wait): Define.
3493         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3494         * sysdeps/pthread/aio_misc.h: New file.
3495
3496 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3497
3498         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3499
3500 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3501
3502         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3503         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3504         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3505
3506 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3507
3508         * tst-cancel24.cc: Use C headers instead of C++ headers.
3509
3510 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3511
3512         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3513         sparc-linux configured glibc.
3514         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3515         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3516         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3517         atomic_compare_and_exchange_val_24_acq instead of
3518         atomic_compare_and_exchange_val_acq.
3519         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3520         instead of atomic_exchange_rel.
3521         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3522         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3523         file.
3524         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3525         file.
3526         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3527         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3528         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3529         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3530         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3531         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3532         New file.
3533         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3534         New file.
3535         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3536         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3537         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3538         file.
3539         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3540         file.
3541         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3542
3543 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3544
3545         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3546         mutex initializers.
3547
3548 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3549
3550         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3551         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3552         THREAD_COPY_POINTER_GUARD): Define.
3553         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3554         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3555
3556 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3557
3558         * version.c: Update copyright year.
3559
3560 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3561
3562         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3563         .eh_frame section, use cfi_* directives.
3564         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3565
3566 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3567
3568         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3569         now.
3570
3571 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3572
3573         * sysdeps/pthread/sigaction.c: Removed.
3574         * sigaction.c: New file.
3575         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3576
3577 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3578
3579         * Makefile (tests): Add tst-signal7.
3580         * tst-signal7.c: New file.
3581
3582 2005-12-27  Roland McGrath  <roland@redhat.com>
3583
3584         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3585         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3586         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3587         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3588         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3589         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3590         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3591         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3592         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3593         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3594         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3595
3596 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3597
3598         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3599         and __prev field to pthread_mutex_t.
3600         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3601         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3602         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3603         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3604         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3605         to pthread_mutex_t.
3606
3607 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3608
3609         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3610         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3611         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3612         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3613         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3614         and PTHREAD_MUTEXATTR_FLAG_BITS.
3615         * descr.h (struct pthread): Add robust_list field and define
3616         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3617         * pthread_mutexattr_getrobust.c: New file.
3618         * pthread_mutexattr_setrobust.c: New file.
3619         * pthread_mutex_consistent.c: New file.
3620         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3621         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3622         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3623         Adjust pthread_mutex_t initializers.
3624         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3625         field to pthread_mutex_t.
3626         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3627         and __prev field to pthread_mutex_t.
3628         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3629         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3630         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3631         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3632         * pthread_mutexattr_gettype.c: Likewise.
3633         * pthread_mutexattr_setpshared.c: Likewise.
3634         * pthread_mutexattr_settype.c: Likewise.
3635         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3636         Initialize mutex kind according to robust flag.
3637         * pthread_mutex_lock.c: Implement local robust mutex.
3638         * pthread_mutex_timedlock.c: Likewise.
3639         * pthread_mutex_trylock.c: Likewise.
3640         * pthread_mutex_unlock.c: Likewise.
3641         * pthread_create.c (start_thread): Mark robust mutexes which remained
3642         locked as dead.
3643         * tst-robust1.c: New file.
3644         * tst-robust2.c: New file.
3645         * tst-robust3.c: New file.
3646         * tst-robust4.c: New file.
3647         * tst-robust5.c: New file.
3648         * tst-robust6.c: New file.
3649         * tst-robust7.c: New file.
3650         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3651         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3652         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3653         tst-robust5, tst-robust6, and tst-robust7.
3654
3655         * tst-typesizes.c: New file.
3656         * Makefile (tests): Add tst-typesizes.
3657
3658         * tst-once3.c: More debug output.
3659
3660 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3661
3662         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3663         missing after last change.
3664
3665         * version.c: Update copyright year.
3666
3667 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3668
3669         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3670         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3671         * pthread_mutex_trylock.c: Likewise.
3672         * pthread_mutex_timedlock.c: Likewise.
3673         * pthread_mutex_unlock.c: Likewise.
3674
3675 2005-12-22  Roland McGrath  <roland@redhat.com>
3676
3677         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3678         so that #include_next's search location is not reset to the -I..
3679         directory where <nptl/...> can be found.
3680
3681 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3682
3683         [BZ #1913]
3684         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3685         Fix unwind info.  Remove useless branch prediction prefix.
3686         * tst-cancel24.cc: New file.
3687         * Makefile: Add rules to build and run tst-cancel24.
3688
3689 2005-12-21  Roland McGrath  <roland@redhat.com>
3690
3691         * libc-cancellation.c: Use <> rather than "" #includes.
3692         * pt-cleanup.c: Likewise.
3693         * pthread_create.c: Likewise.
3694         * pthread_join.c: Likewise.
3695         * pthread_timedjoin.c: Likewise.
3696         * pthread_tryjoin.c: Likewise.
3697         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3698         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3699         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3700         * unwind.c: Likewise.
3701
3702 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3703
3704         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3705         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3706         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3707         THREAD_COPY_POINTER_GUARD): Define.
3708
3709 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3710
3711         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3712         rather than one.
3713         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3714         THREAD_COPY_POINTER_GUARD): Define.
3715         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3716         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3717         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3718         THREAD_COPY_POINTER_GUARD): Define.
3719         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3720         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3721         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3722         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3723         Use PTR_DEMANGLE for B0 if defined.
3724
3725 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3726
3727         * pthread_create.c (__pthread_create_2_1): Use
3728         THREAD_COPY_POINTER_GUARD if available.
3729         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3730         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3731         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3732         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3733         * sysdeps/x86_64/tls.h: Likewise.
3734
3735 2005-12-15  Roland McGrath  <roland@redhat.com>
3736
3737         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3738
3739 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3740
3741         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3742         sysdeps/generic.
3743         * errno-loc.c: New file.
3744
3745 2005-12-12  Roland McGrath  <roland@redhat.com>
3746
3747         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3748         adjustments before choosing stack size.  Update minimum stack size
3749         calculation to match allocate_stack change.
3750
3751 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3752
3753         * allocatestack.c (allocate_stack): Don't demand that there is an
3754         additional full page available on the stack beside guard, TLS, the
3755         minimum stack.
3756
3757 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3758
3759         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3760         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3761
3762         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3763         compiling 32-bit code we must define __cleanup_fct_attribute.
3764
3765 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3766
3767         [BZ #1920]
3768         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3769         __attribute__ instead of __attribute.
3770         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3771         (__cleanup_fct_attribute): Likewise.
3772
3773 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3774
3775         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3776         a write barrier before writing libgcc_s_getcfa.
3777
3778 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3779
3780         * sysdeps/unix/sysv/linux/configure: Removed.
3781
3782 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3783
3784         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3785         optional init_array/fini_array support.
3786
3787 2005-10-24  Roland McGrath  <roland@redhat.com>
3788
3789         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3790         versioned_symbol use.
3791
3792 2005-10-16  Roland McGrath  <roland@redhat.com>
3793
3794         * init.c (__pthread_initialize_minimal_internal): Even when using a
3795         compile-time default stack size, apply the minimum that allocate_stack
3796         will require, and round up to page size.
3797
3798 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3799
3800         * Makefile ($(test-modules)): Remove static pattern rule.
3801
3802 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3803             Ulrich Drepper  <drepper@redhat.com>
3804
3805         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3806         alignment in callback function.
3807         * Makefile: Add rules to build and run tst-align3.
3808         * tst-align3.c: New file.
3809
3810 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3811
3812         * allocatestack.c (setxid_signal_thread): Add
3813         INTERNAL_SYSCALL_DECL (err).
3814
3815 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3816
3817         * allocatestack.c (setxid_signal_thread): Need to use
3818         atomic_compare_and_exchange_bool_acq.
3819
3820 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3821             Jakub Jelinek  <jakub@redhat.com>
3822
3823         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3824         CANCEL_RESTMASK.
3825         (struct pthread): Move specific_used field to avoid padding.
3826         Add setxid_futex field.
3827         * init.c (sighandler_setxid): Reset setxid flag and release the
3828         setxid futex.
3829         * allocatestack.c (setxid_signal_thread): New function.  Broken
3830         out of the bodies of the two loops in __nptl_setxid.  For undetached
3831         threads check whether they are exiting and if yes, don't send a signal.
3832         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3833         * pthread_create.c (start_thread): For undetached threads, check
3834         whether setxid bit is set.  If yes, wait until signal has been
3835         processed.
3836
3837         * allocatestack.c (STACK_VARIABLES): Initialize them.
3838         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3839
3840 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3841
3842         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3843         waiters, awake all waiters on the associated mutex.
3844
3845 2005-09-22  Roland McGrath  <roland@redhat.com>
3846
3847         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3848         ../sysdeps/x86_64/hp-timing.h).
3849
3850 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3851
3852         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3853         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3854         (lll_futex_wake_unlock): Define.
3855         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3856         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3857         (lll_futex_wake_unlock): Define.
3858         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3859         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3860         (lll_futex_wake_unlock): Define.
3861         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3862         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3863         (lll_futex_wake_unlock): Define.
3864         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3865         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3866         (lll_futex_wake_unlock): Define.
3867         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3868         lll_futex_wake_unlock.
3869         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3870         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3871         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3872         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3873         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3874         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3875
3876 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3877
3878         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3879         Fix typo in register name.
3880
3881 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3882
3883         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3884         Use __sigfillset.  Document that sigfillset does the right thing wrt
3885         to SIGSETXID.
3886
3887 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3888
3889         [BZ #1102]
3890         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3891         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3892         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3893         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3894         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3895         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3896         in the structure.
3897         * Makefile (tests): Add tst-initializers1.
3898         (CFLAGS-tst-initializers1.c): Set.
3899         * tst-initializers1.c: New test.
3900
3901 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3902
3903         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3904         Make sure __flags are located at offset 48 from the start of the
3905         structure.
3906
3907 2005-07-02  Roland McGrath  <roland@redhat.com>
3908
3909         * Makeconfig: Comment fix.
3910
3911 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3912
3913         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3914         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3915         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3916         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3917         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3918         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3919         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3920         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3921         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3922         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3923
3924 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3925
3926         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3927         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3928         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3929         fields.
3930         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3931         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3932         field.  Put in sysinfo field unconditionally.
3933         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3934         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3935         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3936         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3937         fields.
3938         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3939         * pthread_create.c (__pthread_create_2_1): Use
3940         THREAD_COPY_STACK_GUARD macro.
3941         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3942         tests.
3943         * tst-stackguard1.c: New file.
3944         * tst-stackguard1-static.c: New file.
3945
3946 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3947
3948         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3949         Invoke CGOTSETUP and CGOTRESTORE.
3950         (CGOTSETUP, CGOTRESTORE): Define.
3951
3952 2005-05-29  Richard Henderson  <rth@redhat.com>
3953
3954         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3955         (tf_write, tf_writev): Use it.
3956         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3957         the system minimum.
3958
3959 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3960
3961         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3962         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3963         __librt_*_asynccancel@local.
3964
3965 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3966
3967         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3968         all occurrences of JUMPTARGET.  Instead append @local to labels.
3969
3970 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3971
3972         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3973         size/alignment of struct pthread rather than tcbhead_t.
3974         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3975         Likewise.
3976         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3977         Likewise.
3978         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3979         Likewise.
3980
3981 2005-05-19  Richard Henderson  <rth@redhat.com>
3982
3983         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3984         __sync_val_compare_and_swap, not explicit _si variant.
3985         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3986
3987 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3988
3989         [BZ #915]
3990         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3991
3992 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3993
3994         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3995         .eh_frame section, use cfi_* directives.
3996
3997 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3998
3999         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
4000         of "" includes.
4001
4002 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
4003
4004         [BZ #1075]
4005         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
4006         aio_write blocks.
4007
4008 2005-04-27  Roland McGrath  <roland@redhat.com>
4009
4010         * Makefile (tests): Remove tst-clock2.
4011
4012         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4013         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
4014         translating to the kernel clockid_t for our own process/thread clock.
4015
4016         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
4017
4018 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
4019
4020         * old_pthread_cond_init.c: Include <errno.h>.
4021         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
4022         process shared or uses clock other than CLOCK_REALTIME.
4023         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
4024
4025 2005-04-13  David S. Miller  <davem@davemloft.net>
4026
4027         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
4028         * sysdeps/sparc/sparc64/clone.S: New file.
4029
4030 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4031
4032         [BZ #1102]
4033         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
4034         __inline instead of inline.
4035         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
4036
4037 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
4038
4039         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
4040         functionally equivalent, but shorter instructions.
4041         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4042         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4043         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4044         Likewise.
4045         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
4046         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4047         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4048         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4049         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4050         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4051         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4052         Likewise.
4053         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4054         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4055         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4056         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4057         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4058
4059 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
4060
4061         * sysdeps/mips/Makefile: New file.
4062         * sysdeps/mips/nptl-sysdep.S: New file.
4063         * sysdeps/mips/tcb-offsets.sym: New file.
4064         * sysdeps/mips/pthread_spin_lock.S: New file.
4065         * sysdeps/mips/pthread_spin_trylock.S: New file.
4066         * sysdeps/mips/pthreaddef.h: New file.
4067         * sysdeps/mips/tls.h: New file.
4068         * sysdeps/mips/jmpbuf-unwind.h: New file.
4069         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
4070         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
4071         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
4072         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
4073         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
4074         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
4075         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
4076         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4077         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4078         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4079
4080 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4081
4082         [BZ #1112]
4083         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4084         variable to scerr.
4085
4086 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4087
4088         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4089
4090 2005-02-25  Roland McGrath  <roland@redhat.com>
4091
4092         * alloca_cutoff.c: Correct license text.
4093         * tst-unload.c: Likewise.
4094         * sysdeps/pthread/allocalim.h: Likewise.
4095         * sysdeps/pthread/pt-initfini.c: Likewise.
4096         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4097         * sysdeps/pthread/bits/sigthread.h: Likewise.
4098         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4099         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4100
4101 2005-02-16  Roland McGrath  <roland@redhat.com>
4102
4103         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4104         Use unsigned int * for ptr_nthreads.
4105
4106 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4107
4108         [BZ #721]
4109         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4110         gcc4.
4111
4112 2005-02-07  Richard Henderson  <rth@redhat.com>
4113
4114         [BZ #787]
4115         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4116         argument.
4117
4118 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4119
4120         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4121         order of arguments in invocation of atomic_add_zero.
4122
4123 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4124
4125         [BZ #737]
4126         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4127         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4128         at least gotntpoff relocation and addition.
4129         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4130         Likewise.
4131         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4132         Likewise.
4133         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4134         Likewise.
4135
4136 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4137
4138         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4139         entry for static tls deallocation fix.
4140         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4141         also contains information whether the memory pointed to is static
4142         TLS or not.
4143         * sysdeps/i386/tls.h: Likewise.
4144         * sysdeps/ia64/tls.h: Likewise.
4145         * sysdeps/powerpc/tls.h: Likewise.
4146         * sysdeps/s390/tls.h: Likewise.
4147         * sysdeps/sh/tls.h: Likewise.
4148         * sysdeps/sparc/tls.h: Likewise.
4149         * sysdeps/x86_64/tls.h: Likewise.
4150
4151 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4152
4153         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4154
4155 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4156
4157         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4158         %esp.
4159         * Makefile (tests): Add tst-align2.
4160         * tst-align2.c: New test.
4161         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4162         -mpreferred-stack-boundary=4.
4163
4164 2004-12-18  Roland McGrath  <roland@redhat.com>
4165
4166         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4167         New file removed withdrawn for the moment.
4168
4169 2004-12-17  Richard Henderson  <rth@redhat.com>
4170
4171         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4172         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4173
4174 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4175
4176         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4177         Increased PTHREAD_STACK_MIN.
4178
4179         * tst-context1.c (stacks): Use bigger stack size.
4180
4181 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4182
4183         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4184         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4185
4186 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4187
4188         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4189         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4190         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4191
4192 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4193
4194         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4195
4196 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4197
4198         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4199         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4200
4201         * tst-getpid1.c: If child crashes, report this first.  Print which
4202         signal.
4203
4204 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4205
4206         * init.c (__pthread_initialize_minimal_internal): Also unblock
4207         SIGSETXID.
4208
4209 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4210
4211         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4212         _POSIX_THREAD_CPUTIME): Define to 0.
4213         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4214         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4215         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4216         __timer_signal_thread_tclk): Remove.
4217         (init_module): Remove their initialization.
4218         (thread_cleanup): Remove their cleanup assertions.
4219         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4220         __timer_signal_thread_tclk): Remove.
4221         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4222         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4223         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4224
4225 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4226
4227         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4228         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4229
4230         * Makefile (tests): Add tst-getpid2.
4231         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4232         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4233         * tst-getpid2.c: New test.
4234
4235 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4236
4237         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4238
4239 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4240
4241         * Makefile (tests): Add tst-getpid1.
4242         * tst-getpid1.c: New file.
4243         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4244         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4245
4246 2004-12-02  Roland McGrath  <roland@redhat.com>
4247
4248         * Makefile (libpthread-nonshared): Variable removed.
4249         ($(objpfx)libpthread_nonshared.a): Target removed.
4250         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4251         These are now handled by generic magic from
4252         libpthread-static-only-routines being set.
4253
4254 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4255
4256         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4257         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4258         _POSIX_THREAD_PRIO_PROTECT): Define.
4259         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4260         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4261         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4262
4263 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4264
4265         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4266         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4267         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4268         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4269         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4270         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4271         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4272
4273 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4274
4275         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4276
4277         * Makefile (libpthread-routines): Add pthread_setschedprio.
4278         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4279         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4280         * pthread_setschedprio.c: New file.
4281
4282 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4283
4284         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4285         * pthread_cancel.c (pthread_create): Likewise.
4286
4287         * Makefile (libpthread-routines): Add vars.
4288         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4289         * init.c (__default_stacksize, __is_smp): Remove.
4290         * vars.c: New file.
4291         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4292         and define a wrapper macro.
4293         (PTHREAD_STATIC_FN_REQUIRE): Define.
4294         * allocatestack.c (__find_thread_by_id): Undefine.
4295         * pthread_create (__pthread_keys): Remove.
4296         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4297         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4298         PTHREAD_STATIC_FN_REQUIRE.
4299
4300 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4301
4302         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4303         parameter to REGISTER macro.
4304
4305 2004-11-17  Roland McGrath  <roland@redhat.com>
4306
4307         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4308         Make sure SIGCANCEL is blocked as well.
4309
4310 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4311
4312         * sysdeps/pthread/setxid.h: New file.
4313         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4314         (struct xid_command): Add forward decl.
4315         (struct pthread_functions): Change return type of __nptl_setxid hook
4316         to int.
4317         * pthreadP.h (__nptl_setxid): Change return type to int.
4318         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4319         calling thread, return its return value and set errno on failure.
4320         * descr.h (struct xid_command): Change id type to long array.
4321
4322         * Makefile: Add rules to build and test tst-setuid1 and
4323         tst-setuid1-static.
4324         * tst-setuid1.c: New test.
4325         * tst-setuid1-static.c: New test.
4326
4327 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4328
4329         * Makefile (tests): Add tst-exit3.
4330         * tst-exit3.c: New test.
4331
4332 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4333
4334         * Makefile (tests): Add tst-exit2.
4335         * tst-exit2.c: New file.
4336
4337 2004-11-09  Roland McGrath  <roland@redhat.com>
4338
4339         [BZ #530]
4340         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4341         here, before calling clone.
4342         * pthread_create.c (start_thread): Don't do it here.
4343
4344 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4345
4346         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4347
4348 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4349
4350         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4351         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4352         assembler warning.
4353
4354 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4355
4356         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4357         if sched_priority is not between minprio and maxprio.
4358
4359 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4360
4361         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4362         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4363
4364         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4365         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4366
4367 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4368
4369         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4370         not-cancelable I/O functions.
4371
4372 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4373
4374         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4375         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4376         make sure 2 is stored in the futex and we looked at the old value.
4377         Fix a few other problems to return the correct value.
4378
4379 2004-10-14  Richard Henderson  <rth@redhat.com>
4380
4381         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4382         make gcc4 happy.
4383
4384 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4385
4386         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4387         of pthread-functions.h and pthreaddef.h.
4388         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4389
4390         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4391         Change __data.__nwaiters from int to unsigned int.
4392
4393         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4394         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4395
4396         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4397         before return type.
4398
4399         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4400         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4401
4402 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4403
4404         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4405         test fails, remove message queue.
4406         (tf_msgsnd): Likewise.
4407
4408 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4409
4410         * tst-clock1.c: Change #ifdef to #if defined.
4411         * tst-clock2.c: Likewise.
4412         * tst-cond11.c: Likewise.
4413
4414         * sysdeps/pthread/timer_create.c (timer_create): Use
4415         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4416         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4417         THREAD_CPUTIME.
4418
4419 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4420
4421         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4422         _POSIX_THREAD_CPUTIME): Define to 0.
4423
4424 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4425
4426         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4427         and _POSIX_THREAD_CPUTIME to zero.
4428         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4429         * tst-barrier2.c: Fix testing for POSIX feature.
4430         * tst-clock1.c: Likewise.
4431         * tst-clock2.c: Likewise.
4432         * tst-cond11.c: Likewise.
4433         * tst-cond4.c: Likewise.
4434         * tst-cond6.c: Likewise.
4435         * tst-flock2.c: Likewise.
4436         * tst-mutex4.c: Likewise.
4437         * tst-mutex9.c: Likewise.
4438         * tst-rwlock12.c: Likewise.
4439         * tst-rwlock4.c: Likewise.
4440         * tst-signal1.c: Likewise.
4441         * tst-spin2.c: Likewise.
4442         * sysdeps/pthread/posix-timer.h: Likewise.
4443         * sysdeps/pthread/timer_create.c: Likewise.
4444         * sysdeps/pthread/timer_routines.c: Likewise.
4445
4446 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4447
4448         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4449         (__lll_mutex_timedlock_wait): Address futex correctly.
4450
4451         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4452         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4453         make sure 2 is stored in the futex and we looked at the old value.
4454         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4455         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4456         which might very well made the code not working at all before.
4457         [BZ #417]
4458
4459 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4460
4461         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4462         allow SIGSETXID to be sent.
4463         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4464         for SIGSETXID to be defined.
4465         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4466         SIGSETXID cannot be blocked.
4467
4468         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4469         Add __extension__ to long long types.
4470         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4471         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4472         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4473         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4474         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4475         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4476         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4477
4478 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4479
4480         * descr.h (struct pthread): Add stopped_start field.
4481         * sysdeps/pthread/createthread.c (create_thread): Set
4482         start_stopped flag in descriptor for new thread appropriately.
4483         * pthread_create.c (start_thread): Only take lock to be stopped on
4484         startup if stopped_start flag says so.
4485
4486 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4487
4488         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4489         is created detached and if yes, do not try to free the stack in case
4490         the thread creation failed.
4491         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4492         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4493         case there has been no error.  [BZ #405]
4494
4495         * pthread_create.c (start_thread): Don't wait for scheduler data
4496         etc to be set at the beginning of the function.  The cancellation
4497         infrastructure must have been set up.  And enable async
4498         cancellation before potentially going to sleep.  [BZ #401]
4499
4500 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4501
4502         * Versions: Remove exports for pthread_set*id_np functions.
4503         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4504         for now.
4505         * Makefile: Don't build pthread_set*id code for now.
4506
4507 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4508
4509         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4510         internal use.
4511         * allocatestack.c (__nptl_setxid): New function.
4512         * descr.h (struct xid_command): Define type.
4513         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4514         (sighandler_setxid): New function.
4515         (__pthread_initialize_minimal): Register sighandler_setxid for
4516         SIGCANCEL.
4517         * pt-allocrtsig.c: Update comment.
4518         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4519         Declare __nptl_setxid.
4520         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4521         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4522         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4523         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4524         and pthread_setresuid_np.
4525         * pthread_setgid_np.c: New file.
4526         * pthread_setuid_np.c: New file.
4527         * pthread_setegid_np.c: New file.
4528         * pthread_seteuid_np.c: New file.
4529         * pthread_setregid_np.c: New file.
4530         * pthread_setreuid_np.c: New file.
4531         * pthread_setresgid_np.c: New file.
4532         * pthread_setresuid_np.c: New file.
4533         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4534         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4535         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4536         and pthread_setresuid_np.
4537         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4538         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4539         pthread_setregid, and pthread_setresgid.
4540
4541 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4542
4543         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4544         ENOMEM when out of memory.
4545
4546 2004-09-10  Roland McGrath  <roland@redhat.com>
4547
4548         [BZ #379]
4549         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4550         code, since we don't try to use the broken CLONE_STOPPED any more.
4551         * pthread_create.c (start_thread): Likewise.
4552
4553 2004-09-15  Richard Henderson  <rth@redhat.com>
4554
4555         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4556
4557 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4558
4559         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4560         (__libc_unwind_longjmp): Delete macro and declare as function.
4561         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4562         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4563         nptl directory.
4564         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4565         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4566         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4567
4568 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4569
4570         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4571         for __USE_XOPEN2K.
4572         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4573         types also for __USE_XOPEN2K.
4574         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4575         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4576         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4577         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4578         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4579         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4580         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4581         [BZ #320]
4582
4583 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4584
4585         * sysdeps/pthread/pthread.h
4586         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4587         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4588         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4589         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4590         [BZ #375]
4591
4592 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4593
4594         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4595         PSEUDO to be used with . prefix.
4596
4597         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4598         Use atomic_increment instead of atomic_exchange_and_add.
4599         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4600         Likewise.
4601         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4602         Likewise.
4603         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4604         Likewise.
4605
4606         * allocatestack.c (allocate_stack): Use atomic_increment_val
4607         instead of atomic_exchange_and_add.
4608         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4609         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4610         Likewise.
4611         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4612         Likewise.
4613
4614         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4615         the initialization function might throw.
4616
4617 2005-09-05  Richard Henderson  <rth@redhat.com>
4618
4619         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4620         Move definition inside libpthread, libc, librt check.  Provide
4621         definition for rtld.
4622
4623 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4624
4625         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4626         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4627         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4628         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4629         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4630         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4631         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4632         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4633         * unwind.c: Use it.
4634
4635         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4636         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4637         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4638         Likewise.
4639         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4640         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4641         this is the last waiter, signal pthread_cond_destroy caller and
4642         avoid using the pthread_cond_t structure after unlock.
4643         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4644         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4645         Read clock type from the least significant bits of __nwaiters instead
4646         of __clock.
4647         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4648         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4649
4650 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4651
4652         [BZ #342]
4653         * Makefile (tests): Add tst-cond20 and tst-cond21.
4654         * tst-cond20.c: New test.
4655         * tst-cond21.c: New test.
4656         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4657         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4658         it unsigned int.
4659         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4660         Likewise.
4661         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4662         (pthread_cond_t): Likewise.
4663         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4664         Likewise.
4665         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4666         Likewise.
4667         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4668         Likewise.
4669         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4670         (cond_nwaiters): New.
4671         (clock_bits): New.
4672         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4673         if there are waiters not signalled yet.
4674         Wait until all already signalled waiters wake up.
4675         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4676         __nwaiters.  If pthread_cond_destroy has been called and this is the
4677         last waiter, signal pthread_cond_destroy caller and avoid using
4678         the pthread_cond_t structure after unlock.
4679         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4680         decrement it when leaving.  If pthread_cond_destroy has been called
4681         and this is the last waiter, signal pthread_cond_destroy caller.
4682         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4683         Likewise.  Read clock type from the least significant bits of
4684         __nwaiters instead of __clock.
4685         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4686         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4687         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4688         clock type just from the last COND_CLOCK_BITS bits of value.
4689         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4690         instead of __clock, just from second bit of condattr's value.
4691
4692 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4693
4694         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4695         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4696         != 64.
4697         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4698
4699 2004-08-15  Roland McGrath  <roland@frob.com>
4700
4701         * pthread_atfork.c: Update copyright terms including special exception
4702         for these trivial files, which are statically linked into executables
4703         that use dynamic linking for the significant library code.
4704
4705 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4706
4707         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4708         pthread_rwlock_rdlock.
4709         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4710         Decrease __nr_readers_queued after reacquiring lock.
4711         * sysdeps/pthread/pthread_rwlock_timedrdlock
4712         (pthread_rwlock_timedrdlock): Likewise.
4713         Reported by Bob Cook <bobcook47@hotmail.com>.
4714
4715 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4716
4717         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4718         before pthread_barrier_wait.
4719
4720 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4721
4722         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4723         Remove unnecessary exception handling data.
4724
4725 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4726
4727         [BZ #284]
4728         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4729         instead of clockid_t.
4730
4731 2004-07-21  Roland McGrath  <roland@redhat.com>
4732
4733         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4734
4735 2004-07-19  Roland McGrath  <roland@redhat.com>
4736
4737         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4738
4739 2004-07-02  Roland McGrath  <roland@redhat.com>
4740
4741         * configure: Don't exit.
4742
4743 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4744
4745         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4746         (__pthread_cond_timedwait): Check for invalid nanosecond in
4747         timeout value.
4748
4749 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4750
4751         * Makefile: Add rules to build and run tst-fini1.
4752         * tst-fini1.c: New file.
4753         * tst-fini1mod.c: New file.
4754
4755 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4756
4757         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4758         if no cancellation support is needed.
4759         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4760         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4761         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4762         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4763         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4764         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4765         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4766         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4767         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4768
4769         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4770         only if not already defined.
4771
4772 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4773
4774         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4775         constraint "m" instead of "0" for futex.
4776
4777         * shlib-versions: Add powerpc64-.*-linux.*.
4778
4779 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4780
4781         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4782         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4783         for valid tv_nsec.
4784         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4785         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4786         bits.
4787
4788 2004-06-29  Roland McGrath  <roland@redhat.com>
4789
4790         * Banner: NPTL no longer has its own version number.
4791         * Makefile (nptl-version): Variable removed.
4792         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4793         using $(version), the glibc version number.
4794
4795 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4796
4797         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4798         Fix branch offset for a PLT entry.
4799         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4800         Likewise.
4801         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4802         Likewise.
4803         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4804         Likewise.
4805         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4806         Likewise.
4807
4808 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4809
4810         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4811         unconditionally.
4812
4813 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4814
4815         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4816         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4817         instead of tv_sec.
4818         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4819         (pthread_rwlock_timedrdlock): Likewise.
4820
4821 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4822
4823         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4824         Set __r7 to val, not mutex.
4825
4826 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4827
4828         * Makefile: Add rules to build tst-rwlock14.
4829         * tst-rwlock14.c: New file.
4830
4831 2004-06-24  Boris Hu  <boris.hu@intel.com>
4832
4833         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4834         check.
4835         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4836
4837 2004-06-19  Andreas Jaeger  <aj@suse.de>
4838
4839         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4840         assembler in last patch.
4841
4842 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4843
4844         * sysdeps/pthread/pthread_cond_timedwait.c
4845         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4846         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4847         (__pthread_cond_timedwait): Check for invalid nanosecond in
4848         timeout value.
4849         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4850         * tst-cond19.c: New file.
4851         * Makefile: Add rules to build and run tst-cond19.
4852
4853 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4854
4855         * tst-context1.c (GUARD_PATTERN): Defined.
4856         (tst_context_t): Define struct containing ucontext_t & guard words.
4857         (ctx): Declare as an array of tst_context_t.
4858         (fct): Verify uc_link & guard words are still valid.
4859         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4860
4861 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4862
4863         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4864         Add __data.__futex field, reshuffle __data.__clock.
4865         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4866         (__pthread_cond_signal): Increment __futex at the same time as
4867         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4868         address of low 32-bits of __wakeup_seq to futex syscall.
4869         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4870         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4871         releasing internal lock to FUTEX_WAIT.
4872         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4873         (__pthread_cond_timedwait): Likewise.
4874         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4875         (FUTEX_CMP_REQUEUE): Define.
4876         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4877         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4878         Pass __futex value from before the unlock and __futex address instead
4879         of address of low 32-bits of __wakeup_seq to futex syscall.
4880         Fallback to FUTEX_WAKE all on any errors.
4881
4882 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4883
4884         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4885         comment typo.
4886         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4887         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4888         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4889         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4890         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4891
4892 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4893
4894         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4895         Add memory clobber to inline assembly.
4896         (__lll_mutex_trylock): Likewise.
4897         (__lll_mutex_cond_trylock): Likewise.
4898
4899 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4900
4901         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4902         Pass val argument as 6th system call argument in %r7.
4903
4904 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4905
4906         * Makefile (tests): Add tst-cond16.
4907         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4908         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4909         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4910         Add __data.__futex field, reshuffle __data.__clock.
4911         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4912         (__pthread_cond_signal): Increment __futex at the same time as
4913         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4914         address of low 32-bits of __wakeup_seq to futex syscall.
4915         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4916         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4917         releasing internal lock to FUTEX_WAIT.
4918         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4919         (__pthread_cond_timedwait): Likewise.
4920         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4921         (FUTEX_CMP_REQUEUE): Define.
4922         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4923         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4924         Pass __futex value from before the unlock and __futex address instead
4925         of address of low 32-bits of __wakeup_seq to futex syscall.
4926         Fallback to FUTEX_WAKE all on any errors.
4927         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4928         Define.
4929         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4930         internally.  Return non-zero if error, zero if success.
4931         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4932         Add __data.__futex field, reshuffle __data.__clock.
4933         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4934         Define.
4935         (lll_futex_requeue): Add val argument, return 1 unconditionally
4936         for the time being.
4937         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4938         Add __data.__futex field, reshuffle __data.__clock.
4939         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4940         Define.
4941         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4942         internally.  Return non-zero if error, zero if success.
4943         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4944         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4945         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4946         Define.
4947         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4948         internally.  Return non-zero if error, zero if success.
4949         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4950         Add __data.__futex field, reshuffle __data.__clock.
4951         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4952         Define.
4953         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4954         internally.  Return non-zero if error, zero if success.
4955         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4956         Add __data.__futex field, reshuffle __data.__clock.
4957         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4958         Add __data.__futex field, reshuffle __data.__clock.
4959         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4960         Increment __futex at the same time as __wakeup_seq or __total_seq.
4961         Pass address of __futex instead of address of low 32-bits of
4962         __wakeup_seq to futex syscall.
4963         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4964         Pass __futex value from before releasing internal lock
4965         to FUTEX_WAIT.
4966         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4967         Likewise.  Avoid unnecessary shadowing of variables.
4968         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4969         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4970         unlock and __futex address instead of address of low 32-bits of
4971         __wakeup_seq to futex_requeue macro, adjust for new return value
4972         meaning.
4973         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4974         (__pthread_cond_signal): Increment __futex at the same time as
4975         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4976         address of low 32-bits of __wakeup_seq to futex syscall.
4977         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4978         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4979         releasing internal lock to FUTEX_WAIT.
4980         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4981         (__pthread_cond_timedwait): Likewise.
4982         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4983         (FUTEX_CMP_REQUEUE): Define.
4984         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4985         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4986         Pass __futex value from before the unlock and __futex address instead
4987         of address of low 32-bits of __wakeup_seq to futex syscall.
4988         Fallback to FUTEX_WAKE all on any errors.
4989
4990 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4991
4992         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4993         Add nop to align the end of critical section.
4994         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4995
4996 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4997
4998         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4999         Add __broadcast_seq field.
5000         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
5001         all waiters as woken with woken_seq and bump broadcast counter.
5002         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
5003         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
5004         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5005         Comment typo fixes.  Avoid returning -ETIMEDOUT.
5006
5007 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
5008
5009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5010         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
5011         Reported by Kaz Kojima.
5012
5013 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
5014
5015         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
5016
5017 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5018
5019         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
5020         __broadcast_seq with bc_seq after acquiring internal lock instead of
5021         before it.
5022
5023 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
5024
5025         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
5026         compilation.
5027         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5028         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
5029         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5030         (pthread_cond_t): Add __data.__broadcast_seq field.
5031         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5032         (FRAME_SIZE): Define.
5033         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
5034         Comment typo fixes.
5035         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
5036         Define.
5037         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
5038         typo fixes.
5039         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5040         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
5041         fixes.
5042
5043 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
5044
5045         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
5046         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5047         Add __broadcast_seq field.
5048         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5049         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5050         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5051         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5052         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5053         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
5054         all waiters as woken with woken_seq and bump broadcast counter.
5055         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
5056         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
5057         __broadcast_seq field.
5058         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5059         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5060         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5061         * pthread_cond_init.c: Initialize __broadcast_seq field.
5062         * Makefile (tests): Add tst-cond17 and tst-cond18.
5063         Add .NOTPARALLEL goal.
5064         * tst-cond16.c: New file.  From Jakub.
5065         * tst-cond17.c: New file.  From Jakub.
5066         * tst-cond18.c: New file.  From Jakub.
5067
5068 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
5069
5070         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
5071         unwind info.
5072
5073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5074         Parametrize frame size.  Correct some unwind info.
5075         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5076
5077 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5078
5079         * tst-stack3.c: Note testing functionality beyond POSIX.
5080
5081 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5082
5083         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5084         Change conditional from ifdef to if.
5085
5086 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5087
5088         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5089         SYSDEP_CANCEL_ERROR): Define.
5090         (PSEUDO): Use it.
5091
5092 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5093
5094         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5095
5096 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5097
5098         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5099
5100 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5101
5102         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5103         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5104         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5105         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5106
5107 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5108
5109         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5110         thread has all signals blocked.
5111
5112 2004-04-18  Andreas Jaeger  <aj@suse.de>
5113
5114         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5115         (SEM_VALUE_MAX): Add missing brace.
5116
5117 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5118
5119         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5120         in rt subdir.
5121         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5122         * sysdeps/pthread/tst-mqueue8x.c: New test.
5123         * tst-cancel4.c: Update comment about message queues.
5124
5125         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5126         return it_value { 0, 0 }.
5127         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5128         like SIGEV_SIGNAL.
5129         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5130         assertion for SIGEV_NONE.
5131         (thread_attr_compare): Compare all attributes, not just a partial
5132         subset.
5133
5134 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5135
5136         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5137
5138 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5139
5140         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5141         Just use a plain number.
5142         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5143         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5144         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5145         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5146         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5147         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5148         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5149
5150 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5151
5152         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5153         frame info.
5154         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5155
5156 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5157
5158         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5159         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5160         of calling sigwaitinfo.
5161
5162 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5163
5164         * allocatestack.c (allocate_stack): Set reported_guardsize
5165         unconditionally.
5166         * pthread_getattr_np.c (pthread_getattr_np): Use
5167         reported_guardsize instead of guardsize.
5168         * descr.h (struct pthread): Add reported_guardsize field.
5169
5170 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5171
5172         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5173
5174 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5175
5176         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5177
5178 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5179
5180         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5181         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5182         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5183         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5184         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5185         Define.
5186         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5187         (_POSIX_MESSAGE_PASSING): Define.
5188         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5189         (_POSIX_MESSAGE_PASSING): Define.
5190         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5191         (_POSIX_MESSAGE_PASSING): Define.
5192
5193 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5194
5195         * tst-context1.c (fct): Check whether correct stack is used.
5196
5197 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5198
5199         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5200         matching constraints for asm mem parameters.
5201
5202         * tst-clock2.c (tf): Don't define unless needed.
5203
5204 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5205
5206         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5207         $(gnulib).
5208
5209 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5210
5211         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5212         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5213         * pthreadP.h: Declare __nptl_deallocate_tsd.
5214         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5215         Adjust caller.
5216
5217         * Makefile (tests): Add tst-tsd5.
5218         * tst-tsd5.c: New file.
5219
5220 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5221
5222         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5223         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5224         is SHLIB_COMPAT check.
5225         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5226         (__pthread_attr_getaffinity_old): Likewise.
5227         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5228         (__pthread_getaffinity_old): Likewise.
5229         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5230         (__pthread_setaffinity_old): Likewise.
5231
5232 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5233
5234         * allocatestack.c (_make_stacks_executable): Call
5235         _dl_make_stack_executable first.
5236
5237 2004-03-24  Roland McGrath  <roland@redhat.com>
5238
5239         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5240         constraint instead of "0".
5241
5242 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5243
5244         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5245         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5246
5247         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5248         code to avoid warning.
5249
5250 2004-03-24  Andreas Jaeger  <aj@suse.de>
5251
5252         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5253         (__pthread_attr_setaffinity_old): Remove const.
5254
5255 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5256
5257         * sysdeps/unix/sysv/linux/smp.h: New file.
5258         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5259         * init.c: Define __is_smp.
5260         (__pthread_initialize_minimal_internal): Call is_smp_system to
5261         initialize __is_smp.
5262         * pthreadP.h: Declare __is_smp.
5263         Define MAX_ADAPTIVE_COUNT is necessary.
5264         * pthread_mutex_init.c: Add comment regarding __spins field.
5265         * pthread_mutex_lock.c: Implement adaptive mutex type.
5266         * pthread_mutex_timedlock.c: Likewise.
5267         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5268         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5269         Add __spins field.
5270         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5271         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5272         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5273         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5274         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5275         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5276         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5277         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5278         lll_mutex_cond_trylock.
5279         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5280         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5281         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5282         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5283         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5284         Define BUSY_WAIT_NOP.
5285         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5286         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5287
5288         * tst-mutex5.c: Add support for testing adaptive mutexes.
5289         * tst-mutex7.c: Likewise.
5290         * tst-mutex5a.c: New file.
5291         * tst-mutex7a.c: New file.
5292         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5293
5294         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5295         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5296         vgettimeofday call might destroy the content.
5297
5298         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5299         @pause in the loop.
5300
5301         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5302         No need to restrict type of ret.  Make it int.  Add comment.
5303
5304         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5305         Remove unnecessary setne instruction.
5306
5307 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5308
5309         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5310         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5311         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5312         If realloc fails, break out of the loop.
5313
5314 2004-03-20  Andreas Jaeger  <aj@suse.de>
5315
5316         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5317         (__pthread_setaffinity_old): Fix interface.
5318         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5319         (__pthread_getaffinity_old): Likewise.
5320
5321         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5322         (__pthread_setaffinity_new): Remove duplicate declaration.
5323
5324 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5325
5326         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5327         the return value to a safe register.
5328         (CDISABLE): Set the function argument correctly.
5329
5330 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5331
5332         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5333         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5334         Rewrite so that only one locked memory operation per round is needed.
5335         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5336         (pthread_barrier_wait): After wakeup, release lock only when the
5337         last thread stopped using the barrier object.
5338         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5339         (__pthread_cond_wait): Don't store mutex address if the current
5340         value is ~0l.  Add correct cleanup support and unwind info.
5341         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5342         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5343         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5344         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5345         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5346         Add correct cleanup support and unwind info.
5347         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5348         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5349         information for syscall wrappers.
5350
5351 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5352
5353         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5354         cpusetsize field, remove next.
5355         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5356         parameter for size of the CPU set.
5357         (pthread_setaffinity_np): Likewise.
5358         (pthread_attr_getaffinity_np): Likewise.
5359         (pthread_attr_setaffinity_np): Likewise.
5360         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5361         interface change, keep compatibility code.
5362         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5363         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5364         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5365         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5366         __pthread_getaffinity_np.
5367         * Versions: Add version for changed interfaces.
5368         * tst-attr3.c: Adjust test for interface change.
5369         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5370         increasing buffer sizes.
5371         * pthread_attr_destroy.c: Remove unused list handling.
5372         * pthread_attr_init.c: Likewise.
5373
5374 2004-03-17  Roland McGrath  <roland@redhat.com>
5375
5376         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5377         first argument to clock_getres so we ever enable kernel timers.
5378
5379 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5380
5381         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5382
5383 2004-03-12  Richard Henderson  <rth@redhat.com>
5384
5385         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5386         oldvalue from CENABLE to CDISABLE.
5387
5388 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5389
5390         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5391         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5392         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5393         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5394
5395 2004-03-11  Richard Henderson  <rth@redhat.com>
5396
5397         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5398         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5399         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5400
5401 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5402
5403         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5404         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5405         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5406
5407 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5408
5409         * forward.c (__pthread_cond_broadcast_2_0,
5410         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5411         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5412         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5413
5414 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5415
5416         * sysdeps/sh/tcb-offsets.sym: Add PID.
5417         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5418         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5419
5420 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5421
5422         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5423         include <sysdep-cancel.h>, vfork is no cancellation point.
5424         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5425         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5426         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5427
5428 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5429
5430         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5431         libc_hidden_def.
5432         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5433         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5434         Likewise.
5435         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5436         Likewise.
5437         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5438         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5439         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5440         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5441         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5442
5443         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5444         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5445         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5446         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5447         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5448         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5449
5450         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5451         a local register for saving old PID.  Negate PID in parent upon exit.
5452
5453         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5454         tcb-offsets.h.
5455         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5456         before syscall, set to the old value in the parent afterwards.
5457         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5458         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5459         tcb-offsets.h.
5460         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5461         before syscall, set to the old value in the parent afterwards.
5462         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5463         * sysdeps/s390/tcb-offsets.sym: Add PID.
5464
5465         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5466         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5467         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5468         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5469         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5470         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5471
5472 2004-03-10  Andreas Schwab  <schwab@suse.de>
5473
5474         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5475         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5476         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5477
5478 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5479
5480         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5481         * tst-cancel21.c (do_one_test): Likewise.
5482         Reported by Gordon Jin <gordon.jin@intel.com>.
5483
5484 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5485
5486         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5487         if non-zero and set to INT_MIN if zero.
5488         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5489         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5490         (SAVE_PID, RESTORE_PID): Define.
5491         (__vfork): Use it.
5492         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5493         Use relative path to avoid including NPTL i386/vfork.S.
5494         (SAVE_PID, RESTORE_PID): Define.
5495         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5496         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5497         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5498         tst-vfork2x.
5499         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5500         * tst-vfork1.c: New test.
5501         * tst-vfork2.c: New test.
5502         * tst-vfork1x.c: New test.
5503         * tst-vfork2x.c: New test.
5504
5505 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5506
5507         * sysdeps/i386/tcb-offsets.sym: Add PID.
5508         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5509         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5510         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5511
5512 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5513
5514         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5515
5516 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5517
5518         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5519         _rtld_global_ro.
5520
5521 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5522
5523         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5524         _rtld_global_ro.
5525
5526         * tst-once4.c: Remove unnecessary macro definition.
5527
5528         * tst-mutex7.c (do_test): Limit thread stack size.
5529         * tst-once2.c (do_test): Likewise.
5530         * tst-tls3.c (do_test): Likewise.
5531         * tst-tls1.c (do_test): Likewise.
5532         * tst-signal3.c (do_test): Likewise.
5533         * tst-kill6.c (do_test): Likewise.
5534         * tst-key4.c (do_test): Likewise.
5535         * tst-join4.c (do_test): Likewise.
5536         * tst-fork1.c (do_test): Likewise.
5537         * tst-context1.c (do_test): Likewise.
5538         * tst-cond2.c (do_test): Likewise.
5539         * tst-cond10.c (do_test): Likewise.
5540         * tst-clock2.c (do_test): Likewise.
5541         * tst-cancel10.c (do_test): Likewise.
5542         * tst-basic2.c (do_test): Likewise.
5543         * tst-barrier4.c (do_test): Likewise.
5544
5545 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5546
5547         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5548
5549 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5550
5551         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5552         (__pthread_cond_timedwait): Optimize wakeup test.
5553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5554         (__pthread_cond_wait): Likewise.
5555         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5556         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5557         Likewise.
5558
5559 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5560
5561         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5562         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5563         the atomic instruction needed.
5564         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5565         (__lll_mutex_lock_wait): Likewise.
5566
5567 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5568
5569         * Makefile (tests): Add tst-cond14 and tst-cond15.
5570         * tst-cond14.c: New file.
5571         * tst-cond15.c: New file.
5572
5573 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5574
5575         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5576         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5577         needs to be implemented differently to be useful.
5578
5579 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5580
5581         * pthread_attr_setschedparam.c: Don't test priority against limits
5582         here.  Set ATTR_FLAG_SCHED_SET flag.
5583         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5584         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5585         from parent thread to child.  If attribute is used and scheduling
5586         parameters are not inherited, copy parameters from attribute or
5587         compute them.  Check priority value.
5588         * pthread_getschedparam.c: If the parameters aren't known yet get
5589         them from the kernel.
5590         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5591         ATTR_FLAG_POLICY_SET flag for thread.
5592         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5593         and ATTR_FLAG_POLICY_SET.
5594
5595         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5596
5597         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5598         fail if stack address hasn't been set.  Just return 0.
5599
5600 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5601
5602         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5603         libpthread for the files in this list.
5604         (CFLAGS-tst-unload): Removed.
5605         * tst-unload.c (do_test): Don't use complete path for
5606         LIBPHREAD_SO.
5607
5608         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5609         tst-_res1mod2.
5610
5611 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5612
5613         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5614         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5615         operation per round is needed.
5616         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5617         (__lll_mutex_lock_wait): Likewise.
5618
5619 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5620
5621         * tst-cancel9.c (cleanup): Don't print to stderr.
5622
5623 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5624
5625         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5626
5627 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5628
5629         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5630         (__syscall_error_handler2): Call CDISABLE.
5631         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5632         (__syscall_error_handler2): Call CDISABLE.
5633
5634         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5635         Release lock before the loop, don't reacquire it.
5636
5637         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5638
5639 2004-02-19  Andreas Schwab  <schwab@suse.de>
5640
5641         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5642         Fix last change.
5643
5644 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5645
5646         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5647         (pthread_barrier_wait): After wakeup, release lock only when the
5648         last thread stopped using the barrier object.
5649         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5650         (pthread_barrier_wait): Likewise.
5651         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5652         Likewise.
5653         * Makefile (tests): Add tst-barrier4.
5654         * tst-barrier4.c: New file.
5655
5656         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5657         (__pthread_cond_timedwait): Perform timeout test while holding
5658         internal lock to prevent wakeup race.
5659         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5660         * sysdeps/pthread/pthread_cond_timedwait.c
5661         (__pthread_cond_timedwait): Likewise.
5662         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5663         (__pthread_cond_timedwait): Likewise.
5664
5665 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5666
5667         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5668         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5669         * Makefile (tests): Add tst-rwlock13.
5670         * tst-rwlock13.c: New test.
5671
5672 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5673
5674         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5675         (__condvar_tw_cleanup): Little optimization.
5676         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5677
5678 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5679
5680         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5681         libpthread as "lib" parameter to SHLIB_COMPAT.
5682         (__novmx_siglongjmp): Fix typo in function name.
5683         (__novmx_longjmp): Fix typo in function name.
5684
5685 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5686
5687         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5688         __builtin_expect.
5689
5690         * sysdeps/generic/pt-longjmp.c: Moved to...
5691         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5692
5693 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5694
5695         * Makefile (libpthread-routines): Add pt-cleanup.
5696         * pt-longjmp.c: Removed.
5697         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5698         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5699         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5700         Version longjmp, siglongjmp for GLIBC_2.3.4.
5701         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5702
5703 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5704
5705         * sysdeps/pthread/pthread_cond_timedwait.c
5706         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5707         Reuse code.  Add __builtin_expects.
5708
5709         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5710         (__pthread_cond_timedwait): Get internal lock in case timeout has
5711         passed before the futex syscall.
5712         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5713
5714 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5715
5716         * allocatestack.c: Pretty printing.
5717
5718         * sysdeps/pthread/createthread.c (create_thread): Don't add
5719         CLONE_DETACHED bit if it is not necessary.
5720
5721 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5722
5723         * pthread_getattr_np.c: Include ldsodefs.h.
5724
5725 2004-01-16  Richard Henderson  <rth@redhat.com>
5726
5727         * allocatestack.c: Don't declare __libc_stack_end.
5728         * init.c (__pthread_initialize_minimal_internal): Likewise.
5729         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5730
5731 2004-01-15  Richard Henderson  <rth@redhat.com>
5732
5733         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5734         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5735         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5736         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5737         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5738         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5739         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5740         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5741
5742 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5743
5744         * init.c (pthread_functions): Make array const.
5745
5746 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5747
5748         * allocatestack.c (__make_stacks_executable): Change interface.
5749         Check parameters.  Pass parameter on to libc counterpart.
5750         * pthreadP.h: Change declaration.
5751
5752 2004-01-13  Richard Henderson  <rth@redhat.com>
5753
5754         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5755         prototype form.
5756         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5757         Likewise.
5758
5759         * sysdeps/alpha/Makefile: New file.
5760         * sysdeps/alpha/tcb-offsets.sym: New file.
5761         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5762         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5763
5764         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5765         on powerpc version.
5766
5767 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5768
5769         * Makefile (tests): Add tst-backtrace1.
5770         * tst-backtrace1.c: New test.
5771
5772 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5773
5774         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5775         register as second parameter to the REGISTER macro.
5776         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5777         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5778         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5779         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5780         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5781         of thread register as second parameter to REGISTER macro in 64 case.
5782
5783 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5784
5785         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5786         (CFLAGS-getpid.o): Defined.
5787         (CFLAGS-getpid.os): Defined.
5788
5789 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5790
5791         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5792         returned for main thread does not overlap with any other VMA.
5793         Patch by Jakub Jelinek.
5794
5795 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5796
5797         * tst-raise1.c: Include stdio.h.
5798
5799 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5800
5801         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5802         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5803         If pid is 0, set it to selftid.
5804         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5805         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5806         != 0, return self->tid without doing a syscall.
5807         * descr.h (struct pthread): Move pid field after tid.
5808
5809         * Makefile (tests): Add tst-raise1.
5810         * tst-raise1.c: New file.
5811
5812 2003-12-23  Roland McGrath  <roland@redhat.com>
5813
5814         * tst-oddstacklimit.c: New file.
5815         * Makefile (tests): Add it.
5816         (tst-oddstacklimit-ENV): New variable.
5817
5818         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5819         value up to page size for __default_stacksize.
5820
5821 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5822
5823         * Makefile (tests): Add tst-eintr5.
5824         * tst-eintr5.c: New file.
5825
5826         * eintr.c (eintr_source): Prevent sending signal to self.
5827
5828         * tst-eintr2.c (tf1): Improve error message.
5829
5830 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5831
5832         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5833         * sysdeps/unix/sysv/linux/getpid.c: New file.
5834         * pthread_cancel.c: Add comment explaining use of PID field.
5835         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5836         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5837         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5838         temporarily to signal the field must not be relied on and updated
5839         by getpid().
5840         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5841         temporarily negative.
5842         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5843
5844 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5845
5846         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5847         (eintr_source): If ARG != NULL, use pthread_kill.
5848         * tst-eintr1.c: Adjust for this change.
5849         * tst-eintr2.c: Likewise.
5850         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5851         * tst-eintr3.c: New file.
5852         * tst-eintr4.c: New file.
5853
5854 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5855
5856         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5857         if CANCELSTATE_BITMASK is set.
5858         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5859         Likewise.
5860
5861         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5862         (tests-reverse): Add tst-cancel23.
5863         * tst-cancel22.c: New test.
5864         * tst-cancel23.c: New test.
5865
5866 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5867
5868         * tst-eintr1.c: Better error messages.
5869
5870         * Makefile (tests): Add tst-eintr2.
5871         * tst-eintr2.c: New file.
5872
5873 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5874
5875         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5876         (CFLAGS-tst-cancelx21.c): Set.
5877         * tst-cancel21.c: New test.
5878         * tst-cancelx21.c: New test.
5879
5880         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5881         comparison operand.
5882         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5883         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5884         * pt-longjmp.c: Include jmpbuf-unwind.h.
5885         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5886         _JMPBUF_UNWINDS.  Adjust compared pointers.
5887         * init.c (__pthread_initialize_minimal_internal): Initialize
5888         pd->stackblock_size.
5889         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5890         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5891         * sysdeps/i386/jmpbuf-unwind.h: New file.
5892         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5893         * sysdeps/s390/jmpbuf-unwind.h: New file.
5894         * sysdeps/sh/jmpbuf-unwind.h: New file.
5895         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5896         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5897         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5898         (_JMPBUF_CFA_UNWINDS): Remove.
5899         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5900
5901 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5902
5903         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5904         (CFLAGS-tst-cancelx20.c): Set.
5905         * tst-cancel20.c: New test.
5906         * tst-cancelx20.c: New test.
5907
5908 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5909
5910         * init.c (__pthread_initialize_minimal_internal): Don't treat
5911         architectures with separate register stack special here when
5912         computing default stack size.
5913
5914 2003-12-17  Roland McGrath  <roland@redhat.com>
5915
5916         * Makefile (tst-cancelx7-ARGS): New variable.
5917         Reportd by Greg Schafer <gschafer@zip.com.au>.
5918
5919 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5920
5921         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5922         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5923         (tst-stack3-ENV): Set.
5924         ($(objpfx)tst-stack3-mem): New.
5925         * tst-stack3.c: New test.
5926
5927 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5928
5929         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5930         Add unwind directives.  Drop unused .regstk directive.
5931         (_fini_EPILOG_BEGINS): Add unwind directives.
5932
5933 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5934
5935         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5936         Assume parameter is a pointer.
5937         (lll_futex_wake): Likewise.
5938         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5939         Likewise.
5940         (lll_futex_wake): Likewise.
5941         Reported by Boris Hu.
5942         * sysdeps/unix/sysv/linux/unregister-atfork.c
5943         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5944
5945         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5946
5947 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5948
5949         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5950         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5951         __rtld_lock_initialize for ld.so lock.
5952         Patch in part by Adam Li <adam.li@intel.com>.
5953
5954 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5955
5956         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5957         in $(gnulib).  Also, remove stale comment.
5958
5959 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5960
5961         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5962         advantage of new syscall stub and optimize accordingly.
5963
5964         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5965         from SYS_futex, to match expectations of
5966         sysdep.h:DO_INLINE_SYSCALL.
5967         (lll_futex_clobbers): Remove.
5968         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5969         (lll_futex_wake): Likewise.
5970         (lll_futex_requeue): Likewise.
5971         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5972         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5973         Jelinek).
5974         (__lll_mutex_lock): Likewise.
5975         (__lll_mutex_cond_lock): Likewise.
5976         (__lll_mutex_timed_lock): Likewise.
5977         (__lll_mutex_unlock): Likewise.
5978         (__lll_mutex_unlock_force): Likewise.
5979
5980         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5981         comes before the include of <sysdep.h>.
5982         (THREAD_SELF_SYSINFO): New macro.
5983         (THREAD_SYSINFO): Likewise.
5984         (INIT_SYSINFO): New macro.
5985         (TLS_INIT_TP): Call INIT_SYSINFO.
5986
5987         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5988
5989         * sysdeps/pthread/createthread.c (create_thread): Use
5990         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5991         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5992         THREAD_SELF_SYSINFO instead of open code.
5993         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5994         (THREAD_SYSINFO): Likewise.
5995
5996         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5997
5998         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5999
6000 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
6001
6002         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
6003         instead of .init.  Patch by David Mosberger.
6004
6005 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
6006
6007         * sysdeps/pthread/configure.in: Remove broken declaration in C
6008         cleanup handling check.
6009
6010 2003-11-30  Andreas Jaeger  <aj@suse.de>
6011
6012         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
6013         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
6014         Likewise.
6015
6016 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
6017
6018         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
6019         * pthread_attr_destroy.c: Include shlib-compat.h.
6020         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
6021         is set in iattr->flags.
6022         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
6023
6024 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
6025
6026         * Makefile (distribute): Add tst-cleanup4aux.c.
6027
6028         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
6029         include.
6030
6031 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
6032
6033         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
6034         pthread_cond_signal.
6035
6036         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
6037         store mutex address if the current value is ~0l.
6038         * sysdeps/pthread/pthread_cond_timedwait.c
6039         (__pthread_cond_timedwait): Likewise.
6040         * sysdeps/pthread/pthread_cond_broadcast.c
6041         (__pthread_cond_broadcast): Don't use requeue for pshared
6042         condvars.
6043
6044         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6045         (__pthread_cond_wait): Don't store mutex address if the current
6046         value is ~0l.
6047         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6048         (__pthread_cond_timedwait): Likewise.
6049         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6050         (__pthread_cond_broadcast): Don't use requeue for pshared
6051         condvars.
6052
6053         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
6054         element with ~0l for pshared condvars, with NULL otherwise.
6055
6056         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6057         (__pthread_cond_wait): Don't store mutex address if the current
6058         value is ~0l.
6059         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6060         (__pthread_cond_timedwait): Likewise.
6061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6062         (__pthread_cond_broadcast): Don't use requeue for pshared
6063         condvars.
6064
6065         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
6066         * tst-cond12.c: New file.
6067         * tst-cond13.c: New file.
6068
6069 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
6070
6071         * sysdeps/pthread/configure.in: Make missing forced unwind support
6072         fatal.
6073
6074 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
6075
6076         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6077
6078 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6079
6080         * Makefile: Add magic to clean up correctly.
6081
6082 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6083
6084         * unwind.c (FRAME_LEFT): Define.
6085         (unwind_stop): Handle old style cleanups here.
6086         (__pthread_unwind): Handle old style cleanups only if
6087         !HAVE_FORCED_UNWIND.
6088         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6089         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6090         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6091         ($(objpfx)tst-cleanupx4): Likewise.
6092         * tst-cleanup4.c: New test.
6093         * tst-cleanup4aux.c: New.
6094         * tst-cleanupx4.c: New test.
6095
6096 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6097
6098         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6099         lll_mutex_*lock macros to skip atomic operations on some archs.
6100
6101 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6102
6103         * sysdeps/pthread/tst-timer.c (main): Initialize
6104         sigev2.sigev_value as well.
6105
6106 2003-10-15  Roland McGrath  <roland@redhat.com>
6107
6108         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6109         is missing.
6110         * sysdeps/pthread/configure: Regenerated.
6111
6112 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6113
6114         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6115         locking macros.  No distinction between normal and mutex locking
6116         anymore.
6117         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6118         Merge bits from lowlevelmutex.S we still need.
6119         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6120         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6121         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6122         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6123         new mutex implementation.
6124         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6125         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6126         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6127         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6128         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6129         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6130         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6131         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6132         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6133         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6134         symbol for entry point to avoid cancellation.
6135
6136 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6137
6138         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6139         changes.
6140         (SAVE_OLDTYPE_0): Fix a typo.
6141
6142 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6143
6144         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6145         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6146
6147 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6148
6149         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6150         correct offset.
6151
6152 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6153
6154         * Makefile (tests): Add tst-cancel19.
6155         * tst-cancel19.c: New test.
6156
6157 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6158
6159         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6160         restoring of the old cancellation type.
6161
6162 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6163
6164         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6165
6166 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6167
6168         * sysdeps/pthread/malloc-machine.h: New file
6169
6170 2003-09-24  Roland McGrath  <roland@redhat.com>
6171
6172         * allocatestack.c (__make_stacks_executable): Don't ignore return
6173         value from _dl_make_stack_executable.
6174
6175 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6176
6177         * allocatestack.c (__make_stacks_executable): Also change
6178         permission of the currently unused stacks.
6179
6180         * allocatestack.c (change_stack_perm): Split out from
6181         __make_stacks_executable.
6182         (allocate_stack): If the required permission changed between the time
6183         we started preparing the stack and queueing it, change the permission.
6184         (__make_stacks_executable): Call change_stack_perm.
6185
6186         * Makefile: Build tst-execstack-mod locally.
6187         * tst-execstack-mod.c: New file.
6188
6189 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6190
6191         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6192
6193 2003-09-23  Roland McGrath  <roland@redhat.com>
6194
6195         * tst-execstack.c: New file.
6196         * Makefile (tests): Add it.
6197         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6198         (LDFLAGS-tst-execstack): New variable.
6199
6200         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6201         whether to use PROT_EXEC for stack mmap.
6202         (__make_stacks_executable): New function.
6203         * pthreadP.h: Declare it.
6204         * init.c (__pthread_initialize_minimal_internal): Set
6205         GL(dl_make_stack_executable_hook) to that.
6206
6207 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6208
6209         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6210         recommendation from AMD re avoidance of lock prefix.
6211
6212 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6213
6214         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6215         lll_futex_timed_wait instead of lll_futex_wait.
6216         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6217         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6218         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6219         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6220         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6221         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6222         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6223         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6224         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6225         Completely revamp the locking macros.  No distinction between
6226         normal and mutex locking anymore.
6227         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6228         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6229         __lll_lock_timedwait): Fix prototypes.
6230         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6231         __lll_lock_timedwait): Likewise.
6232         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6233         macros, add __builtin_expect.
6234         (lll_mutex_timedlock): Likewise.  Fix return value.
6235         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6236         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6237         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6238         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6239         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6240         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6241         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6242         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6243
6244 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6245
6246         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6247         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6248         operation if possible.
6249
6250         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6251         like jumping over the lock prefix.
6252
6253 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6254
6255         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6256         locking macros.  No distinction between normal and mutex locking
6257         anymore.
6258         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6259         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6260         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6261         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6262         locking.  Merge bits from lowlevelmutex.S we still need.
6263         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6264         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6265         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6266         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6267         * Makefile (routines): Remove libc-lowlevelmutex.
6268         (libpthread-rountines): Remove lowlevelmutex.
6269         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6270         for new mutex implementation.
6271         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6272         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6273         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6274         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6275         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6276         Likewise.
6277         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6278         Likewise.
6279         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6280         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6281         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6282         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6283         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6284         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6285         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6286         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6287         Likewise.
6288         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6289         Likewise.
6290         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6291         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6292         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6293         Don't use requeue.
6294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6295         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6296
6297 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6298
6299         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6300         in parameters of asm with output parameters.
6301
6302         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6303         type of DECR parameter to int.
6304         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6305
6306 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6307
6308         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6309         guardsize for each thread.
6310
6311 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6312
6313         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6314         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6315         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6316
6317         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6318         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6319         NULL.
6320         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6321         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6322         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6323         (pthread_getaffinity_np): Add hidden_def.
6324
6325         * Makefile (tests): Add tst-attr3.
6326         * tst-attr3.c: New test.
6327
6328         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6329
6330 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6331
6332         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6333         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6334
6335 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6336
6337         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6338         * tst-align.c: Include tst-stack-align.h.
6339         (tf, do_test): Use TEST_STACK_ALIGN macro.
6340
6341 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6342
6343         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6344         variable.
6345
6346 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6347
6348         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6349         stack-related values for the initial thread.
6350
6351 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6352
6353         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6354
6355 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6356
6357         * pthread_mutex_lock.c: Minor code rearrangements.
6358
6359 2003-09-05  Roland McGrath  <roland@redhat.com>
6360
6361         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6362         Instead, include ../nptl_db/db_info.c to do its magic.
6363         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6364         (__pthread_pthread_key_2ndlevel_size): Likewise.
6365         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6366         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6367         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6368         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6369         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6370         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6371         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6372         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6373         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6374         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6375         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6376         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6377         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6378         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6379         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6380         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6381         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6382
6383 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6384
6385         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6386         of pthread_t to be compatible with LT.
6387         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6388         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6389         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6390         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6391         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6392         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6393         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6394
6395 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6396
6397         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6398
6399 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6400
6401         * unwind-forcedunwind.c: Move to...
6402         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6403         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6404         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6405         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6406         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6407         * unwind.c: Include jmpbuf-unwind.h.
6408         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6409
6410 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6411
6412         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6413         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6414         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6415         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6416         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6417         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6418         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6419         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6420         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6421         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6422         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6423         function.
6424         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6425         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6426         * Makefile (tests): Add tst-stack2.
6427         * tst-stack2.c: New test.
6428         * tst-stack1.c: Include limits.h and sys/param.h.
6429         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6430
6431         * pthread_condattr_setpshared.c: Include errno.h.
6432         (pthread_condattr_setpshared): Return EINVAL if pshared
6433         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6434
6435         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6436         defined symbol for entry point to avoid cancellation.
6437         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6438         Likewise.
6439         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6440         Likewise.
6441         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6442         Likewise.
6443         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6444         Likewise.
6445         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6446         Likewise.
6447         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6448         __close_nocancel, __read_nocancel, __write_nocancel,
6449         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6450         libpthread.so or librt.so, define to corresponding function
6451         without _nocancel suffix.
6452         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6453         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6454         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6455
6456         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6457
6458 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6459
6460         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6461         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6462
6463         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6464         in subsections has a symbol associated with it.
6465
6466         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6467         defined symbol for entry point to avoid cancellation.
6468         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6469
6470 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6471
6472         * Makefile (tests): Add tst-tls5.
6473         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6474         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6475         ($(objpfx)tst-tls5): New.
6476         ($(objpfx)tst-tls6.out): Likewise.
6477         (tests): Depend on $(objpfx)tst-tls6.out.
6478         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6479         (do_test): Check pthread_self () return value alignment.
6480         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6481         (tf): Check pthread_self () return value alignment.
6482         * tst-tls5.c: New test.
6483         * tst-tls5.h: New.
6484         * tst-tls5mod.c: New.
6485         * tst-tls5moda.c: New.
6486         * tst-tls5modb.c: New.
6487         * tst-tls5modc.c: New.
6488         * tst-tls5modd.c: New.
6489         * tst-tls5mode.c: New.
6490         * tst-tls5modf.c: New.
6491         * tst-tls6.sh: New test.
6492
6493         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6494         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6495         * init.c (pthread_functions): Initialize them.
6496         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6497         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6498         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6499         pthread_cond_timedwait@@GLIBC_2.3.2.
6500
6501 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6502
6503         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6504         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6505         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6506         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6507         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6508         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6509
6510         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6511
6512         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6513         _POSIX_THREAD_PRIORITY_SCHEDULING.
6514         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6515
6516 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6517
6518         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6519         nested function, use static inline function from libio.h.
6520         Code by Richard Henderson.
6521
6522         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6523         weak.
6524
6525 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6526
6527         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6528         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6529         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6530         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6531         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6532         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6533         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6534         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6535         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6536         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6537         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6538         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6539         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6540         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6541         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6542         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6543         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6544         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6545         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6546         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6547         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6548         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6549         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6550         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6551         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6552         * sysdeps/sparc/tls.h: New file.
6553         * sysdeps/sparc/tcb-offsets.sym: New file.
6554         * sysdeps/sparc/Makefile: New file.
6555         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6556         * init.c [__sparc__] (__NR_set_tid_address): Define.
6557
6558 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6559
6560         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6561         _IO_release_lock): Define.
6562
6563 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6564
6565         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6566         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6567
6568 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6569
6570         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6571         (__pthread_cleanup_class): Add missing return types of member
6572         functions.
6573
6574 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6575
6576         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6577         (lll_mutex_unlock_force): Add memory barrier between store and futex
6578         syscall.
6579
6580 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6581
6582         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6583         tempmsg in first loop.
6584
6585 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6586
6587         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6588         _POSIX_THREAD_PRIORITY_SCHEDULING.
6589         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6590
6591 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6592
6593         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6594         (__rtld_lock_default_lock_recursive,
6595         __rtld_lock_default_unlock_recursive): Define.
6596         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6597         __rtld_lock_unlock_recursive): Define using
6598         GL(_dl_rtld_*lock_recursive).
6599         * init.c (__pthread_initialize_minimal_internal): Initialize
6600         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6601         Lock GL(_dl_load_lock) the same number of times as
6602         GL(_dl_load_lock) using non-mt implementation was nested.
6603
6604         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6605         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6606
6607 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6608
6609         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6610         PIPE_BUF.
6611
6612 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6613
6614         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6615
6616 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6617
6618         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6619         to first syscall error check.  Move syscall error check for tkill
6620         into __ASSUME_CLONE_STOPPED #ifdef.
6621
6622 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6623
6624         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6625         is not defined, do explicit synchronization.
6626         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6627         is not defined also unlock pd->lock for non-debugging case in case
6628         it is necessary.
6629         * pthread_create.c (start_thread): Always get and release pd->lock
6630         if __ASSUME_CLONE_STOPPED is not defined.
6631         (start_thread_debug): Removed.  Adjust users.
6632         * allocatestack.c (allocate_stack): Always initialize lock if
6633         __ASSUME_CLONE_STOPPED is not defined.
6634         * Makefile (tests): Add tst-sched1.
6635         * tst-sched1.c: New file.
6636
6637         * sysdeps/pthread/createthread.c (do_clone): Only use
6638         sched_setschduler and pass correct parameters.
6639
6640 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6641
6642         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6643         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6644         PTHREAD_STACK_MIN in comments.
6645
6646 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6647
6648         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6649         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6650         argument.
6651         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6652         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6653         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6654         (__pthread_cleanup_upto): Fix prototype.
6655         (_longjmp_unwind): Adjust caller.
6656         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6657         Change second argument to const struct pointer.
6658         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6659         * tst-sem9.c (main): Likewise.
6660         * unwind.c: Include string.h for strlen prototype.
6661
6662 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6663
6664         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6665         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6666         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6667         Define HAVE_CMOV.
6668         Patch by Nicholas Miell <nmiell@attbi.com>.
6669
6670 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6671
6672         * init.c (__pthread_initialize_minimal_internal): Initialize
6673         GL(dl_init_static_tls).
6674         * pthreadP.h (__pthread_init_static_tls): New prototype.
6675         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6676         New functions.
6677         * Makefile (tests): Add tst-tls4.
6678         (modules-names): Add tst-tls4moda and tst-tls4modb.
6679         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6680         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6681         tst-tls4modb.so.
6682         * tst-tls4.c: New file.
6683         * tst-tls4moda.c: New file.
6684         * tst-tls4modb.c: New file.
6685
6686 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6687
6688         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6689         before __timer_dealloc.
6690         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6691         Don't call list_unlink.
6692
6693 2003-07-29  Roland McGrath  <roland@redhat.com>
6694
6695         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6696
6697 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6698
6699         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6700         Don't reuse struct aiocb A if it failed.
6701         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6702         not just one byte, as that does not block.
6703
6704 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6705
6706         * sysdeps/pthread/unwind-resume.c: New file.
6707         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6708         unwind-resume in csu subdir.
6709         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6710         exceptions.
6711         (librt-sysdep_routines, librt-shared-only-routines): Add
6712         rt-unwind-resume.
6713         * sysdeps/pthread/rt-unwind-resume.c: New file.
6714         * unwind-forcedunwind.c: New file.
6715         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6716         (libpthread-shared-only-routines): Likewise.
6717         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6718         * pthreadP.h (pthread_cancel_init): New prototype.
6719         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6720
6721         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6722         attr argument const struct pthread_attr *.
6723
6724         * res.c (__res_state): Return __resp.
6725         * descr.h: Include resolv.h.
6726         (struct pthread): Add res field.
6727         * pthread_create.c: Include resolv.h.
6728         (start_thread): Initialize __resp.
6729         * Makefile (tests): Add tst-_res1.
6730         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6731         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6732         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6733         libpthread.
6734         * tst-_res1.c: New file.
6735         * tst-_res1mod1.c: New file.
6736         * tst-_res1mod2.c: New file.
6737
6738 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6739
6740         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6741
6742         * Makefile: Define various *-no-z-defs variables for test DSOs
6743         which has undefined symbols.
6744
6745 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6746
6747         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6748         Retry if the stwcx fails to store once_control.
6749
6750 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6751
6752         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6753         pthread_attr_setaffinity.
6754         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6755         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6756         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6757         * pthread_attr_destroy.c: Free cpuset element if allocated.
6758         * pthread_create.c: Pass iattr as additional parameter to
6759         create_thread.
6760         * sysdeps/pthread/createthread.c: If attribute is provided and
6761         a new thread is created with affinity set or scheduling parameters,
6762         start thread with CLONE_STOPPED.
6763         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6764         pthread_attr_setaffinity.
6765         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6766         cpuset element.
6767
6768 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6769
6770         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6771
6772 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6773
6774         * sysdeps/pthread/configure.in: Require CFI directives also for
6775         ppc and s390.
6776
6777 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6778
6779         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6780         Add cfi directives.
6781
6782 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6783
6784         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6785         CLEANUP_JMP_BUF.
6786         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6787         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6788         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6789         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6790         not self pointer in __writer.  Compare with TID to determine
6791         deadlocks.
6792         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6793         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6794         Likewise.
6795         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6796         Likewise.
6797         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6798         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6799         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6800         macros also when compiling librt.
6801
6802 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6803
6804         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6805         -fasynchronous-unwind-tables.
6806         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6807         (PSEUDO): Add cfi directives.
6808         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6809         Likewise.
6810         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6811         Likewise.
6812
6813 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6814
6815         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6816         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6817         * unwind.c (__pthread_unwind_next): Add hidden_def.
6818         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6819         Likewise.
6820         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6821         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6822         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6823         Likewise.
6824         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6825         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6826         Likewise.
6827         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6828         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6829         __pthread_unregister_cancel and __pthread_unwind_next.
6830
6831 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6832
6833         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6834         different symbol for the cancellation syscall wrapper and
6835         non-cancellation syscall wrapper.
6836         (PSEUDO_END): Define.
6837
6838 2003-07-05  Richard Henderson  <rth@redhat.com>
6839
6840         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6841         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6842         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6843         return actual return value from the syscall, not 0.
6844
6845 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6846
6847         * descr.h (struct pthread): Add pid field.
6848         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6849         (__reclaim_stacks): Likewise.
6850         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6851         also check for PID of the signal source.
6852         (__pthread_initialize_minimal_internal): Also initialize pid field
6853         of initial thread's descriptor.
6854         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6855         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6856         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6857         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6858         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6859
6860 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6861
6862         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6863         Fix use of parameter.
6864         (__libc_cleanup_pop): Likewise.
6865
6866 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6867
6868         * init.c (sigcancel_handler): Change parameters to match handler
6869         for SA_SIGACTION.  Check signal number and code to recognize
6870         invalid invocations.
6871
6872 2003-07-03  Roland McGrath  <roland@redhat.com>
6873
6874         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6875         Apply sizeof (struct pthread) bias to r13 value.
6876
6877 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6878
6879         * sysdeps/pthread/configure.in: Require CFI directives.
6880
6881         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6882         definition.
6883         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6884         libpthread compilation.
6885         * unwind.c (__pthread_unwind): Add hidden_def.
6886         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6887
6888 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6889
6890         * libc-cancellation.c (__libc_cleanup_routine): Define.
6891         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6892         (__pthread_cleanup_pop): Define.
6893
6894 2003-07-01  Richard Henderson  <rth@redhat.com>
6895
6896         * sysdeps/alpha/elf/pt-initfini.c: New file.
6897         * sysdeps/alpha/pthread_spin_lock.S: New file.
6898         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6899         * sysdeps/alpha/pthreaddef.h: New file.
6900         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6901         * sysdeps/alpha/tls.h: New file.
6902         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6903         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6904         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6905         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6906         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6907         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6908         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6909         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6910         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6911         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6912
6913 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6914
6915         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6916         cleanup support and unwind info.
6917
6918 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6919
6920         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6921         Use correct cleanup handler registration.  Add unwind info.
6922         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6923         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6924         * tst-once3.c: Add cleanup handler and check it is called.
6925         * tst-once4.c: Likewise.
6926         * tst-oncex3.c: New file.
6927         * tst-oncex4.c: New file.
6928         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6929
6930 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6931
6932         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6933
6934 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6935
6936         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6937         (tf_msgsnd): Likewise.
6938
6939         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6940         premature returns a bit more.
6941
6942 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6943
6944         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6945         definition to the front.
6946
6947         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6948         the cleanup functions to make the names unique.  Fix dwarf opcode
6949         un unwind table.
6950         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6951         functions to make the names unique.  Fix CFA offset for two blocks.
6952
6953 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6954
6955         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6956         missing closing braces.
6957         Patch by Christophe Saout <christophe@saout.de>.
6958
6959 2003-06-24  Roland McGrath  <roland@redhat.com>
6960
6961         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6962
6963 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6964
6965         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6966         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6967
6968         * pthreadP.h: Declare __find_thread_by_id.
6969         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6970         * pthread_clock_gettime.c: Allow using other thread's clock.
6971         * pthread_clock_settime.c: Likewise.
6972         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6973         * Makefile: Add rules to build and run tst-clock2.
6974         * tst-clock2.c: New file.
6975
6976 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6977
6978         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6979         to use exception-based cleanup handler.
6980         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6981
6982         * tst-cond8.c (ch): Announce that we are done.
6983
6984         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6985
6986         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6987         Also test aio_suspend with timeout value.
6988
6989 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6990
6991         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6992         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6993         attribute_hidden.
6994
6995         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6996         (__pthread_mutex_lock_internal): Likewise.
6997         (__pthread_mutex_unlock_internal): Likewise.
6998         (__pthread_mutex_unlock_usercnt): Declare.
6999         * pthread_mutex_destroy.c: Always fail if used in any way.
7000         * pthread_mutex_init.c: Update comment.
7001         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
7002         * pthread_mutex_timedlock.c: Adjust __nusers.
7003         * pthread_mutex_trylock.c: Adjust __nusers.
7004         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
7005         and public interfaces are wrapper with pass additional parameter.
7006         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
7007         parameter zero.
7008         * tst-mutex8.c: New file.
7009         * Makefile (tests): Add tst-mutex8.
7010         * sysdeps/pthread/pthread_cond_timedwait.c: Call
7011         __pthread_mutex_unlock_usercnt.
7012         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7013         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7014         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7015         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7016         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7017         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
7018         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7019         Add __nusers.
7020         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7021         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7022         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7023         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7024         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7025
7026         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
7027         * pthread_mutex_timedlock.c: Likewise.
7028         * pthread_mutex_trylock.c: Adjust __nusers.
7029         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
7030         * tst-mutex9.c: New file.
7031         * Makefile (tests): Add tst-mutex9.
7032         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
7033         * sysdeps/ia64/tls.h: Likewise.
7034         * sysdeps/powerpc/tls.h: Likewise.
7035         * sysdeps/s390/tls.h: Likewise.
7036         * sysdeps/sh/tls.h: Likewise.
7037         * sysdeps/x86_64/tls.h: Likewise.
7038         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7039         Change type of __owner.
7040         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7041         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7042         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7043         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7044         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7045
7046 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
7047
7048         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
7049         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
7050
7051         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
7052         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
7053         instead of nr to lll_futex_wake.  Only set errno and return -1
7054         if err < 0.
7055
7056         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
7057         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7058         return actual return value from the syscall, not 0.
7059
7060 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
7061
7062         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
7063         find a random value.
7064         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
7065         errno==EIDRM.
7066
7067         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
7068         compat_timer_settime.
7069         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
7070         compat_timer_gettime.
7071         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
7072         compat_timer_getoverrun.
7073         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
7074         compat_timer_delete.
7075
7076         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7077         error-checking mutex detect busy mutexes.
7078
7079 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7080
7081         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7082         Add ax to clobber list.
7083         (lll_mutex_cond_lock): Likewise.
7084         (lll_mutex_unlock): Likewise.
7085         (lll_lock): Likewise.
7086         (lll_unlock): Likewise.
7087
7088         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7089         * tst-cancel18.c: New file.
7090         * tst-cancelx18.c: New file.
7091
7092         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7093         and tcdrain.
7094
7095         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7096         * tst-cancel17.c: New file.
7097         * tst-cancelx17.c: New file.
7098
7099         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7100         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7101         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7102
7103         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7104
7105 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7106
7107         * sysdeps/pthread/createthread.c (create_thread): Set
7108         header.multiple_threads unconditionally.
7109         * allocatestack.c (allocate_stack): Likewise.
7110         * descr.h (struct pthread): Add header.multiple_threads
7111         unconditionally.
7112         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7113         Define for librt.  #error if neither libpthread, libc nor librt.
7114         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7115         Likewise.
7116         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7117         CDISABLE): Likewise.
7118         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7119         CDISABLE): Likewise.
7120         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7121         CDISABLE): Likewise.
7122         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7123         CDISABLE): Likewise.  Access header.multiple_threads outside of
7124         libc and libpthread.
7125         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7126         Likewise.
7127         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7128         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7129
7130 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7131
7132         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7133         Also test early cancellation before the thread reaches the cancellation
7134         point.
7135
7136         * Makefile: Compile forward.c with exceptions.
7137
7138         * sysdeps/unix/sysv/linux/sleep.c: New file.
7139
7140 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7141
7142         * Makefile: Add CFLAGS definition to compile function wrappers
7143         duplicated from libc with exceptions.
7144         * tst-cancel4.c: Also check cancellation handlers.
7145
7146         * Makefile: Add rules to build and run tst-cancel16 and
7147         tst-cancelx16.  Add missing CFLAGS definitions.
7148         * tst-cancel16.c: New file.
7149         * tst-cancelx16.c: New file.
7150
7151 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7152
7153         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7154         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7155         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7156         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7157
7158         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7159         (LIBC_CANCEL_RESET): Likewise.
7160         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7161         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7162         librt-cancellation.
7163         (CFLAGS-libcrt-cancellation.c): Define.
7164         * sysdeps/pthread/librt-cancellation.c: New file.
7165         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7166         macros also when compiling librt.
7167         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7168         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7169         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7170         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7171         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7172         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7173         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7174
7175         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7176         compat_timer_create.
7177
7178 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7179
7180         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7181
7182         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7183         __register_atfork.
7184         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7185         Add libc_hidden_def.
7186
7187 2003-06-13  Roland McGrath  <roland@redhat.com>
7188
7189         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7190         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7191
7192 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7193
7194         * allocatestack.c (queue_stack): Always inline.
7195         * ptreadhP.h (__do_cancel): Likewise.
7196
7197 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7198
7199         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7200         a typo.
7201
7202 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7203
7204         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7205         (__pthread_cond_signal): Remove incorrect second addition for
7206         cond_lock!=0.
7207
7208 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7209
7210         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7211         (__pthread_cond_signal): Use correct futex pointer in
7212         __lll_mutex_lock_wait call.
7213
7214         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7215         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7216
7217 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7218
7219         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7220         cancelable.
7221         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7222         Likewise.
7223
7224         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7225         hand-written CFI generation code.  Since ENTRY/END also initiated
7226         CFI frames this caused two CFI sets to be generated.
7227
7228 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7229
7230         * cleanup_routine.c: New file.
7231         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7232         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7233         cleanup handling.
7234         * Makefile (libpthread-routines): Add cleanup_routine.
7235         Add more CFLAGS variables to compile with exceptions.  Add comments
7236         why which file needs unwind tables.
7237         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7238         tests.
7239         * tst-cancelx1.c: New file.
7240         * tst-cancelx2.c: New file.
7241         * tst-cancelx3.c: New file.
7242         * tst-cancelx4.c: New file.
7243         * tst-cancelx5.c: New file.
7244         * tst-cancelx6.c: New file.
7245         * tst-cancelx7.c: New file.
7246         * tst-cancelx8.c: New file.
7247         * tst-cancelx9.c: New file.
7248         * tst-cancelx10.c: New file.
7249         * tst-cancelx11.c: New file.
7250         * tst-cancelx12.c: New file.
7251         * tst-cancelx13.c: New file.
7252         * tst-cancelx14.c: New file.
7253         * tst-cancelx15.c: New file.
7254         * tst-cleanupx0.c: New file.
7255         * tst-cleanupx0.expect: New file.
7256         * tst-cleanupx1.c: New file.
7257         * tst-cleanupx2.c: New file.
7258         * tst-cleanupx3.c: New file.
7259
7260         * tst-cleanup0.c: Make standard compliant.
7261         * tst-cleanup1.c: Likewise.
7262
7263         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7264         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7265         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7266         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7267         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7268         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7269         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7270         CLEANUP_JMP_BUF.
7271         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7272         * tst-cancel12.c: New file.
7273         * tst-cancel13.c: New file.
7274         * tst-cancel14.c: New file.
7275         * tst-cancel15.c: New file.
7276         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7277         and tst-cancel15.
7278
7279         * tst-cancel1.c: Add some comments.
7280
7281         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7282         timeout correctly.
7283
7284 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7285
7286         * Makefile (CFLAGS-pthread_cancel.c): Define.
7287
7288 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7289
7290         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7291         Change type of __writer element to int.
7292         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7293         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7294         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7295         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7296         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7297         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7298         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7299         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7300         Compare with TID to determine deadlocks.
7301         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7302         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7303         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7304         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7305         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7306         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7307         Likewise.
7308         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7309         Likewise.
7310         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7311         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7312         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7313         Likewise.
7314         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7315         Likewise.
7316         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7317         * Makefile (tests): Add tst-rwlock12.
7318         * tst-rwlock12.c: New file.
7319
7320 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7321
7322         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7323         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7324         Remove bogus hidden_proto.
7325         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7326         Likewise.
7327         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7328         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7329         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7330         ___lll_mutex_timedlock): Likewise.
7331
7332 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7333
7334         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7335         (__pthread_cond_signal): Add some code to eventually handle
7336         cond_lock!=0.
7337
7338 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7339
7340         * Makefile (tests): Add tst-exec4.
7341         (tst-exec4-ARGS): Define.
7342         * tst-exec4.c: New file.
7343
7344 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7345
7346         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7347         Also fail if tv_nsec < 0.
7348         (__lll_timedwait_tid): Likewise.
7349         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7350         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7351         Likewise.
7352         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7353         Likewise.
7354         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7355         Likewise.
7356         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7357         Likewise.
7358         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7359         Likewise.
7360         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7361         Likewise.
7362
7363         * Makefile (tests): Add tst-sem8 and tst-sem9.
7364         * tst-sem8.c: New file.
7365         * tst-sem9.c: New file.
7366         * sem_open.c: Fix creation of in_use record if the file exists but
7367         no internal record.
7368
7369         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7370         definitions.
7371
7372         * sysdeps/pthread/timer_create.c (timer_create): In case
7373         evp==NULL, assign timer ID to sival_ptr.
7374
7375         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7376         struct pthread_unwind_buf *.
7377         (struct pthread): Likewise for cleanup_jmp_buf element.
7378
7379         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7380         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7381         * unwind.c (__pthread_unwind_next): Likewise.
7382
7383 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7384
7385         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7386         (lll_futex_timed_wait): Use int for futex value parameter.
7387         (lll_futex_wake): Likewise.
7388         (lll_futex_requeue): Likewise.
7389
7390         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7391         Replace one memory operation with one register operation.
7392
7393         * tst-join4.c (do_test): Fix error message.
7394
7395         * tst-rwlock6.c (do_test): Use correct format specifier.
7396
7397         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7398         (__lll_mutex_lock_wait): Replace one memory operation with one
7399         register operation.
7400         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7401         (__lll_mutex_lock_wait): Likewise.
7402
7403         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7404         (__lll_mutex_cond_lock): Add one to value parameter of
7405         __lll_lock_wait to reflect reality in the futex syscall.
7406         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7407         (lll_mutex_cond_lock): Likewise.
7408
7409 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7410
7411         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7412         New function.
7413         (lll_mutex_cond_lock): Define.
7414
7415 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7416
7417         * Makefile (tests): Add tst-signal6.
7418         * tst-signal6.c: New file.
7419
7420         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7421         (__lll_mutex_unlock_force): New function
7422         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7423
7424         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7425         (__lll_mutex_unlock_force): New function.
7426         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7427
7428         * tst-rwlock7.c (do_test): Use correct format specifier.
7429
7430         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7431         Find break parameter in correct asm argument.
7432
7433 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7434
7435         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7436         Remove out4.
7437         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7438         error occured.
7439         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7440         Add __mutex.
7441         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7442         lll_futex_requeue, lll_mutex_unlock_force): Define.
7443
7444 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7445
7446         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7447         (pthread_cond_t): Add __mutex.
7448         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7449         lll_futex_requeue, lll_mutex_unlock_force): Define.
7450
7451 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7452
7453         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7454         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7455         Add __mutex field.
7456         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7457         Define.
7458         (lll_futex_wait, lll_futex_wake): Define.
7459         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7460         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7461         FUTEX_REQUEUE instead of FUTEX_WAIT.
7462         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7463         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7464         mutex which was used in condvar structure.  Call
7465         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7466         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7467
7468         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7469         include tcb-offsets.h.  Read wakeup value in locked region.
7470         Use the value of gbr register as THREAD_ID.
7471         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7472         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7473         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7474
7475         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7476         macros.
7477
7478 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7479
7480         * sysdeps/pthread/pthread_cond_broadcast.c
7481         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7482
7483 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7484
7485         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7486         typo in register name.
7487         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7488         correctly.  Actually use requeue.  Little optimization.
7489         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7490         mutex address early.  Handle cancellation state as 32-bit value.
7491         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7492         Remove unnecessary label.
7493
7494 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7495
7496         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7497         instead of FUTEX_WAIT.
7498         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7499         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7500         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7501         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7502         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7503         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7504         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7505         of __pthread_mutex_lock_internal.
7506         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7507         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7508         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7509         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7510         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7511         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7512         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7513         Add pthread_mutex_cond_lock.
7514         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7515         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7516         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7517         lll_mutex_cond_lock.
7518         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7519         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7520         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7521         Add __mutex field.
7522         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7523         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7524
7525         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7526         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7527
7528         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7529         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7530         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7531         macro don't define aliases.
7532
7533         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7534         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7535         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7536         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7537         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7538         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7539         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7540         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7541         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7542
7543 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7544
7545         * sem_open.c: Fix one endless loop.  Implement correct semantics
7546         wrt opening the same semaphore more then once.
7547         * sem_close.c: Adjust for sem_open change.
7548         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7549         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7550         * Makefile (tests): Add tst-sem7.
7551         * tst-sem7.c: New file.
7552
7553 2003-05-16  Roland McGrath  <roland@redhat.com>
7554
7555         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7556         uninitialized variable braino.
7557
7558 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7559
7560         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7561         test for syscall availability.
7562
7563         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7564         __no_posix_timers to -1 if the syscalls don't exist.
7565
7566         * pthread_join.c (pthread_join): Set tid field of the joined
7567         thread to -1.  This isn't necessary but helps to recognize some
7568         error conditions with almost no cost.
7569
7570         * allocatestack.c (FREE_P): Also negative values indicate an
7571         unused stack.
7572
7573         * unwind.c: Include <unistd.h>.
7574
7575 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7576
7577         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7578
7579 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7580
7581         * Makefile (crti-objs, crtn-objs): New variables.
7582         (omit-deps, extra-objs): Add crtn.
7583         ($(objpfx)libpthread.so): Depend on both crti and crtn
7584         and links to them in multidir.
7585         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7586
7587 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7588
7589         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7590         (lll_mutex_unlock): Use atomic_exchange_rel.
7591
7592 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7593
7594         * cond-perf.c (cons): Add missing locking around setting of alldone.
7595
7596 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7597
7598         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7599         related macros.
7600         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7601
7602 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7603
7604         * tst-sem6.c: New file.
7605         * Makefile (tests): Add tst-sem6.
7606
7607         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7608         Use atomic_exchange_rel instead of atomic_exchange.
7609         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7610         Likewise.
7611
7612         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7613         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7614         vsyscall is possible.
7615
7616         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7617         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7618         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7619         pthread_setaffinity_np.
7620         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7621         and pthread_setaffinity_np.
7622         * Makefile (libpthread-routines): Add pthread_getaffinity and
7623         pthread_setaffinity.
7624
7625         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7626         use it in case mmap to allocate the stack fails.
7627         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7628         ARCH_MAP_FLAGS here.
7629         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7630         ARCH_RETRY_MMAP.
7631
7632 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7633
7634         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7635         handler implementation.  It is now lockless in fork().
7636         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7637         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7638         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7639         declare the __fork_*_lists.
7640         (struct fork_handler): Include pointers to all three functions.
7641         Add next, refcntr and need_signal elements.
7642         (__fork_handlers): New declaration.
7643         (__register_atfork_malloc): Remove declaration.
7644         (HAVE_register_atfork_malloc): Remove definition.
7645         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7646         __pthread_child_handler variable.
7647         (__libc_pthread_init): Use __register_atfork instead of explicitly
7648         adding to the list.
7649         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7650         and lll_futex_wake.
7651         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7652
7653         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7654         function must never be reached.
7655
7656         * cond-perf.c: New file.
7657
7658 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7659
7660         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7661
7662 2003-05-04  Roland McGrath  <roland@redhat.com>
7663
7664         * Makefile ($(objpfx)../libc.so): New target.
7665
7666 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7667
7668         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7669         (pthread_condattr_t): Size is only an int, don't use long for
7670         alignment.
7671         (pthread_mutexattr_t): Likewise.
7672         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7673         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7674         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7675
7676 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7677
7678         * sysdeps/i386/tls.h: Define THREAD_ID.
7679         * sysdeps/ia64/tls.h: Likewise.
7680         * sysdeps/powerpc/tls.h: Likewise.
7681         * sysdeps/s390/tls.h: Likewise.
7682         * sysdeps/sh/tls.h: Likewise.
7683         * sysdeps/x86_64/tls.h: Likewise.
7684         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7685         record ownership.
7686         * pthread_mutex_timedlock.c: Likewise.
7687         * pthread_mutex_trylock.c: Likewise.
7688         * pthread_mutex_unlock.c: Likewise.
7689         * pthread_rwlock_trywrlock.c: Likewise.
7690         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7691         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7692         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7693         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7694
7695         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7696         flag.
7697
7698 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7699
7700         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7701         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7702         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7703         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7704         Make __align long long instead of long.
7705         (pthread_rwlock_t): Formatting.
7706         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7707         (pthread_rwlock_t): Formatting.
7708         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7709         (pthread_cond_t): Make __align long long instead of long.
7710         (pthread_rwlock_t): Move __flags field to the same position as in
7711         linuxthreads.
7712
7713 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7714
7715         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7716         * tst-rwlock7.c (do_test): Likewise.
7717
7718 2003-04-26  Roland McGrath  <roland@redhat.com>
7719
7720         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7721
7722 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7723
7724         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7725         sizeof (struct pthread).
7726         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7727         1 struct pthread.
7728         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7729         to 0.
7730         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7731         struct pthread.
7732         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7733         to 32-bit bytes.
7734         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7735         tcbp.
7736         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7737         unneccessarily.
7738         (NO_TLS_OFFSET): Define.
7739         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7740         add TLS_TCB_SIZE unnecessarily.
7741
7742 2003-04-22  Roland McGrath  <roland@redhat.com>
7743
7744         * Makeconfig (shared-thread-library): Reverse link order to work
7745         around linker bug.
7746
7747 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7748
7749         * semaphore.h: Fix typo in comment.
7750
7751 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7752
7753         * sysdeps/pthread/sigfillset.c: New file.
7754
7755         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7756         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7757         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7758         * sysdeps/pthread/sigaction.c: Likewise.
7759         * sysdeps/pthread/sigprocmask.c: New file.
7760         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7761         __SIGRTMIN+1.
7762         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7763         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7764         in this case.
7765
7766 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7767
7768         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7769         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7770
7771         * sysdeps/unix/sysv/linux/unregister-atfork.c
7772         (__unregister_atfork): Don't free memory not allocated dynamically.
7773
7774         * semaphore.h: Remove __THROW marker from cancellation points.
7775         * nptl/sysdeps/pthread/pthread.h: Likewise.
7776
7777 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7778
7779         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7780         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7781         __THROW.
7782
7783 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7784
7785         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7786
7787 2003-04-15  Roland McGrath  <roland@redhat.com>
7788
7789         * forward.c (__pthread_unwind): Tweak to avoid warning.
7790
7791 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7792
7793         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7794
7795 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7796
7797         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7798         overflow CFA advance instructions.
7799         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7800
7801 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7802
7803         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7804         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7805         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7806         defined.
7807
7808         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7809         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7810         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7811         DW_CFA_advance_loc for .Laddl-.Lsubl.
7812
7813 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7814
7815         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7816         position-independent unwind data for static libraries.
7817         Add missing unwind info.  Add comments.
7818
7819         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7820         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7821         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7822         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7823
7824 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7825
7826         * Makefile: Make sure all cancellation points are compiled with
7827         exception and asynchronous unwind tables.
7828
7829         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7830         which mishandles loading of global object addresses in PIC.
7831         (THREAD_SETMEM_NC): Likewise.
7832
7833 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7834
7835         * pthread.h: Define new data structure for cleanup buffer.  Declare
7836         new cleanup handler interfaces.
7837         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7838         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7839         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7840         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7841         it.  Declare old cleanup handler installation functions.
7842         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7843         handling.
7844         * cleanup_defer.c: Likewise.
7845         * cleanup_compat.c: New file.  Old cleanup code.
7846         * cleanup_def_compat.c: New file.  Old cleanup code.
7847         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7848         if own thread descriptor.
7849         * unwind.c: New file.
7850         * forward.c: Add __pthread_unwind.
7851         * init.c (pthread_functions): Add __pthread_unwind.
7852         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7853         Add ptr___pthread_unwind.
7854         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7855         and unwind function.
7856         * Makefile (libpthread-routines): Add cleanup_compat,
7857         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7858         table generation if necessary.
7859         * version.c: Record whether unwind support is compiled in.
7860         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7861         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7862         handler interfaces.
7863         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7864         complication to generate unwind information for syscall wrappers.
7865         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7866         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7867         __cleanup_fct_attribute.
7868
7869         * Makefile: Add rules to build and run tst-cleanup0.
7870         * tst-cleanup0.c: New file.
7871         * tst-cleanup0.expect: New file.
7872
7873         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7874         caller.  Optimize to avoid often unecessary local variable.
7875
7876 2003-04-11  Roland McGrath  <roland@redhat.com>
7877
7878         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7879         sets variable `multidir'; include that.
7880         (generated): Add it.
7881         ($(objpfx)$(multidir)/crti.o): New target.
7882         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7883
7884 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7885
7886         * tst-attr2.c (do_test): Add cast to avoid warning.
7887         * tst-mutex4.c (do_test): Likewise.
7888
7889 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7890
7891         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7892         in child.
7893
7894 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7895
7896         * Makefile (tests): Add tst-detach1.
7897         * tst-detach1.c: New file.
7898
7899 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7900
7901         * sysdeps/pthread/pthread.h: Remove duplicate
7902         pthread_cleanup_{push,pop} definitions.
7903
7904         * tst-barrier2.c: Eliminate warnings.
7905         * tst-cancel4.c: Likewise.
7906         * tst-cond4.c: Likewise.
7907         * tst-cond6.c: Likewise.
7908         * tst-detach1.c: Likewise.
7909         * tst-rwlock4.c: Likewise.
7910         * tst-rwlock6.c: Likewise.
7911         * tst-rwlock7.c: Likewise.
7912         * tst-sem3.c: Likewise.
7913         * tst-spin2.c: Likewise.
7914         * tst-umask1.c: Likewise.
7915
7916 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7917
7918         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7919
7920 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7921
7922         * descr.h (struct pthread): Move cancelhandling member to the front.
7923
7924 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7925
7926         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7927         malloc_parent, and malloc_child statically.
7928         (__register_atfork_malloc): New function.
7929         (free_mem): Don't free any of the malloc_* variables on the list.
7930         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7931         Define HAVE_register_atfork_malloc.
7932
7933 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7934
7935         * sysdeps/pthread/createthread.c (create_thread): Add some more
7936         comments explaining when to set multiple_threads and when not.
7937
7938         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7939         THREAD_ATOMIC_BIT_SET if not already defined.
7940         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7941         THREAD_ATOMIC_BIT_SET:
7942         * sysdeps/x86_64/tls.h: Likewise.
7943         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7944         THREAD_ATOMIC_CMPXCHG_VAL.
7945         (_pthread_cleanup_pop_restore): Likewise.
7946         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7947         (__pthread_enable_asynccancel_2): Likewise.
7948         (__pthread_disable_asynccancel): Likewise.
7949         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7950         (__libc_disable_asynccancel): Likewise.
7951         * init.c (sigcancel_handler): Likewise.
7952         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7953         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7954
7955 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7956
7957         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7958         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7959         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7960         * Makefile (tests): Add tst-cancel11.
7961         * tst-cancel11.c: New file.
7962
7963 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7964
7965         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7966         round, not the first.  Use specific_used flag instead of local
7967         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7968         (__free_tcb): Don't call deallocate_tsd here.
7969         (start_thread): Call deallocate_tsd here.
7970         * pthread_setspecific.c: Set specific_used flag really only when
7971         needed.
7972         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7973         * tst-tsd3.c: New file.
7974         * tst-tsd4.c: New file.
7975
7976 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7977
7978         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7979         Use atomic_exchange_and_add instead of __lll_add.
7980         (__lll_mutex_timedlock): Likewise.
7981         Patch by Ian Wienand.
7982
7983 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7984
7985         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7986         (SINGLE_THREAD_P): Fix typo.
7987         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7988
7989 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7990
7991         * Makefile (tests): Add tst-align.
7992         * tst-align.c: New file.
7993         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7994
7995         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7996         function correctly.
7997
7998         * tst-tsd2.c: Add casts to avoid warnings.
7999
8000 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
8001
8002         * descr.h (struct pthread): Move most often used elements to the front.
8003
8004 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
8005
8006         * Makefile (libpthread-routines): Add pthread_atfork.
8007         (libpthread-static-only-routines): Add pthread_atfork.
8008
8009 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8010
8011         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
8012         of TLS_DTV_AT_TP.
8013         (INSTALL_DTV): Add parens.
8014         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
8015         Use passed descr instead of THREAD_SELF.
8016         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
8017         (__lll_mutex_timedlock_wait): Correct expected value after
8018         spurious wakeup.
8019         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
8020         Release lock before waking up the waiters.
8021         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
8022         criteria.  Reorderstruct passed to cleanup handler.  Fix
8023         handling of cancellation and failung pthread_mutex_unlock call.
8024         Use __pthread_enable_asynccancel_2 instead of
8025         __pthread_enable_asynccancel.
8026         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8027         Return result of lock re-get if it fails.
8028         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
8029         for __pthread_cleanup_push.
8030         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
8031         completely broken rwlock implementation.
8032         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8033         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8034         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8035         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
8036         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8037         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
8038         versioned_symbol macro.
8039         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
8040         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8041
8042 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
8043
8044         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
8045         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
8046         and __helper_tid.
8047         (struct timer): Remove th and bar field.
8048         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
8049         debugging code.  Create only one helper thread.
8050         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
8051         helper thread.
8052         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8053         Renamed.  Define statically.  Use thread info from siginfo.
8054         (__helper_once): New variable.
8055         (__helper_tid): New variable.
8056         (__reset_helper_control): New function.
8057         (__start_helper_thread): New function.
8058
8059         * pthread_create.c (start_thread): Don't use setjmp inside
8060         __builtin_expect to work around gcc bug.
8061
8062         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
8063         timer_delete syscall fails, but not with ENOSYS, set
8064         __no_posix_timers.
8065
8066         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
8067         (timer_settime): Fix typo.
8068         * sysdeps/unix/sysv/linux/timer_getoverr.c
8069         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
8070
8071 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
8072
8073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
8074         offset of cleanupbuf.__prev.
8075
8076 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8077
8078         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8079         of included file.
8080
8081 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8082
8083         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8084         NULL provide default definition to syscall.
8085
8086 2003-03-25  Roland McGrath  <roland@redhat.com>
8087
8088         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8089         (timer_id2ptr): Fix typo.
8090
8091 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8092
8093         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8094         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8095         * sysdeps/ia64/pthreaddef.h: Likewise.
8096         * sysdeps/powerpc/pthreaddef.h: Likewise.
8097         * sysdeps/s390/pthreaddef.h: Likewise.
8098         * sysdeps/sh/pthreaddef.h: Likewise.
8099         * sysdeps/x86_64/pthreaddef.h: Likewise.
8100         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8101         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8102         being changed.
8103         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8104         SIGTIMER is not unblocked.
8105         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8106         RT signal taken.
8107         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8108         be send.
8109         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8110         pass pointer through as ID.
8111         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8112         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8113         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8114         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8115         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8116         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8117         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8118         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8119         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8120         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8121         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8122         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8123         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8124         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8125         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8126         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8127         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8128         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8129         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8130         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8131         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8132         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8133         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8134         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8135         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8136         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8137         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8138         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8139         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8140         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8141         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8142         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8143         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8144
8145         * pthreadP.h: Remove FRAME_LEFT definition.
8146         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8147         already left frame.  Programs which have this problem are not POSIX
8148         compliant.
8149         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8150
8151 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8152
8153         * sysdeps/pthread/tst-timer.c: Check return values of the
8154         functions we test.
8155
8156 2003-03-23  Roland McGrath  <roland@redhat.com>
8157
8158         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8159         * tst-tls3mod.c: Likewise.
8160         * tst-tls1.c: Likewise.
8161         * tst-tls2.c: Likewise.
8162
8163         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8164         undefined behavior.
8165
8166         * tst-join5.c (tf1, tf2): Add a cast.
8167
8168         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8169
8170         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8171         Don't test anything.
8172         * tst-cond4.c: Likewise.
8173         * tst-cond6.c: Likewise.
8174         * tst-flock2.c: Likewise.
8175         * tst-mutex4.c: Likewise.
8176         * tst-rwlock4.c: Likewise.
8177         * tst-signal1.c: Likewise.
8178         * tst-spin2.c: Likewise.
8179         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8180
8181         * tst-mutex4.c: Use test-skeleton.c.
8182         * tst-spin2.c: Likewise.
8183         * tst-sysconf.c: Likewise.
8184         * tst-barrier2.c: Likewise.
8185         * tst-cond4.c: Likewise.
8186         * tst-cond6.c: Likewise.
8187         * tst-rwlock4.c: Likewise.
8188         * tst-unload.c: Likewise.
8189         * tst-flock2.c (do_test): Use return instead of exit.
8190
8191 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8192
8193         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8194
8195 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8196
8197         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8198         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8199         instead of __lll_compare_and_swap.
8200         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8201         Likewise.
8202         Removed definition if __lll_compare_and_swap.
8203
8204         * cancellation.c: Adjust for new form of compare&exchange macros.
8205         * cleanup_defer.c: Likewise.
8206         * init.c: Likewise.
8207         * libc-cancellation.c: Likewise.
8208         * old_pthread_cond_broadcast.c: Likewise.
8209         * old_pthread_cond_signal.c: Likewise.
8210         * old_pthread_cond_timedwait.c: Likewise.
8211         * old_pthread_cond_wait.c: Likewise.
8212         * pthread_cancel.c: Likewise.
8213         * pthread_create.c: Likewise.
8214         * pthread_detach.c: Likewise.
8215         * pthread_join.c: Likewise.
8216         * pthread_key_delete.c: Likewise.
8217         * pthread_setcancelstate.c: Likewise.
8218         * pthread_setcanceltype.c: Likewise.
8219         * pthread_timedjoin.c: Likewise.
8220         * pthread_tryjoin.c: Likewise.
8221         * sysdeps/pthread/createthread.c: Likewise.
8222
8223 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8224
8225         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8226         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8227         definitions.  Replace uses with calls to atomic_* functions.
8228         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8229         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8230         __lll_test_and_set calls with atomic_exchange_and_add and
8231         atomic_exchange calls respectively.
8232         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8233         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8234         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8235         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8236         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8237         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8238         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8239
8240         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8241         returns the old value.
8242
8243 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8244
8245         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8246         int for variable OLDVAL and correct inline assembler contraint.
8247         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8248         type int for variable OLD.
8249
8250         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8251         only for s390-32.
8252         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8253         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8254         instead of multiple_threads field in the TCB.
8255
8256 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8257
8258         * sysdeps/i386/i686/bits/atomic.h: Removed.
8259         * sysdeps/i386/i586/bits/atomic.h: Removed.
8260         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8261         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8262         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8263         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8264         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8265         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8266         * atomic.h: Removed.  Moved to glibc.
8267
8268         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8269         support for clock selection.
8270
8271         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8272         signalling waiters.
8273
8274 2003-03-18  Roland McGrath  <roland@redhat.com>
8275
8276         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8277         Add __lll_rel_instr first.  Add memory clobber.
8278         (lll_mutex_unlock): Use __lll_test_and_set.
8279         From Paul Mackerras <paulus@samba.org>.
8280
8281         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8282         unconditionally.
8283         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8284         (SINGLE_THREAD_P):  Add `header.' prefix.
8285         From Paul Mackerras <paulus@samba.org>.
8286
8287         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8288         pthread_timedjoin_np to ...
8289         (libpthread: GLIBC_2.3.3): ... here.
8290         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8291
8292         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8293         Avoid shadowing VAL variable.
8294
8295         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8296         New macro.
8297
8298 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8299
8300         * Makefile (tests): Add tst-cond11.
8301         * tst-cond11.c: New file.
8302
8303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8304         struct passed to cleanup handler to eliminate one more
8305         instruction.
8306         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8307
8308         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8309         (pthrad_cond_t): Replace __unused field with __clock.
8310
8311         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8312         waken all waiters in cleanup handler.
8313         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8314         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8315
8316         * pthread_condattr_getclock.c: New file.
8317         * pthread_condattr_setclock.c: New file.
8318         * sysdeps/pthread/pthread.h: Declare these new functions.
8319         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8320         * Makefile (libpthread-routines): Add the new functions.
8321         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8322         Renamed field to value.  Document use of the bits.
8323         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8324         change.
8325         * pthread_condattr_setpshared.c: Likewise.
8326         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8327         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8328         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8329         Add __clock field.
8330         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8331         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8332         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8333         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8334         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8335         Implement clock selection.
8336         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8337         * pthread-errnos.sym: Add ENOSYS.
8338         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8339         _POSIX_CLOCK_SELECTION.
8340         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8341
8342         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8343         invalid .size directive.
8344
8345 2003-03-17  Roland McGrath  <roland@redhat.com>
8346
8347         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8348         Formatting tweaks.
8349
8350 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8351
8352         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8353         Use __lll_add instead of spelling it out.  Use protected symbol names.
8354         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8355         Use __lll_add.
8356         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8357         Renamed from lll_compare_and_swap.  Use new name where necessary.
8358         (__lll_add): Defined.
8359         (__lll_dec_if_positive): Defined.
8360         (__lll_test_and_set): Defined.
8361         * sysdeps/ia64/pthread_spin_init.c: Removed.
8362         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8363         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8364         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8365         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8366         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8367         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8368         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8369         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8370         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8371         __sync_lock_release_si.
8372         Patch by Jakub Jelinek.
8373
8374         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8375         Fix timeout handling.
8376         (__lll_timedwait_tid): Likewise.
8377         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8378         Patch by Jakub Jelinek.
8379
8380         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8381
8382 2003-03-17  Roland McGrath  <roland@redhat.com>
8383
8384         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8385         * sysdeps/pthread/pthread_spin_init.c: New file.
8386         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8387         * sysdeps/powerpc/Makefile: New file.
8388         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8389         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8390         * sysdeps/powerpc/pthreaddef.h: New file.
8391         * sysdeps/powerpc/tcb-offsets.sym: New file.
8392         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8393         * sysdeps/powerpc/tls.h: New file.
8394         * sysdeps/powerpc/bits/atomic.h: New file.
8395         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8396         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8397         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8398
8399         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8400         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8401         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8402         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8403         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8404         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8405         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8406         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8407         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8408         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8409         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8410         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8411         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8412         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8413         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8414
8415         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8416         not gettimeofday.
8417         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8418         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8419         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8420         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8421         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8422
8423 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8424
8425         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8426         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8427         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8428         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8429         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8430
8431 2003-03-16  Roland McGrath  <roland@redhat.com>
8432
8433         * tst-fork4.c: Include <string.h>.
8434         * tst-signal2.c: Likewise.
8435         * tst-mutex5.c (do_test): exit -> return.
8436         * tst-mutex2.c: Include <stdlib.h>.
8437
8438 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8439
8440         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8441         (__lll_mutex_timedlock_wait): Correct expected value after
8442         spurious wakeup.  Otherwise we would never wait again.
8443
8444         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8445         zone versus inline asm stupidity.  Use correct instructions.
8446
8447         * tst-rwlock6.c: Add some more status output.
8448
8449 2003-03-15  Roland McGrath  <roland@redhat.com>
8450
8451         * sysdeps/pthread/configure.in: New file.
8452         * sysdeps/pthread/configure: New file (generated).
8453
8454 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8455
8456         * allocatestack.c (allocate_stack): Store the exact stack size of
8457         user allocated stacks.
8458
8459 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8460
8461         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8462         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8463         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8464         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8465         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8466         Use `header.' prefix.
8467         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8468
8469 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8470
8471         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8472         __builtin_frame_address, use stack pointer.
8473
8474         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8475         instead of __builtin_frame_pointer.
8476
8477 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8478
8479         * tst-basic1.c (do_test): Add cast to avoid warning.
8480         * tst-basic2.c (do_test): Likewise.
8481
8482         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8483         amount of stack correction.
8484
8485         * tst-fork4.c: Use test-skeleton.c.
8486
8487 2003-03-14  Roland McGrath  <roland@redhat.com>
8488
8489         * init.c: Fix typo "#eli" for "#else".
8490
8491 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8492
8493         * allocatestack.c (__stack_user): Use hidden_data_def.
8494         * pthread_create.c (__pthread_keys): Likewise.
8495
8496         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8497
8498 2003-03-14  Roland McGrath  <roland@redhat.com>
8499
8500         * tst-fork4.c: New file.
8501         * Makefile (tests): Add it.
8502
8503         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8504         we always define the padding space.
8505         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8506         stopped supporting its own extensions fully.
8507         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8508         struct also called `header', so `header.multiple_threads' is the field
8509         name to use on all machines.
8510         * allocatestack.c (allocate_stack): Use `header.' prefix.
8511         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8512         * pthread_create.c (__pthread_create_2_1): Likewise.
8513         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8514         (THREAD_SELF): Likewise.
8515         * sysdeps/x86_64/tls.h: Likewise.
8516         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8517         (SINGLE_THREAD_P): Likewise.
8518         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8519         (SINGLE_THREAD_P): Likewise.
8520         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8521         (SINGLE_THREAD_P): Likewise.
8522
8523         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8524         value directly.
8525
8526 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8527
8528         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8529         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8530
8531         * pthread_create.c (start_thread): setjmp is expected to return 0.
8532
8533         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8534         (THREAD_GETMEM_NC): Likewise.
8535
8536 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8537
8538         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8539         and the size of the stack which must be allocated is a multiple,
8540         allocate one more page.
8541         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8542         MULTI_PAGE_ALIASING.
8543
8544 2003-03-13  Roland McGrath  <roland@redhat.com>
8545
8546         * pthread_create.c (start_thread): Set EXITING_BIT after the
8547         event-reporting (and destructors), not before.
8548
8549 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8550
8551         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8552         lll_futex_wake): Declare register variables as long int instead of
8553         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8554         Make syscall arguments clobbered by the syscall.
8555         (lll_futex_wait): Define using lll_futex_timed_wait.
8556
8557         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8558         to void *.
8559
8560         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8561         PPID if [! NDEBUG].
8562
8563         * allocatestack.c (nptl_ncreated): Only declare if
8564         COLORING_INCREMENT != 0.
8565
8566         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8567         (__libc_enable_asynccancel_2): Remove prototype.
8568
8569         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8570         ctid to match kernel.
8571
8572 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8573
8574         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8575         libc_multiple_threads.
8576         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8577         __libc_multiple_threads to...
8578         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8579
8580         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8581         versioning.
8582         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8583         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8584
8585         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8586         (__pthread_once_internal): Define.
8587
8588         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8589         macros instead of .symver directly.
8590         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8591         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8592
8593         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8594         * sysdeps/x86_64/tcb-offsets.sym: New file.
8595         * sysdeps/x86_64/Makefile: New file.
8596
8597         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8598         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8599         to access own pthread_t in TCB.
8600         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8601         Likewise.
8602         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8603         Likewise.
8604         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8605
8606 2003-03-12  Roland McGrath  <roland@redhat.com>
8607
8608         * pthread-errnos.sym: New file.
8609         * Makefile (gen-as-const-headers): New variable, list that file.
8610         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8611         header <pthread-errnos.h> instead of defining errno values here.
8612         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8613         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8614         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8615         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8616         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8617         Likewise.
8618         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8619         Likewise.
8620         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8621         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8622         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8623         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8624         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8625         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8626         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8627         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8628         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8629         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8630         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8631         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8632         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8633         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8634         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8635         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8636         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8637         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8638         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8639         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8640         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8641         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8642         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8643         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8644         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8645         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8646         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8647
8648         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8649         CLONE_CHILD_SETTID worked.
8650
8651 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8652
8653         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8654         file.
8655         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8656         file.
8657
8658         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8659         (pthread_cond_t): Add padding.
8660
8661         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8662         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8663         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8664
8665         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8666         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8667         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8668         (__pthread_rwlock_timedrdlock): Likewise.
8669         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8670         (__pthread_rwlock_wrlock): Likewise.
8671         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8672         (__pthread_rwlock_rdlock): Likewise.
8673
8674         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8675
8676         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8677         result of lock re-get if it fails.
8678
8679 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8680
8681         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8682         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8683         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8684         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8685         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8686         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8687         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8688         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8689         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8690         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8691
8692         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8693         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8694
8695         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8696         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8697         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8698         (create_thread): Likewise.
8699         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8700         * init.c (__pthread_initialize_minimal_internal): Initialize
8701         __libc_multiple_threads_ptr if necessary.
8702         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8703         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8704         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8705         __libc_multiple_threads.
8706         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8707         necessary.
8708
8709         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8710         (THREAD_SETMEM_NC): Likewise.
8711
8712         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8713         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8714         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8715         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8716
8717         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8718         Eliminate one entire instruction.
8719
8720         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8721         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8722         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8723         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8724         instead of __pthread_enable_asynccancel.
8725         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8726         (__pthread_cond_wait): Likewise.
8727         * sysdeps/pthread/pthread_cond_timedwait.c
8728         (__pthread_cond_timedwait): Likewise.
8729         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8730
8731         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8732         (__condvar_cleanup): Wake up all waiters in case we got signaled
8733         after being woken up but before disabling asynchronous
8734         cancellation.
8735         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8736         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8737         (__condvar_cleanup): Likewise.
8738
8739         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8740         Make it an error if architecture has no #if case.  Add x86-64.
8741
8742         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8743         pt-initfini.s generation.
8744
8745         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8746         (TLS_INIT_TP): Fix typo.
8747
8748 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8749
8750         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8751         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8752
8753         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8754         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8755         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8756         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8757         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8758         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8759         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8760         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8761
8762 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8763
8764         * sysdeps/pthread/pthread_cond_timedwait.c
8765         (__pthread_cond_timedwait): Return the result of the final
8766         locking.  If it succeeds, the regular function return value.
8767
8768         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8769         Return result of the final locking.
8770         * version.c (__nptl_main): Work around problems with the strange
8771         INTERNAL_SYSCALL macro on ppc32.
8772         * init.c (__pthread_initialize_minimal_internal): Unblock
8773         SIGCANCEL in case the parent blocked it.
8774         Reported by Paul Mackerras <paulus@samba.org>.
8775
8776         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8777         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8778         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8779
8780 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8781
8782         * sysdeps/pthread/pthread_cond_timedwait.c
8783         (__pthread_cond_timedwait): Unlock and fail if
8784         __pthread_mutex_unlock_internal failed.
8785
8786         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8787         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8788         Use ARCH_CLONE.
8789         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8790         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8791         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8792         ALLOCATE_STACK): New macros.
8793         (TLS_TPADJ): New macro.
8794         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8795         (allocate_stack): Handle TLS_DTV_AT_TP and
8796         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8797         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8798         Don't set PD->self.
8799         * init.c [__ia64__] (__NR_set_tid_address): Define.
8800
8801         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8802         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8803         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8804         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8805         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8806         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8807         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8808         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8809         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8810         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8811         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8812         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8813         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8814         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8815         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8816         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8817         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8818         * sysdeps/ia64/bits/atomic.h: New file.
8819         * sysdeps/ia64/Makefile: New file.
8820         * sysdeps/ia64/pthread_spin_init.c: New file.
8821         * sysdeps/ia64/pthread_spin_lock.c: New file.
8822         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8823         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8824         * sysdeps/ia64/pthreaddef.h: New file.
8825         * sysdeps/ia64/tcb-offsets.sym: New file.
8826         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8827         * sysdeps/ia64/tls.h: New file.
8828
8829         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8830         to syscall instead of no arguments.
8831
8832 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8833
8834         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8835         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8836         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8837         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8838
8839         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8840         unused code.
8841
8842         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8843
8844         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8845         lowlevelbarrier.sym.
8846         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8847         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8848         Include lowlevelbarrier.h and don't define offsets locally.
8849         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8850
8851         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8852         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8853         (__lll_mutex_timedlock_wait): Likewise.
8854         (lll_mutex_lock): Adjust asm for that.
8855         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8856         (lll_lock): Adjust asm for operand order change.
8857         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8858         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8859
8860         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8861         Reverse order of parameters.
8862         (__lll_timedwait_tid): Remove regparms attribute.
8863         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8864         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8865
8866         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8867         (__lll_timedwait_tid): Remove one unnecessary instruction.
8868
8869         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8870         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8871         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8872         lowlevelmutex.S.
8873
8874         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8875         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8876         for NOT_IN_libc.
8877         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8878         lowlevellock.S.
8879
8880         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8881         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8882         for libc.so.
8883         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8884         define LOCK here (if UP is not defined).  The actual code is in
8885         lowlevelmutex.S.
8886
8887         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8888         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8889         __lll_timedwait_tid for libc.so.
8890         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8891         define LOCK here (if UP is not defined).  The actual code is in
8892         lowlevellock.S.
8893
8894         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8895         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8896         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8897         instead of lowlevelsem.h.
8898         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8899         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8900         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8901
8902         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8903         lowlevelrwlock.sym.
8904         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8905         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8906         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8907
8908         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8909         register loading.
8910         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8911         last changed.  D'oh.
8912
8913         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8914
8915         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8916         of __libc_locking_needed.
8917         (lll_trylock): Initialize %eax to zero.
8918
8919         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8920         pthread_cond_t definition.
8921
8922 2003-03-10  Roland McGrath  <roland@redhat.com>
8923
8924         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8925         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8926         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8927         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8928         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8929
8930         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8931         Instead of setting PD->multiple_threads, set globals
8932         __pthread_multiple_threads and __libc_multiple_threads.
8933         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8934         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8935         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8936
8937         * descr.h (struct pthread): Conditionalize first member on
8938         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8939         containing an anonymous tcbhead_t.  Move `list' member out.
8940         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8941         * allocatestack.c: Remove use of `header.data.' prefix.
8942         * pthread_create.c: Likewise.
8943         * init.c (__pthread_initialize_minimal_internal): Likewise.
8944         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8945         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8946         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8947         * sysdeps/x86_64/tls.h: Likewise.
8948         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8949         (SINGLE_THREAD_P): Likewise.
8950         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8951         (SINGLE_THREAD_P): Likewise.
8952         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8953         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8954
8955 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8956
8957         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8958
8959         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8960         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8961
8962         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8963         leftovers from the ia32 code.
8964
8965         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8966         memory load.
8967         (clear_once_control): Don't load %esi.
8968
8969         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8970         handling.
8971
8972         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8973
8974         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8975         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8976
8977         * Makefile (tests): Add tst-cond10.
8978         * tst-cond10.c: New file.
8979
8980 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8981
8982         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8983         * tst-signal3.c (do_test): Likewise.
8984         * tst-sem5.c (do_test): Likewise.
8985         * tst-kill6.c (do_test): Likewise.
8986         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8987
8988         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8989         of inc/dec.
8990         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8991         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8992         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8993         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8994         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8995         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8996         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8997         Likewise.
8998         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8999         Likewise.
9000         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9001         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9002         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9003         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9004         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9005         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9006         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9007         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9008
9009         * allocatestack.c (allocate_stack): If mprotect() fails free the
9010         TLS memory.
9011
9012 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
9013
9014         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
9015
9016         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
9017         lll_wake_tid.  This was used only to work around kernel limits in
9018         the early days.
9019         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
9020         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
9021         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9022         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
9023
9024         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
9025         (__pthread_initialize_minimal_internal): Change initialization of
9026         __static_tls_align_m1 appropriately.
9027         * pthreadP.h (__static_tls_align_m1): Renamed from
9028         __static_tls_align.
9029         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
9030         instead of __static_tls_align-1.
9031
9032 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
9033
9034         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
9035
9036         * pthread_create.c: Define __pthread_keys using nocommon
9037         attribute, not by placing it explicitly in bss.
9038         Remove DEFINE_DEALLOC definition.  Not needed anymore.
9039
9040         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
9041         Use it in mmap call to allocate stacks.
9042
9043         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
9044
9045         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
9046         result of the thread function.
9047
9048 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
9049
9050         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
9051         version is just fine.
9052
9053         * sysdeps/unix/sysv/linux/libc_pthread_init.c
9054         (__pthread_child_handler): Renamed from pthread_child_handler,
9055         exported, and marked hidden.  Change all users.
9056         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
9057         free __pthread_child_handler from child list.
9058
9059 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9060
9061         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
9062
9063         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9064         Fix handling of cancellation and failing pthread_mutex_unlock call.
9065         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9066         (__pthread_cond_wait): Likewise.
9067
9068         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
9069         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
9070         lll_futex_timed_wait call.
9071         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
9072         (pthread_rwlock_timedwrlock): Likewise.
9073
9074         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
9075         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
9076         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9077
9078         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9079         check of lll_futex_wake return value.
9080
9081 2003-03-03  Roland McGrath  <roland@redhat.com>
9082
9083         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9084
9085         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9086         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9087         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9088
9089 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9090
9091         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9092         error for CPU clocks.
9093
9094         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9095         _POSIX_MONOTONIC_CLOCK.
9096         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9097
9098         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9099         recent kernels.
9100
9101 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9102
9103         * descr.h (struct pthread): Move cleanup field to the front.
9104
9105 2003-03-01  Roland McGrath  <roland@redhat.com>
9106
9107         * sem_open.c (sem_open): Braino fix.
9108
9109 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9110
9111         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9112         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9113         __pthread_cleanup_pop functionality.
9114         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9115
9116         * descr.h (struct pthread): Move tid field to the front now that
9117         it is often used.
9118
9119         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9120         (__lll_mutex_timedlock_wait): Remove.
9121         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9122         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9123         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9124         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9125         (lll_unlock_wake_cb): Don't save and restore %esi.
9126         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9127         %esi.
9128         (__lll_timedwait_tid): Add alignment.
9129         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9130         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9131         %esi.
9132         (__lll_timedwait_tid): Removed.
9133         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9134         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9135         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9136         (pthread_barrier_wait): Don't save, load, and restore %esi for
9137         last thread.
9138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9139         (__pthread_cond_signal): Don't save, load, and restore %esi.
9140         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9141         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9142         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9143         Don't save, load, and restore %esi.
9144
9145 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9146
9147         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9148         Release lock before waking up the waiters.
9149
9150         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9151
9152         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9153         (reader_thread): Likewise.
9154
9155         * sysdeps/pthread/pthread_rwlock_unlock.c
9156         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9157         to wake up readers if there are none.
9158
9159         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9160         Release internal lock before wake threads.
9161
9162 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9163
9164         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9165         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9166         predefined.
9167         * tst-rwlock9.c: Likewise.
9168         * tst-rwlock10.c: New file.
9169         * tst-rwlock11.c: New file.
9170
9171         * Makefile (tests): Add tst-dlsym1.
9172         * tst-dlsym1.c: New file.
9173
9174         * init.c (__pthread_initialize_minimal_internal): Set
9175         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9176         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9177
9178 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9179
9180         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9181
9182         * tst-cond2.c: Fix sychronization with child.
9183
9184         * tst-rwlock8.c (reader_thread): Remove unused variable.
9185
9186         * Makefile: Add rules to build and run tst-tls3.
9187         * tst-tls3.c: New file.
9188         * tst-tls3mod.c: New file.
9189
9190         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9191         * tst-rwlock8.c: New file.
9192         * tst-rwlock9.c: New file.
9193         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9194         complete broken rwlock implementation.
9195         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9196         Likewise.
9197         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9198         Likewise.
9199         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9200         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9201         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9202         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9203         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9204         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9205         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9206
9207 2003-02-23  Roland McGrath  <roland@redhat.com>
9208
9209         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9210
9211 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9212
9213         * Makefile (tests): Add tst-context1.
9214         * tst-context1.c: New file.
9215
9216         * Makefile (tests): Add tst-tls1 and tst-tls2.
9217         * tst-tls1.c: New file.
9218         * tst-tls2.c: New file.
9219
9220         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9221         for failed cmpxchg.
9222
9223         * pthread_create.c (start_thread): Set EXITING_BIT early.
9224
9225         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9226         (THREAD_GETMEM_NC): Likewise.
9227
9228 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9229
9230         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9231         off 3 more bytes by using offset-less instructions when possible.
9232
9233         * Makefile: Add dependency for $(objpfx)version.d.
9234
9235         * eintr.c (eintr_source): Add unnecessary return but the compiler
9236         insists.
9237
9238         * tst-kill3.c: Include <unistd.h>.
9239
9240 2003-02-21  Roland McGrath  <roland@redhat.com>
9241
9242         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9243
9244 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9245
9246         * Makefile (tests): Add tst-eintr1.
9247         (distribute): Add eintr.c.
9248         * tst-eintr1.c: New file.
9249         * eintr.c: New file.
9250
9251         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9252
9253         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9254         Disallow sending SIGCANCEL.
9255
9256         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9257         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9258         * tst-kill1.c: New file.
9259         * tst-kill2.c: New file.
9260         * tst-kill3.c: New file.
9261         * tst-kill5.c: New file.
9262         * tst-kill6.c: New file.
9263         * tst-basic7.c: Renamed to...
9264         * tst-kill4.c: ...this.
9265
9266 2003-02-21  Roland McGrath  <roland@redhat.com>
9267
9268         * Makefile (install-lib-ldscripts): New variable.
9269
9270 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9271
9272         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9273         * pthread_cancel.c: Use INVALID_TD_P.
9274         * pthread_detach.c: Likewise.
9275         * pthread_getschedparam.c: Likewise.
9276         * pthread_setschedparam.c: Likewise.
9277         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9278         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9279         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9280         * pthread_timedjoin.c: Likewise.
9281
9282         * tst-basic7.c: Include <signal.h>.
9283
9284         * pthread_join.c (pthread_join): Limited checking for invalid
9285         descriptors.
9286         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9287
9288 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9289
9290         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9291         beginning of the loop.  Clear the entire first block of TSD.
9292         * Makefile (tests): Add tst-key4.
9293         * tst-key4.c: New file.
9294
9295 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9296
9297         * Makefile (tests): Add tst-basic7.
9298         * tst-basic7.c: New file.
9299
9300         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9301         Add some more __builtin_expect.
9302
9303         * pthreadP.h: Define dummy version of DEBUGGING_P.
9304
9305 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9306
9307         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9308         _POSIX_THREAD_PRIORITY_SCHEDULING.
9309         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9310         _XOPEN_REALTIME_THREADS.
9311         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9312
9313         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9314         kernel returns EINVAL for PID <= 0, work around it.
9315
9316         * Makefile (tests): Add tst-signal5.
9317         * tst-signal5.c: New file.
9318
9319         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9320         and LOGIN_NAME_MAX.
9321
9322         * tst-cancel1.c (tf): Block all signals.
9323
9324         * Makefile (tests): Add tst-basic6.
9325         * tst-basic6.c: New file.
9326
9327         * tst-basic1.c: Add test for process ID.
9328
9329         * Makefile (tests): Add tst-cancel10.
9330         * tst-cancel10.c: New file.
9331
9332         * Makefile (tests): Add tst-signal4.
9333         * tst-signal4.c: New file.
9334
9335         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9336         __sigismember instead of sigismember.  Add __builtin_expect.
9337
9338 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9339
9340         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9341         pthread_setcancelstate, and pthread_rwlock_setpshared.
9342
9343         * tst-cancel7.c (do_test): Make sure the pid file exists before
9344         canceling the thread.
9345
9346         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9347         pthread_rwlock_timedrdlock tests.
9348         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9349         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9350         Check for invalid tv_nsec field.
9351         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9352         Likewise.
9353
9354         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9355         recursive mutex of overflow.
9356
9357         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9358
9359         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9360         going into an endless loop.
9361         * Makefile (tests): Add tst-cancel9.
9362         * tst-cancel9.c: New file.
9363
9364         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9365
9366 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9367
9368         * tst-mutex5.c (do_test): Add more timedlock tests.
9369
9370         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9371         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9372
9373         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9374         use INLINE_SYSCALL.  Error number is returned, not -1.
9375
9376         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9377         and __deallocate_stack with internal_function.
9378         * pthread_create.c: Adjust definitions appropriately.
9379         * allocatestack.c: Likewise.
9380
9381         * pthread_join.c: Add one more __builtin_expect.
9382         * pthread_timedjoin.c: Likewise.
9383
9384         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9385         not data of sequence number does not match.
9386         Add one __builtin_expect.
9387
9388         * Makefile (tests): Add tst-clock1.
9389         * tst-clock1.c: New file.
9390
9391         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9392         negative arguments.
9393         * Makefile (tests): Add tst-basic5.
9394         * tst-basic5.c: New file.
9395
9396 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9397
9398         * Makefile (tests): Add tst-basic4.
9399         * tst-basic4.c: New file.
9400
9401         * pthreadP.h: Add declaraction for __nptl_nthreads.
9402         * pthread_create.c: Define __nptl_nthreads
9403         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9404         after thread is done.  If then zero, call exit(0).
9405         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9406         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9407         * init.c (pthread_functions): Initialize ptr_nthreads.
9408         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9409         (__reclaim_stacks): Decrement __nptl_nthreads.
9410         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9411         Define.
9412         * Makefile (tests): Add tst-basic3.
9413         * tst-basic3.c: New file.
9414
9415         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9416         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9417         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9418         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9419         if asynchronous canceling is enabled.
9420         * pthread_join.c (pthread_join): When recognizing circular joins,
9421         take into account the other thread might be already canceled.
9422         * Makefile (tests): Add tst-join5.
9423         * tst-join5.c: New file.
9424
9425         * Makefile (tests): Add tst-join4.
9426         * tst-join4.c: New file.
9427
9428 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9429
9430         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9431
9432 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9433
9434         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9435         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9436         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9437         warning.
9438         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9439         to avoid warning.
9440         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9441         error if lll_futex_wake failed.
9442
9443 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9444
9445         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9446         handling of cancellation and failung pthread_mutex_unlock call.
9447         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9448         * Makefile (tests): Add tst-cond8 and tst-cond9.
9449         * tst-cond8.c: New file.
9450         * tst-cond9.c: New file.
9451
9452         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9453
9454         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9455         non-standard initializers with __USE_GNU.
9456
9457         * Makefile (tests): Add tst-cleanup3.
9458         * tst-cleanup3.c: New file.
9459
9460 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9461
9462         * Makefile (tests): Add tst-attr1 and tst-attr2.
9463         * tst-attr1.c: New file.
9464         * tst-attr2.c: New file.
9465
9466         * Makefile: Add rules to build and run tst-atfork2 test.
9467         * tst-atfork2.c: New file.
9468         * tst-atfork2mod.c: New file.
9469
9470         * sysdeps/unix/sysv/linux/unregister-atfork.c
9471         (__unregister_atfork): Free the memory allocated for the handlers
9472         after removing them from the lists.
9473
9474         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9475         cleanup function.
9476
9477         * tst-atfork1.c (do_test): Wait for the child we forked.
9478         Report error in child.
9479
9480         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9481
9482         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9483
9484 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9485
9486         * Makefile (tests): Add tst-cancel8.
9487         * tst-cancel8.c: New file.
9488
9489         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9490         clearing of control variable.
9491         * Makefile (tests): Add tst-once3 and tst-once4.
9492         * tst-once3.c: New file.
9493         * tst-once4.c: New file.
9494
9495 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9496
9497         * sysdeps/sh/Makefile: New file.
9498         * sysdeps/sh/bits/atomic.h: New file.
9499         * sysdeps/sh/pthread_spin_init.c: New file.
9500         * sysdeps/sh/pthread_spin_lock.c: New file.
9501         * sysdeps/sh/pthread_spin_trylock.S: New file.
9502         * sysdeps/sh/pthread_spin_unlock.S: New file.
9503         * sysdeps/sh/pthreaddef.h: New file.
9504         * sysdeps/sh/tcb-offsets.sym: New file.
9505         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9506         * sysdeps/sh/tls.h: New file.
9507         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9508         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9509         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9510         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9511         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9512         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9513         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9514         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9515         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9516         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9517         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9518         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9519         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9520         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9521         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9522         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9523         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9524         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9525         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9526         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9527         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9528         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9529         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9530         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9531         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9532         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9533         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9534         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9535         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9536         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9537
9538 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9539
9540         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9541         according to POSIX.
9542
9543         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9544
9545 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9546
9547         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9548         (TLS_GET_FS): New #define.
9549         (TLS_SET_FS): New #define.
9550         Correct value of __NR_set_thread_area.
9551
9552         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9553
9554 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9555
9556         * Makefile (tests): Add tst-popen1.
9557         * tst-popen1.c: New file.
9558
9559         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9560         but inactive generalization.
9561         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9563         Minor optimization, remove one instruction.
9564         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9565
9566 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9567
9568         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9569
9570 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9571
9572         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9573         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9574         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9575         * sysdeps/pthread/pthread_cond_signal.c: New file.
9576         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9577         * sysdeps/pthread/pthread_cond_wait.c: New file.
9578         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9579         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9580         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9581         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9582         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9583         * sysdeps/s390/Makefile: New file.
9584         * sysdeps/s390/bits/atomic.h: New file.
9585         * sysdeps/s390/pthread_spin_init.c: New file.
9586         * sysdeps/s390/pthread_spin_lock.c: New file.
9587         * sysdeps/s390/pthread_spin_trylock.c: New file.
9588         * sysdeps/s390/pthread_spin_unlock.c: New file.
9589         * sysdeps/s390/pthreaddef.h: New file.
9590         * sysdeps/s390/tcb-offsets.sym: New file.
9591         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9592         * sysdeps/s390/tls.h: New file.
9593         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9594         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9595         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9596         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9597         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9598         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9599         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9600         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9601         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9602         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9603         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9604         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9605         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9606         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9607         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9608         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9609         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9610         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9611         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9612         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9613         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9614         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9615         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9616
9617 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9618
9619         * atomic.h: Add a couple more default implementations.
9620         (atomic_compare_and_exchange_acq): Use
9621         __arch_compare_and_exchange_32_acq in return value definition.  It
9622         always exists.
9623         (atomic_bit_set): Renamed from atomic_set_bit.
9624         Add missing atomic_ prefixes.
9625
9626         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9627         thread library is available, use correct value to mark initialized
9628         once variable.
9629
9630 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9631
9632         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9633         __sysconf to determine pagesize.
9634
9635         * pthread_create.c: Include <atomic.h>.
9636         * allocatestack.c (allocate_stack): Implement coloring of the
9637         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9638         size minus one.  Adjust users.
9639         * sysdeps/i386/i686/Makefile: New file.
9640
9641 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9642
9643         * allocatestack.c: Improve comment throughout the file.
9644
9645         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9646         (__lll_lock_wait): Add branch prediction.
9647         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9648         (__lll_lock_wait): Likewise.
9649         (lll_unlock_wake_cb): Removed.
9650
9651 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9652
9653         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9654         _POSIX_THREAD_PRIORITY_SCHEDULING.
9655
9656 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9657
9658         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9659         Fix return type of ptr___pthread_getspecific.
9660
9661 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9662
9663         * Makefile (tests): Add tst-umask1.
9664         (tst-umask1-ARGS): Define.
9665         * tst-umask1.c: New file.
9666
9667 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9668
9669         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9670         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9671         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9672         pthread_rwlock_unlock.
9673         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9674         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9675         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9676         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9677         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9678         New file.
9679         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9680         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9681         New file.
9682         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9683         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9684         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9685         New file.
9686         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9687         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9688         New file.
9689         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9690         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9691         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9692         New file.
9693         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9694         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9695         New file.
9696         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9697
9698         * Makefile (libpthread-routines): Remove lowlevelcond and
9699         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9700         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9701         and pthread_cond_broadcast.
9702         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9703         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9704         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9705         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9706         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9707         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9708         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9709         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9710         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9711         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9712         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9713         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9714         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9715         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9716         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9717         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9718         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9719         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9720         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9721         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9722         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9723         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9724         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9725         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9726         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9727         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9728         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9729         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9730         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9731         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9732         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9733
9734         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9735         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9736         of the code is moved to ...
9737         * sysdeps/pthread/createthread.c: ...here.  New file.
9738
9739 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9740
9741         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9742         (__new_sem_post): Clear %eax before returning.
9743         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9744
9745         * Makefile (tests): Add tst-cleanup2.
9746         * tst-cleanup2.c: New file.
9747
9748         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9749         Interpret first parameter correctly.
9750
9751 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9752
9753         * Makefile (headers): Add bits/semaphore.h.
9754
9755 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9756
9757         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9758         if not SHARED.
9759
9760 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9761
9762         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9763         must be used and mapping failed.
9764         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9765
9766         * Makefile (CFLAGS-pthread_self.os): Define this, not
9767         CFLAGS-pthread_self.c.
9768
9769 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9770
9771         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9772         lll_unlock_wake_cb.
9773
9774         * Makefile (libpthread-routines): Add version.  Add rules to build
9775         version.os and banner.h.
9776         * version.c: New file.
9777
9778 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9779
9780         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9781         the alias unconditional.
9782         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9783
9784 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9785
9786         * Makefile (CFLAGS-pthread_self.c): New definition.
9787
9788 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9789
9790         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9791         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9792         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9793         * init.c (__pthread_initialize_minimal_internal): Likewise.
9794
9795 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9796
9797         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9798
9799         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9800         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9801         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9802         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9803         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9804         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9805
9806 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9807
9808         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9809         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9810         * tst-cancel-wrappers.sh: Remove all exceptions.
9811
9812 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9813
9814         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9815         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9816
9817         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9818         Use __libc_pthread_functions array if SHARED.
9819
9820         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9821         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9822
9823         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9824         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9825         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9826         __libc_ptf_call instead of __libc_maybe_call.
9827         (PTF): New #define.
9828         (__libc_cleanup_region_start): Wrap function name with PTF call.
9829         (__libc_cleanup_region_end): Likewise.
9830         (__libc_cleanup_end): Likewise.
9831
9832         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9833         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9834         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9835         * pthreadP.h: Add prototypes.
9836
9837         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9838         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9839         __pthread_rwlock_unlock aliases.
9840         * pthreadP.h: Add prototypes for new aliases.
9841
9842         * pthreadP.h (struct pthead_functions): Moved to...
9843         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9844         * init.c (pthread_functions): Add initializers for new elements.
9845
9846         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9847         __pthread_cleanup_pop_restore aliases.
9848         * pthreadP.h: Add prototypes.
9849
9850         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9851         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9852         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9853         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9854         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9855         * pthreadP.h: Adjust prototypes and callers.
9856
9857 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9858
9859         * Makefile (tests): Add tst-cancel7.
9860         (tst-cancel7-ARGS): New variable.
9861         * tst-cancel7.c: New file.
9862
9863         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9864         around gcc defficiencies.
9865         * old_pthread_cond_signal.c: Likewise.
9866         * old_pthread_cond_timedwait.c: Likewise.
9867         * old_pthread_cond_wait.c: Likewise.
9868
9869         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9870
9871 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9872
9873         * Makefile (tests): Add tst-cond7.
9874         * tst-cond7.c: New file.
9875
9876         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9877         (condvar_cleanup): Get condvar address from the right place.
9878
9879         * atomic.h: Correct definitions of atomic_full_barrier,
9880         atomic_read_barrier, atomic_write_barrier.
9881
9882         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9883         race-free.
9884         * old_pthread_cond_signal.c: Likewise.
9885         * old_pthread_cond_timedwait.c: Likewise.
9886         * old_pthread_cond_wait.c: Likewise.
9887
9888 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9889
9890         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9891
9892 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9893
9894         * pthreadP.h (pthread_cond_2_0_t): New type.
9895         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9896         Use new type for the 2.0 condvar function prototypes.
9897         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9898         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9899         parameter.
9900         * old_pthread_cond_destroy.c: Likewise.
9901         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9902         * old_pthread_cond_signal.c: Likewise.
9903         * old_pthread_cond_timedwait.c: Likewise.
9904         * old_pthread_cond_wait.c: Likewise.
9905
9906         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9907         (__pthread_cond_wait): Don't save cancellation mode and seq value
9908         in same location.
9909
9910         * herrno.c (__h_errno_location): Don't define as weak.
9911
9912 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9913
9914         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9915         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9916         and pthread_cond_wait.
9917         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9918         Renamed to...
9919         (__pthread_cond_broadcast_2_0): ... this.
9920         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9921         Renamed to...
9922         (__pthread_cond_destroy_2_0): ... this.
9923         * old_pthread_cond_init.c (__old_pthread_cond_init):
9924         Renamed to...
9925         (__pthread_cond_init_2_0): ... this.
9926         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9927         Renamed to...
9928         (__pthread_cond_signal_2_0): ... this.
9929         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9930         Renamed to...
9931         (__pthread_cond_wait_2_0): ... this.
9932         * pthread_cond_destroy.c: Include shlib-compat.h.
9933         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9934         * pthread_cond_init.c: Include shlib-compat.h.
9935         (pthread_cond_init): Change strong_alias into versioned_symbol.
9936         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9937         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9938         fields.
9939         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9940         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9941         __pthread_cond_wait_2_0): New prototypes.
9942         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9943         __old_pthread_cond_init, __old_pthread_cond_signal,
9944         __old_pthread_cond_wait): Removed.
9945         * init.c: Include shlib-compat.h.
9946         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9947         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9948         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9949         ptr___pthread_cond_*_2_0 fields.
9950         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9951         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9952
9953         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9954         LIBC_SIGACTION was not yet defined.
9955         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9956         [!defined LIBC_SIGACTION] (__sigaction): New function and
9957         libc_hidden_weak.
9958         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9959         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9960
9961 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9962
9963         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9964
9965 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9966
9967         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9968         New, larger type definition.
9969         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9970         implementation.
9971         * Versions [libpthread]: Add definitions for new pthread_cond_*
9972         interfaces for version GLIBC_2.3.2.
9973         * pthread_cond_init.c: Update initialization for new type definition.
9974         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9975         pthread_cond_timedwait, pthread_cond_signal, and
9976         pthread_cond_broadcast.  Add old_pthread_cond_init,
9977         old_pthread_cond_destroy, old_pthread_cond_wait,
9978         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9979         old_pthread_cond_broadcast.
9980         * old_pthread_cond_broadcast.c: New file.
9981         * old_pthread_cond_destroy.c: New file.
9982         * old_pthread_cond_init.c: New file.
9983         * old_pthread_cond_signal.c: New file.
9984         * old_pthread_cond_timedwait.c: New file.
9985         * old_pthread_cond_wait.c: New file.
9986         * pthreadP.h: Add prototypes for the compatibility interfaces.
9987
9988         * pthread_cond_destroy.c: Don't include <errno.h>.
9989
9990 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9991
9992         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9993         unnecessary zero offset when addressing MUTEX.
9994
9995 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9996
9997         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9998         __register_atfork.
9999         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
10000         for __register_atfork.
10001
10002 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10003
10004         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
10005         instead of ASSEMBLER test macro.
10006
10007         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
10008         __libc_current_sigrtmax): Add libc_hidden_def.
10009
10010         * sysdeps/pthread/list.h: Remove assert.h include.
10011
10012 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10013
10014         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
10015         __pthread_initialize_minimal_internal not
10016         __pthread_initialize_minimal.
10017
10018 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
10019
10020         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
10021         __pthread_initialize_minimal as hidden.
10022
10023         * init.c (__pthread_initialize_minimal_internal): Don't mark as
10024         constructor.
10025
10026 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10027
10028         * Makefile ($(inst_libdir)/libpthread.so): Depend on
10029         $(common-objpfx)format.lds, include that into the output script.
10030         Fix comment.
10031         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
10032
10033 2002-12-28  Andreas Jaeger  <aj@suse.de>
10034
10035         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
10036         nsec resolution changes.
10037         (xstat64_conv): Likewise.
10038         (xstat32_conv): Likewise.
10039         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
10040         struct kernel_stat.
10041         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
10042         structs stat and stat64.
10043         * time/time.h (__timespec_defined): Define for __USE_MISC.
10044         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
10045
10046 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
10047
10048         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
10049         argument.
10050         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
10051         (pthread_exit): Use strong_alias to avoid warnings.
10052         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
10053         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
10054         ptr___pthread_attr_init_2_*.
10055         * init.c (pthread_functions): Adjust.
10056
10057 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
10058
10059         * forward.c: Make all functions available by default again.  It
10060         caused too much trouble.
10061
10062         * pt-siglongjmp.c: Removed.
10063
10064 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
10065
10066         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
10067         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
10068         * sysdeps/i386/Makefile: New file.
10069         * sysdeps/i386/tcb-offsets.sym: New file.
10070         * sysdeps/pthread/tcb-offsets.h: New file.
10071         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10072         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
10073
10074         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
10075         __register_atfork...
10076         (GLIBC_2.3.2): ...here.
10077
10078 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10079
10080         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10081         pthread_attr_setstackaddr with __attribute_deprecated__.
10082
10083 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10084
10085         * pt-system.c (system): Remove cancellation handling.
10086         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10087         cancellation routines.
10088
10089 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10090
10091         * descr.h: Include <dl-sysdep.h>.
10092         (struct pthread): Move header.data.list to the back of the struct.
10093         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10094         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10095         (SYSINFO_OFFSEET): Likewise.
10096
10097 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10098
10099         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10100         Define.
10101         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10102         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10103         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10104         (USE_DL_SYSINFO): Undef.
10105
10106 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10107
10108         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10109         $(common-objpfx)libc.so.
10110         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10111         it is bigger than pipe buffer size even on arches with bigger
10112         page size.
10113         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10114
10115 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10116
10117         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10118         correct errno access for case that USE___THREAD is not defined.
10119
10120 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10121
10122         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10123         Patch by Marijn Ros <marijn@mad.scientist.com>.
10124
10125 2002-12-22  Roland McGrath  <roland@redhat.com>
10126
10127         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10128
10129 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10130
10131         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10132
10133 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10134
10135         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10136         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10137         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10138
10139         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10140         of int $0x80.
10141         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10142         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10143         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10144         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10145         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10146         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10147         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10148         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10149
10150         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10151         sysenter.
10152         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10153
10154         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10155
10156         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10157         in new TCB.
10158         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10159         that sysinfo is properly initialized.
10160         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10161         to 1 only for ld.so.
10162
10163         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10164         RTLD_CORRECT_DYNAMIC_WEAK.
10165
10166 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10167
10168         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10169         Use return 0 as 6th argument to FORWARD4.
10170         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10171
10172 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10173
10174         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10175         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10176         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10177         (INIT_SYSINFO): New #define.
10178         (TLS_TP_INIT): Use INIT_SYSINFO.
10179         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10180         At test to make sure SYSINFO_OFFSET value is correct.
10181         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10182
10183 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10184
10185         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10186         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10187         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10188         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10189         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10190         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10191         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10192
10193 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10194
10195         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10196         macro instead of using int $0x80 directly.
10197
10198         * sysdeps/pthread/bits/stdio-lock.h: New file.
10199         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10200         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10201         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10202         * Makefile (routines): Add libc-lowlevelmutex.
10203
10204         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10205         __i686.get_pc_thunk.dx.
10206
10207 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10208
10209         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10210         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10211         ($(objpfx)tst-cancel-wrappers.out): New rule.
10212         * tst-cancel-wrappers.sh: New test.
10213         * tst-locale1.c: Include signal.h.
10214         (uselocale): Test static linking of __libc_current_sigrt*.
10215
10216 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10217
10218         * Makefile (tests): Add tst-cancel6.
10219         * tst-cancel6.c: New file
10220
10221 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10222
10223         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10224         Define meaningfully for assembler as well.
10225         * pthreadP.h (struct pthread_functions): Remove
10226         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10227         and ptr_pthread_attr_init_2_1 fields.
10228         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10229         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10230         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10231         (FORWARD3): Define using FORWARD4.
10232         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10233         versions.
10234         * pt-system.c: Remove duplicate stdlib.h include.
10235
10236 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10237
10238         * sem_init.c: Define sem_init@GLIBC_2.0.
10239         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10240         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10241
10242         * flockfile.c: Moved to...
10243         * sysdeps/pthread/flockfile.c: ...here.  New file.
10244         * funlockfile.c: Moved to...
10245         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10246         * ftrylockfile.c: Moved to...
10247         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10248
10249 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10250
10251         * libc-cancellation.c: Guard both function with
10252         #if !defined NOT_IN_libc.
10253         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10254         automatically provided pthread wrappers.
10255         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10256         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10257         nor in libpthread.
10258         * pt-open.c: Removed.
10259         * pt-fcntl.c: Removed.
10260         * pt-fsync.c: Removed.
10261         * pt-lseek.c: Removed.
10262         * pt-msgrcv.c: Removed.
10263         * pt-msgsnd.c: Removed.
10264         * pt-msync.c: Removed.
10265         * pt-nanosleep.c: Removed.
10266         * pt-open64.c: Removed.
10267         * pt-pause.c: Removed.
10268         * pt-pread.c: Removed.
10269         * pt-pread64.c: Removed.
10270         * pt-pwrite.c: Removed.
10271         * pt-pwrite64.c: Removed.
10272         * pt-read.c: Removed.
10273         * pt-recv.c: Removed.
10274         * pt-recvfrom.c: Removed.
10275         * pt-recvmsg.c: Removed.
10276         * pt-send.c: Removed.
10277         * pt-sendto.c: Removed.
10278         * pt-sigtimedwait.c: Removed.
10279         * pt-sigwait.c: Removed.
10280         * pt-wait.c: Removed.
10281         * pt-waitpid.c: Removed.
10282         * pt-write.c: Removed.
10283         * pt-accept.c: Removed.
10284         * pt-close.c: Removed.
10285         * pt-connect.c: Removed.
10286         * pt-lseek64.c: Removed.
10287         * pt-sendmsg.c: Removed.
10288         * pt-tcdrain.c: Removed.
10289
10290 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10291
10292         * init.c (__pthread_initialize_minimal_internal): Renamed from
10293         __pthread_initialize_minimal.  Make old name an alias.  This
10294         converts a normal relocation into a relative relocation.
10295
10296         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10297
10298         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10299         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10300         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10301         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10302         pt-sigwaitinfo, pt-waitid, and pt-writev.
10303         * pt-creat.c: Removed.
10304         * pt-poll.c: Removed.
10305         * pt-pselect.c: Removed.
10306         * pt-readv.c: Removed.
10307         * pt-select.c: Removed.
10308         * pt-sigpause.c: Removed.
10309         * pt-sigsuspend.c: Removed.
10310         * pt-sigwaitinfo.c: Removed.
10311         * pt-waitid.c: Removed.
10312         * pt-writev.c: Removed.
10313
10314         * init.c (pthread_functions): New variable.
10315         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10316         (or NULL) to __libc_pthread_init.
10317         * forward.c: Rewrite to use __libc:pthread_functions array to get
10318         function addresses.
10319         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10320         prototype.
10321         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10322         Take new parameter.  Copy content of variable pointed to by it
10323         to __libc_pthread_init.
10324
10325         * pthreadP.h (struct pthread_functions): New type.
10326         (__libc_pthread_init): Declare.
10327
10328         * pthread_attr_destroy.c: Add namespace protected alias.
10329         * pthread_attr_getdetachstate.c: Likewise.
10330         * pthread_attr_getinheritsched.c: Likewise.
10331         * pthread_attr_getschedparam.c: Likewise.
10332         * pthread_attr_getschedpolicy.c: Likewise.
10333         * pthread_attr_getscope.c: Likewise.
10334         * pthread_attr_setdetachstate.c: Likewise.
10335         * pthread_attr_setinheritsched.c: Likewise.
10336         * pthread_attr_setschedparam.c: Likewise.
10337         * pthread_attr_setschedpolicy.c: Likewise.
10338         * pthread_attr_setscope.c: Likewise.
10339         * pthread_cond_broadcast.c: Likewise.
10340         * pthread_cond_destroy.c: Likewise.
10341         * pthread_cond_init.c: Likewise.
10342         * pthread_cond_signal.c: Likewise.
10343         * pthread_cond_wait.c: Likewise.
10344         * pthread_condattr_destroy.c: Likewise.
10345         * pthread_condattr_init.c: Likewise.
10346         * pthread_equal.c: Likewise.
10347         * pthread_exit.c: Likewise.
10348         * pthread_getschedparam.c: Likewise.
10349         * pthread_self.c: Likewise.
10350         * pthread_setcancelstate.c: Likewise.
10351         * pthread_setschedparam.c: Likewise.
10352         * pthread_mutex_destroy.c: Likewise.
10353         * pthread_mutex_init.c: Likewise.
10354         * pthreadP.h: Add prototypes for the aliases.
10355
10356         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10357         multiple_threads member in correct TCB to 1.
10358
10359         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10360         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10361         member of thread decriptor, otherwise return unconditionally 1.
10362
10363 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10364
10365         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10366         regular Linux version.  Remove file.
10367         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10368         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10369         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10370         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10371         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10372         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10373         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10374         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10375         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10376         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10377         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10378         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10379         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10380         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10381         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10382         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10383         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10384         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10385         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10386         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10387         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10388         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10389         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10390         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10391         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10392         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10393         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10394         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10395         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10396         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10397
10398 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10399
10400         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10401         * sysdeps/unix/sysv/linux/open.c: Removed.
10402         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10403         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10404         * sysdeps/unix/sysv/linux/msync.c: Removed.
10405         * sysdeps/unix/sysv/linux/read.c: Removed.
10406         * sysdeps/unix/sysv/linux/close.c: Removed.
10407         * sysdeps/unix/sysv/linux/creat.c: Removed.
10408         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10409         * sysdeps/unix/sysv/linux/pause.c: Removed.
10410         * sysdeps/unix/sysv/linux/select.c: Removed.
10411         * sysdeps/unix/sysv/linux/write.c: Removed.
10412
10413 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10414
10415         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10416         element in TCB to see whether locking is needed.
10417
10418         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10419         MULTIPLE_THREADS_OFFSET value is correct.
10420
10421         * sysdeps/unix/sysv/linux/close.c: New file.
10422         * sysdeps/unix/sysv/linux/connect.S: New file.
10423         * sysdeps/unix/sysv/linux/creat.c: New file.
10424         * sysdeps/unix/sysv/linux/fsync.c: New file.
10425         * sysdeps/unix/sysv/linux/llseek.c: New file.
10426         * sysdeps/unix/sysv/linux/lseek.c: New file.
10427         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10428         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10429         * sysdeps/unix/sysv/linux/msync.c: New file.
10430         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10431         * sysdeps/unix/sysv/linux/open.c: New file.
10432         * sysdeps/unix/sysv/linux/open64.c: New file.
10433         * sysdeps/unix/sysv/linux/pause.c: New file.
10434         * sysdeps/unix/sysv/linux/poll.c: New file.
10435         * sysdeps/unix/sysv/linux/pread.c: New file.
10436         * sysdeps/unix/sysv/linux/pread64.c: New file.
10437         * sysdeps/unix/sysv/linux/pselect.c: New file.
10438         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10439         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10440         * sysdeps/unix/sysv/linux/readv.c: New file.
10441         * sysdeps/unix/sysv/linux/recv.S: New file.
10442         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10443         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10444         * sysdeps/unix/sysv/linux/select.c: New file.
10445         * sysdeps/unix/sysv/linux/send.S: New file.
10446         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10447         * sysdeps/unix/sysv/linux/sendto.S: New file.
10448         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10449         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10450         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10451         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10452         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10453         * sysdeps/unix/sysv/linux/system.c: New file.
10454         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10455         * sysdeps/unix/sysv/linux/wait.c: New file.
10456         * sysdeps/unix/sysv/linux/waitid.c: New file.
10457         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10458         * sysdeps/unix/sysv/linux/writev.c: New file.
10459         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10460
10461         * pt-readv.c: Fix comment.
10462
10463 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10464
10465         * tst-cleanup1.c: Include stdlib.h.
10466
10467         * tst-cancel5.c: New test.
10468         * Makefile (tests): Add tst-cancel5.
10469         (tst-cancel5): Link against libc.so libpthread.so in that order.
10470
10471 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10472
10473         * forward.c (test_loaded): Prevent recursive calls.
10474
10475         * Makefile (routines): Add libc-cancellation.
10476         * libc-cancellation.c: New file.
10477         * descr.h (struct pthread): Add multiple_threads field.
10478         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10479         new thread descriptor to 1.
10480         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10481         Initialize multiple_thread field after successful thread creation.
10482         * cancellation.c (__do_cancel): Move to pthreadP.h.
10483         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10484         (__pthread_disable_asynccancel): Add internal_function attribute.
10485         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10486         * pthread_setcancelstate.c: Likewise.
10487         * pthread_setcanceltype.c: Likewise.
10488         * pthread_exit.c: Likewise.
10489         * pthreadP.h (CANCELLATION_P): Likewise.
10490         (__do_cancel): Define as static inline.
10491         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10492         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10493         declarations.
10494         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10495         fields.  Define MULTIPLE_THREADS_OFFSET.
10496         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10497         declaration.
10498         * sysdeps/unix/sysv/linux/accept.S: New file.
10499         * sysdeps/unix/sysv/linux/read.c: New file.
10500         * sysdeps/unix/sysv/linux/write.c: New file.
10501         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10502         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10503         initialization of __libc_locking_needed.
10504         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10505         __libc_locking_needed, use multiple_threads field in TCB.
10506         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10507
10508 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10509
10510         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10511         version.
10512         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10513
10514         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10515         access to __libc_locking_needed for PIC.
10516
10517 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10518
10519         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10520         declare for libc.so.
10521         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10522         expression.
10523         (__libc_lock_lock): Put into statement expression.
10524         (__libc_lock_unlock): Remove trailing semicolon.
10525         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10526
10527 2002-12-12  Roland McGrath  <roland@redhat.com>
10528
10529         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10530         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10531
10532 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10533
10534         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10535         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10536         Initialize __libc_locking_needed.
10537         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10538         instead of __register_pthread_fork_handler.
10539         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10540         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10541         fork-gen with libc_pthread_init.
10542         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10543         of __register_pthread_fork_handler.
10544         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10545         of __register_pthread_fork_handler.
10546         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10547         __libc_locking_needed to determine whether lock prefix can be avoided.
10548         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10549
10550 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10551
10552         * Makefile (tests): Add tst-cleanup1.
10553         * tst-cleanup1.c: New file.
10554         * cancellation.c (__cleanup_thread): Removed.
10555         (__do_cancel): Remove call to __cleanup_thread.
10556         * pthreadP.h: Remove __cleanup_thread prorotype.
10557
10558         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10559         Remember function and argument even if cancellation handler
10560         function is not available.
10561         (__libc_cleanup_region_end): Execute registered function directly if
10562         pthread functions are not available.
10563         (__libc_cleanup_end): Likewise.
10564
10565         * init.c (__pthread_initialize_minimal): Fix initialization in
10566         static lib by preventing gcc from being too clever.
10567
10568 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10569
10570         * init.c (__pthread_initialize_minimal): Remove unneccesary
10571         sigaddset call.
10572
10573         * Makefile (tests): We can run tst-locale2 now.
10574
10575 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10576
10577         * Versions: Remove duplicated sigwait entry.
10578
10579 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10580
10581         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10582         inside libpthread.
10583
10584         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10585
10586         * pthreadP.h: Declare __pthread_enable_asynccancel and
10587         __pthread_disable_asynccancel.
10588         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10589         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10590         * cancellation.c (__pthread_enable_asynccancel): New function.
10591         (__pthread_disable_asynccancel): New function.
10592         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10593         * pt-close.c: Likewise.
10594         * pt-connect.c: Likewise.
10595         * pt-creat.c: Likewise.
10596         * pt-fcntl.c: Likewise.
10597         * pt-fsync.c: Likewise.
10598         * pt-lseek.c: Likewise.
10599         * pt-lseek64.c: Likewise.
10600         * pt-msgrcv.c: Likewise.
10601         * pt-msgsnd.c: Likewise.
10602         * pt-msync.c: Likewise.
10603         * pt-nanosleep.c: Likewise.
10604         * pt-open.c: Likewise.
10605         * pt-open64.c: Likewise.
10606         * pt-pause.c: Likewise.
10607         * pt-poll.c: Likewise.
10608         * pt-pread.c: Likewise.
10609         * pt-pread64.c: Likewise.
10610         * pt-pselect.c: Likewise.
10611         * pt-pwrite.c: Likewise.
10612         * pt-pwrite64.c: Likewise.
10613         * pt-read.c: Likewise.
10614         * pt-readv.c: Likewise.
10615         * pt-recv.c: Likewise.
10616         * pt-recvfrom.c: Likewise.
10617         * pt-recvmsg.c: Likewise.
10618         * pt-select.c: Likewise.
10619         * pt-send.c: Likewise.
10620         * pt-sendmsg.c: Likewise.
10621         * pt-sendto.c: Likewise.
10622         * pt-sigpause.c: Likewise.
10623         * pt-sigsuspend.c: Likewise.
10624         * pt-sigtimedwait.c: Likewise.
10625         * pt-sigwait.c: Likewise.
10626         * pt-sigwaitinfo.c: Likewise.
10627         * pt-system.c: Likewise.
10628         * pt-tcdrain.c: Likewise.
10629         * pt-wait.c: Likewise.
10630         * pt-waitid.c: Likewise.
10631         * pt-waitpid.c: Likewise.
10632         * pt-write.c: Likewise.
10633         * pt-writev.c: Likewise.
10634         * pthread_join.c: Likewise.
10635         * pthread_timedjoin.c: Likewise.
10636
10637         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10638         (__xpg_sigpause): New function.
10639         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10640
10641 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10642
10643         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10644
10645         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10646         _GI_pthread_cleanup_pop to pthreadP.h.
10647
10648         * ftrylockfile.c: Use _IO_lock_trylock instead of
10649         pthread_mutex_trylock.
10650
10651         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10652         (CANCEL_RESET): Likewise.
10653         (__pthread_setcanceltype_): Declare.
10654         (__pthread_mutex_lock_internal): Declare.
10655         (__pthread_mutex_unlock_internal): Declare.
10656         (__pthread_once_internal): Declare.
10657         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10658         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10659
10660         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10661         and pthread_mutex_unlock.
10662         * pthread_cond_wait.c: Likewise.
10663         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10664         * pthread_mutex_unlock.c: Likewise.
10665
10666         * pthread_setcanceltype.c: Add additional alias
10667         __pthread_setcanceltype.
10668
10669         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10670         * sem_open.c (sem_open): Likewise.
10671         Use __libc_open, __libc_write, and __libc_close instead of
10672         open, write, and close respectively.
10673
10674         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10675         Rewrite as statement expression since it must return a value.
10676
10677         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10678         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10679         __pthread_kill.
10680
10681         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10682         alias __pthread_once_internal.
10683
10684         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10685
10686 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10687
10688         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10689         * tst-stdio1.c: New file.
10690         * tst-stdio2.c: New file.
10691
10692         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10693
10694         * Makefile (tests): Comment out tst-locale2 for now.
10695         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10696
10697         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10698         -D_IO_MTSAFE_IO.
10699         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10700         Use _IO_lock_init instead of explicit assignment.
10701
10702         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10703         Define __libc_lock_* and __libc_lock_recursive macros with
10704         lowlevellock macros, not pthread mutexes.
10705
10706         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10707         of pthread_mutex_lock.
10708         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10709         instead of pthread_mutex_unlock.
10710
10711 2002-12-06  Roland McGrath  <roland@redhat.com>
10712
10713         * allocatestack.c (__stack_user): Use uninitialized defn.
10714         * init.c (__pthread_initialize_minimal): Initialize it here.
10715
10716 2002-12-05  Roland McGrath  <roland@redhat.com>
10717
10718         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10719         string.
10720         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10721
10722         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10723         missing & here too.
10724
10725 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10726
10727         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10728         lowlevellock.
10729         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10730         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10731         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10732         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10733         for __libc_lock_* macros.
10734         * Makefile (routines): Add libc-lowlevellock.
10735
10736 2002-10-09  Roland McGrath  <roland@redhat.com>
10737
10738         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10739         Under [__PIC__], call the function via the pointer fetched for
10740         comparison rather than a call by name that uses the PLT.
10741         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10742         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10743         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10744         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10745         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10746
10747 2002-12-04  Roland McGrath  <roland@redhat.com>
10748
10749         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10750
10751         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10752         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10753
10754         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10755
10756 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10757
10758         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10759         a completely opaque, non-integer type.
10760         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10761
10762 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10763
10764         * sysdeps/i386/tls.h: Include stdlib.h.
10765         * sysdeps/x86_64/tls.h: Likewise.
10766
10767 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10768
10769         * Makefile (tests): Add tst-locale2.
10770         (tests-static): Likewise.
10771         * tst-locale2.c: New file.
10772
10773         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10774         volatile and add memory clobbers to lock operations.
10775
10776 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10777
10778         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10779         * sysdeps/i386/i486/bits/atomic.h: New file.
10780         * sysdeps/i386/i586/bits/atomic.h: New file.
10781         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10782         include i486 version.
10783         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10784         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10785         Patch by Marijn Ros <marijn@mad.scientist.com>.
10786
10787         * allocatestack.c (get_cached_stack): Don't crash if we first
10788         found a stack with a larger size then needed.
10789         Reported by Hui Huang <hui.huang@sun.com>.
10790
10791         * Makefile (tests): Add tst-sysconf.
10792         * tst-sysconf.c: New file.
10793
10794         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10795         PTHREAD_THREADS_MAX.
10796
10797 2002-12-02  Roland McGrath  <roland@redhat.com>
10798
10799         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10800         Declare using hidden_proto instead of attribute_hidden, so there are
10801         non-.hidden static symbols for gdb to find.
10802         (__pthread_keys): Likewise.
10803         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10804         * allocatestack.c (__stack_user): Likewise.
10805         * pthread_create.c (__pthread_keys): Likewise.
10806         (__nptl_threads_events, __nptl_last_event): Make these static instead
10807         of hidden.
10808         * pthread_key_create.c (__pthread_pthread_keys_max,
10809         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10810
10811 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10812
10813         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10814         statically.
10815         * tst-locale1.c: New file.
10816
10817         * pthread_cond_timedwait.c: Include <stdlib.h>.
10818
10819         * Makefile (tests): Add tst-fork2 and tst-fork3.
10820         * tst-fork2.c: New file.
10821         * tst-fork3.c: New file.
10822
10823 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10824
10825         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10826
10827         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10828         require it to 200112L.
10829
10830         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10831         instruction only if HAVE_CMOV is defined.
10832         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10833
10834         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10835
10836         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10837
10838         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10839
10840         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10841
10842 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10843
10844         * sysdeps/x86_64/bits/atomic.h: New file.
10845
10846         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10847         16-bit operations.
10848
10849         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10850         possible since gettid cannot fail.
10851
10852         * sysdeps/x86_64/pthreaddef.h: New file.
10853
10854         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10855
10856         * sysdeps/x86_64/pthread_spin_init.c: New file.
10857         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10858         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10859         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10860
10861         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10862         Add missing lock prefix.  Minute optimization.
10863
10864         * tst-spin2.c (main): Also check successful trylock call.
10865
10866         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10867         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10868
10869         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10870         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10871
10872         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10873         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10874         value in case of an error.  Add support for INTERNAL_SYSCALL.
10875
10876         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10877         value in case of an error.
10878
10879         * sysdeps/x86_64/tls.h: New file.
10880
10881 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10882
10883         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10884         takes the array member name and the index as parameters.
10885         (THREAD_SETMEM_NC): Likewise.
10886         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10887         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10888         interfaces.
10889
10890         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10891         to decide which code to use.
10892         (THREAD_SETMEM_NC): Likewise.
10893
10894         * allocatestack.c (queue_stack): Don't remove stack from list here.
10895         Do it in the caller.  Correct condition to prematurely terminate
10896         loop to free stacks.
10897         (__deallocate_stack): Remove stack from list here.
10898
10899 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10900
10901         * Makefile (tests): Add tst-stack1.
10902         * tst-stack1.c: New file.
10903
10904         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10905         provided stack.
10906
10907         * pthread_attr_getstack.c: Return bottom of the thread area.
10908
10909 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10910
10911         * Makefile (libpthread-routines): Add pt-allocrtsig and
10912         pthread_kill_other_threads.
10913         * pt-allocrtsig.c: New file.
10914         * pthread_kill_other_threads.c: New file.
10915         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10916         all three functions.
10917         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10918         allocrtsig.
10919         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10920         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10921         and __libc_allocate_rtsig_private.
10922         * Versions (libpthread): Export pthread_kill_other_threads_np,
10923         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10924
10925 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10926
10927         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10928         the end of the stack.  Adjust computations.
10929         When mprotect call fails dequeue stack and free it.
10930         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10931         attribute.
10932         * pthread_getattr_np.c: Likewise.
10933
10934         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10935         surprises.
10936
10937 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10938
10939         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10940         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10941
10942 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10943
10944         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10945         * pthread_setspecific.c: Likewise.
10946
10947 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10948
10949         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10950         definitions.  Get them from the official place.
10951         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10952
10953         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10954         Use new CLONE_ flags in clone() calls.
10955
10956         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10957         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10958
10959         * Versions: Add pthread_* functions for libc.
10960         * forward.c: New file.
10961
10962         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10963         errno-loc.
10964         * herrno.c: New file.
10965         * res.c: New file.
10966
10967         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10968         sem_trywait, and sem_timedwait.  Add herrno and res.
10969         * sem_init.c: Don't initialize lock and waiters members.
10970         * sem_open.c: Likewise.
10971         * sem_post.c: Removed.
10972         * sem_wait.c: Removed.
10973         * sem_trywait.c: Removed.
10974         * sem_timedwait.c: Removed.
10975         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10976         Includes full implementations of sem_post, sem_wait, sem_trywait,
10977         and sem_timedwait.
10978         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10979         for new implementation.
10980         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10981         and waiters fields.
10982
10983         * tst-sem3.c: Improve error message.
10984         * tst-signal3.c: Likewise.
10985
10986         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10987         to tell the kernel about the termination futex and to initialize tid
10988         member.  Don't initialize main_thread.
10989         * descr.h (struct pthread): Remove main_thread member.
10990         * cancelllation.c (__do_cancel): Remove code handling main thread.
10991         The main thread is not special anymore.
10992
10993         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10994         size of the stacks to stack_cache_actsize.
10995
10996         * pt-readv.c: Add missing "defined".
10997         * pt-sigwait.c: Likewise.
10998         * pt-writev.c: Likewise.
10999
11000 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
11001
11002         * Versions: Export __connect from libpthread.
11003         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11004
11005         * Makefile (libpthread-routines): Add pt-raise.
11006         * sysdeps/unix/sysv/linux/raise.c: New file.
11007         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
11008         * sysdeps/generic/pt-raise.c: New file.
11009
11010         * pthread_cond_init.c: Initialize all data elements of the condvar
11011         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11012
11013         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
11014         * pthread_create.c: Likewise.
11015
11016         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
11017         * tst-key1.c: New file.
11018         * tst-key2.c: New file.
11019         * tst-key3.c: New file.
11020
11021         * Versions: Export pthread_detach for version GLIBC_2.0.
11022         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
11023
11024 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
11025
11026         * pthread_key_create.c: Terminate search after an unused key was found.
11027         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11028
11029         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
11030         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11031
11032 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
11033
11034         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
11035         dynamic lookup for errno in PIC.
11036
11037         * allocatestack.c (get_cached_stack): Rearrange code slightly to
11038         release the stack lock as soon as possible.
11039         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
11040         the static TLS block.
11041         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
11042
11043         * cancellation.c: Renamed from cancelation.c.
11044         * Makefile: Adjust accordingly.
11045         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
11046         * cleanup_defer.c: Use CANCELLATION_P.
11047         * pthread_testcancel.c: Likewise.
11048         * descr.h: Fix spelling in comments.
11049         * init.c: Likewise.
11050         * pthread_getattr_np.c: Likewise.
11051         * pthread_getschedparam.c: Likewise.
11052         * pthread_setschedparam.c: Likewise.
11053         * Versions: Likewise.
11054
11055         * pt-pselect.c: New file.
11056         * Makefile (libpthread-routines): Add pt-pselect.
11057         * Versions: Add pselect.
11058
11059         * tst-cancel4.c: New file.
11060         * Makefile (tests): Add tst-cancel4.
11061
11062 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
11063
11064         * pthread_mutex_lock.c: Always record lock ownership.
11065         * pthread_mutex_timedlock.c: Likewise.
11066         * pthread_mutex_trylock.c: Likewise.
11067
11068         * pt-readv.c: New file.
11069         * pt-writev.c: New file.
11070         * pt-creat.c: New file.
11071         * pt-msgrcv.c: New file.
11072         * pt-msgsnd.c: New file.
11073         * pt-poll.c: New file.
11074         * pt-select.c: New file.
11075         * pt-sigpause.c: New file.
11076         * pt-sigsuspend.c: New file.
11077         * pt-sigwait.c: New file.
11078         * pt-sigwaitinfo.c: New file.
11079         * pt-waitid.c: New file.
11080         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11081         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11082         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11083         * Versions: Add all the new functions.
11084
11085         * tst-exit1.c: New file.
11086         * Makefile (tests): Add tst-exit1.
11087
11088         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11089
11090 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11091
11092         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11093
11094         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11095         call.  pthread_join is an official cancellation point.
11096         * pthread_timedjoin.c: Likewise.
11097
11098         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11099         and the condvar's mutex are retrieved.
11100         * pthread_cond_timedwait.c: Likewise.
11101         Reported by dice@saros.East.Sun.COM.
11102
11103 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11104
11105         * pthreadP.h: Cut out all type definitions and move them...
11106         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11107         * pthreadP.h: Include <internaltypes.h>.
11108
11109         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11110         performance tweaks.
11111
11112         * sem_trywait.c: Shuffle #includes around to get right order.
11113         * sem_timedwait.c: Likewise.
11114         * sem_post.c: Likewise.
11115         * sem_wait.c: Likewise.
11116
11117         * nptl 0.3 released.
11118
11119         * Makefile (tests): Add tst-signal3.
11120         * tst-signal3.c: New file.
11121
11122 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11123
11124         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11125         the asms modify the sem object.
11126         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11127
11128         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11129         the actual members.
11130         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11131         * semaphoreP.h: Include pthreadP.h.
11132         * sem_getvalue.c: Adjust to sem_t change.
11133         * sem_init.c: Likewise.
11134         * sem_open.c: Likewise.
11135         * sem_post.c: Likewise.
11136         * sem_timedwait.c: Likewise.
11137         * sem_trywait.c: Likewise.
11138         * sem_wait.c: Likewise.
11139
11140 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11141
11142         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11143         * tst-basic2.c: New file.
11144         * tst-exec1.c: New file.
11145         * tst-exec2.c: New file.
11146         * tst-exec3.c: New file.
11147
11148         * tst-fork1.c: Remove extra */.
11149
11150         * nptl 0.2 released.  The API for IA-32 is complete.