Fix macro used in test
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2011-09-08  Ulrich Drepper  <drepper@gmail.com>
2
3         [BZ #12403]
4         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
5         (pthread_rwlock_timedwrlock): Use correct macro in test.
6         Patch by H.J. Lu <hongjiu.lu@intel.com>.
7
8 2011-09-06  Ulrich Drepper  <drepper@gmail.com>
9
10         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
11         use gettimeofday vsyscall, just call gettimeofday.
12         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
13         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
14         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
15         Likewise.
16         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
17         Likewise.
18         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
19         Simplify __vdso_clock_gettime use.
20
21 2011-09-05  David S. Miller  <davem@davemloft.net>
22
23         * sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait):
24         New function.
25         (sem_timedwait): Call it to force an exception region around
26         the async cancel enable and the futex operation.
27         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: Likewise.
28         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: Likewise.
29         * sysdeps/unix/sysv/linux/sem_wait.c (do_futex_wait): New function.
30         (__new_sem_wait): Call it to force an exception region around
31         the async cancel enable and the futex operation.
32         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: Likewise.
33         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: Likewise.
34
35 2011-08-31  Andreas Schwab  <schwab@redhat.com>
36
37         * allocatestack.c (setxid_mark_thread): Ensure that the exiting
38         thread is woken up.
39
40 2011-08-20  David S. Miller  <davem@davemloft.net>
41
42         * Makefile (tst-cleanup0.out): Fix typo in output redirection.
43
44 2011-08-14  Roland McGrath  <roland@hack.frob.com>
45
46         * sysdeps/i386/pthreaddef.h (TCB_ALIGNMENT): Set to 64, optimal on Atom.
47         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Likewise.
48
49 2011-08-08  Andreas Schwab  <schwab@redhat.com>
50
51         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Maintain aligned
52         stack.
53         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
54         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
55
56 2011-07-22  Ulrich Drepper  <drepper@gmail.com>
57
58         * sysdeps/pthread/unwind-forcedunwind.c (_Unwind_Resume): Add read
59         barrier.
60         (__gcc_personality_v0): Likewise.
61         (_Unwind_ForcedUnwind): Likewise.
62         (_Unwind_GetCFA): Likewise.
63
64 2011-07-14  Roland McGrath  <roland@hack.frob.com>
65
66         * allocatestack.c (__reclaim_stacks): Use uintptr_t cast rather than
67         UINTMAX_C.
68
69 2011-06-30  Ulrich Drepper  <drepper@gmail.com>
70
71         * nptl-init.c (__nptl_set_robust): New function.
72         (pthread_functions): Add reference.
73         * npthreadP.h: Declare __nptl_set_robust.
74         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
75         ptr_set_robust member.
76         * sysdeps/unix/sysv/linux/fork.c: Call set_robust_list syscall in
77         child if threads are used.
78
79 2011-06-14  Andreas Jaeger  <aj@suse.de>
80
81         * pthread_rwlock_init.c: Include <string.h> for memset declaration.
82
83 2011-05-11  Ulrich Drepper  <drepper@gmail.com>
84
85         [BZ #386]
86         * allocatestack.c (allocate_stack): Convert ENOMEM error to EAGAIN.
87
88 2011-04-10  Ulrich Drepper  <drepper@gmail.com>
89
90         [BZ #12650]
91         * allocatestack.c (get_cached_stack): Deallocate DTV entries before
92         clearing memory.
93         Patch partly by Robert Rex <robert.rex@exasol.com>.
94
95 2011-01-19  Roland McGrath  <roland@redhat.com>
96
97         * pthread_cond_wait.c (__pthread_cond_wait): Fix comment typo.
98         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
99         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Likewise.
100         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
101         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise.
102         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise.
103
104 2011-01-16  Andreas Schwab  <schwab@linux-m68k.org>
105
106         * Makefile (test-extras): Add tst-cleanup4aux.
107
108 2011-01-14  Ulrich Drepper  <drepper@gmail.com>
109
110         [BZ #10563]
111         * sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
112         (__SETXID_2): Likewise.
113         (__SETXID_3): Likewise.
114
115 2011-01-13  Ulrich Drepper  <drepper@gmail.com>
116
117         [BZ #10484]
118         * Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
119         * alloca_cutoff.c: Add libc_hidden_def.
120
121 2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
122
123         [BZ #12113]
124         * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
125         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
126         of "struct pthread".
127
128 2010-09-21  Andreas Schwab  <schwab@redhat.com>
129
130         * sysdeps/pthread/pthread.h (pthread_cleanup_push)
131         [!__EXCEPTIONS]: Mangle local variable not_first_call.
132         (pthread_cleanup_push_defer_np): Likewise.
133
134 2010-09-03  Ulrich Drepper  <drepper@redhat.com>
135
136         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Expect blocks are
137         small.
138
139 2010-08-10  Dinakar Guniguntala  <dino@in.ibm.com>
140             Stefan Hajnoczi  <stefanha@linux.vnet.ibm.com>
141
142         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: If
143         FUTEX_WAKE_OP fails make sure to call FUTEX_WAKE instead.
144
145 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
146
147         * sysdeps/unix/sysv/linux/i386/Makefile: New file.
148
149 2010-05-01  Alan Modra  <amodra@gmail.com>
150
151         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
152         (PSEUDO): Use correct cr save.  Don't use wrong parm save area
153         to save temps.  Correct cfi for possible later frame manipulation.
154         (DOCARGS_1, UNDOCARGS_1): Use the correct parm save area.
155         (DOCARGS_2, UNDOCARGS_2, DOCARGS_3, UNDOCARGS_3): Likewise.
156         (DOCARGS_4, UNDOCARGS_4, DOCARGS_5, UNDOCARGS_5): Likewise.
157         (DOCARGS_6, UNDOCARGS_6): Likewise.
158         (CENABLE, CDISABLE): Add nops for non-shared calls.
159
160 2010-07-06  Andreas Schwab  <schwab@redhat.com>
161
162         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
163         Fix type mismatch.
164
165 2010-07-03  Ulrich Drepper  <drepper@redhat.com>
166
167         * tst-abstime.c (do_test): Some more cleanups
168
169 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
170
171         * tst-abstime.c: Correct testing and add test for sem_timedwait.
172
173 2010-07-01  Andreas Schwab  <schwab@redhat.com>
174             Ulrich Drepper  <drepper@redhat.com>
175
176         * Makefile (tests): Add tst-abstime.
177         * tst-abstime.c: New file.
178         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
179         (__lll_timedlock_wait): Check for timestamp before the Epoch.
180         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
181         (__lll_timedlock_wait): Likewise.
182         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
183         (__lll_robust_timedlock_wait): Likewise.
184         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
185         (__pthread_cond_timedwait): Likewise.
186         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
187         (pthread_rwlock_timedrdlock): Likewise.
188         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
189         (pthread_rwlock_timedwrlock): Likewise.
190         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
191         Likewise.
192
193 2010-07-01  Ulrich Drepper  <drepper@redhat.com>
194
195         * Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
196
197 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
198
199         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
200         location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
201
202 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
203
204         [BZ #11390]
205         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
206         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
207         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
208         pthread_setname.
209         * Makefile (libpthread-routines): Add pthread_getname and
210         pthread_setname.
211         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
212
213 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
214
215         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
216         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
217         * sysdeps/pthread/Makefile: Remove csu section and rt section's
218         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
219
220 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
221
222         * pthread_cond_timedwait.c: Add check for
223         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
224         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
225         INTERNAL_SYSCALL.
226
227 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
228
229         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
230         and the call fails wake eventually waiting setxid threads.  Don't free
231         stack here if we try starting a thread.
232         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
233         if the clone call failed.
234
235 2010-03-08  Andreas Schwab  <schwab@redhat.com>
236
237         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
238         * allocatestack.c (get_cached_stack): Set setxid_futex.
239         (allocate_stack): Likewise.
240
241 2010-03-05  Andreas Schwab  <schwab@redhat.com>
242             Ulrich Drepper  <drepper@redhat.com>
243
244         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
245         it is creating a thread or it is just being created.
246         * pthread_create.c (start_thread): Wake setxid thread if it is
247         waiting.
248         (__pthread_create_2_1): Initialize setxid_futex.
249         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
250         is waiting.
251
252 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
253
254         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
255         Fix unwind info.
256         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
257
258 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
259
260         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
261         Fix pthread_cond_timedwait with requeue-PI.
262         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
263         Fix pthread_cond_wait with requeue-PI.
264
265 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
266
267         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
268         and pthread_mutexattr_setrobust for GLIBC_2.12.
269         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
270         * pthread_mutexattr_getrobust.c: Define alias
271         pthread_mutexattr_getrobust.
272         * pthread_mutexattr_setrobust.c: Define alias
273         pthread_mutexattr_setrobust.
274
275 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
276
277         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
278
279 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
280
281         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
282
283 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
284
285         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
286         call __gmon_start__.
287         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
288
289 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
290
291         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
292         using memset.
293
294 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
295
296         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
297         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
298         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
299         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
300         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
301         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
302         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
304
305 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
306
307         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
308         Don't update nwaiters after invalid timeout is recognized.
309
310 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
311
312         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
313         __gmon_start__.
314
315 2009-11-27  Andreas Schwab  <schwab@redhat.com>
316
317         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
318         THREAD_SELF->cancelhandling after returning from futex call.
319
320 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
321
322         * tst-sem13.c: New file.
323         * Makefile (tests): Add tst-sem13.
324
325 2009-11-22  Roland McGrath  <roland@redhat.com>
326
327         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
328         instead of recapitulating its contents.
329
330 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
331
332         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
333         optimizations and cleanups.
334
335 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
336
337         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
338         Remove redundant code. Fix cfi offsets.
339         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
340         Fix cfi offsets.
341
342 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
343
344         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
345         reduce size of unwind info.
346
347         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
348         cfi directives.
349         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
350         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
351
352 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
353
354         [BZ #4457]
355         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
356         LIBGCC_S_SO.
357         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
358
359 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
360
361         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
362
363         [BZ #3270]
364         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
365         steps to avoid races with creation and terminations.
366         * nptl-init.c (sighandler_setxid): Adjust.
367         Patch by Daniel Jacobowitz.
368
369 2009-09-07  Andreas Schwab  <schwab@redhat.com>
370
371         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
372
373 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
374             Joseph Myers  <joseph@codesourcery.com>
375
376         [BZ #7094]
377         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
378         Initialize the sigev_notify field for newly created timer to make sure
379         the timer gets deleted from the active timer's list upon timer_delete.
380
381 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
382
383         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
384         Correct a logic error.
385
386 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
387
388         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
389         of the field in local variables.
390         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
391         variable and don't unconditionally clear it.
392
393 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
394
395         * pthread_create.c (start_thread): Hint to the kernel that memory for
396         the stack can be reused.  We do not mark all the memory.  The part
397         still in use and some reserve are kept.
398
399 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
400
401         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
402
403 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
404
405         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
406         directives.
407
408 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
409
410         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
411         directives.
412         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
413
414 2009-08-10  Andreas Schwab  <schwab@redhat.com>
415
416         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
417         (__pthread_cond_signal): Don't clobber register used for syscall
418         number.
419
420 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
421
422         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
423         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
424
425         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
426         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
427         register.
428
429 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
430
431         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
432         enabled by the special *_asynccancel functions.
433         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
434         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
435
436         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
437
438 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
439
440         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
441         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
442         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
443         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
444         since we can assume the special __*_{en,dis}able_asynccancel
445         functions.
446         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
447         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
448         and PTHREAD_CANCELED.
449
450 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
451
452         * descr.h: Better definition of *_BITMASK macros for cancellation.
453
454 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
455
456         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
457
458         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
459         dynamic linker might have to save.
460         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
461         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
462         printing.
463
464         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
465
466 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
467
468         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
469         New function.
470         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
471         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
472         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
473         requeue_pi for robust mutexes.
474         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
475         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
476         Don't only skip __pthread_mutex_cond_lock.  Call instead
477         __pthread_mutex_cond_lock_adjust.
478         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
479
480         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
481         optimization of PI mutex handling.
482
483 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
484
485         [BZ #10418]
486         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
487         instead of of _acq variants of cmpxchg.
488
489 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
490
491         * sysdeps/x86_64/configure.in: New file.
492
493         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
494         path when not using absolute timeout futex.
495
496 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
497
498         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
499         optimizations of last changes.
500         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
501
502 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
503
504         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
505         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
506         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
507         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
508         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
509         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
510         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
511         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
512
513         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
514         (__pthread_cond_timedwait): Make more robust.
515
516 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
517
518         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
519         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
520         directly use absolute timeout.
521
522         * tst-sem5.c (do_test): Add test for premature timeout.
523         * Makefile: Linu tst-sem5 with librt.
524
525         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
526         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
527         directly use absolute timeout.
528         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
529         (pthread_rwlock_timedrdlock): Likewise.
530
531         * tst-cond11.c (run_test): Add test to check that the timeout is
532         long enough.
533
534         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
535         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
536         directly use absolute timeout.
537
538         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
539         (__pthread_cond_wait): Convert to using exception handler instead of
540         registered unwind buffer.
541         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
542         (__pthread_cond_timedwait): Likewise.
543
544 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
545
546         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
547         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
548         use absolute timeout.
549
550         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
551         handling of uncontested semaphore.
552
553         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
554         (__condvar_cleanup): Rewrite to use cfi directives instead of
555         hand-coded unwind tables.
556         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
557         Likewise.
558         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
559         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
560         Likewise.
561
562 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
563
564         * Makefile (libpthread-routines): Add pthread_sigqueue.
565         * Versions: Add pthread_sigqueue for GLIBC_2.11.
566         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
567         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
568
569 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
570
571         [BZ #10262]
572         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
573         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
574         cannot be assumed.
575         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
576
577 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
578
579         * libc-cancellation.c: Move __libc_cleanup_routine to...
580         * libc-cleanup.c: ...here.  New file.
581         * Makefile (routines): Add libc-cleanup.
582
583         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
584         test.
585         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
586         * sysdeps/pthread/librt-cancellation.c: Likewise.
587
588         [BZ #9924]
589         * nptl-init.c: Renamed from init.c.
590         * Makefile: Change all occurences of init.c to nptl-init.c.
591
592 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
593
594         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
595         to test when deciding on the delay.
596         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
597         * pthread_cancel.c: Close race between deciding on sending a signal
598         and setting the CANCELING_BIT bit.
599
600         * cancellation.c (__pthread_disable_asynccancel): Don't return if
601         thread is canceled.
602         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
603
604 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
605
606         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
607         is available.
608         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
609         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
610         * sysdeps/i386/tls.h: Likewise.
611         (tcbhead_t): Add __private_tm member.
612
613 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
614
615         * sem_open.c (sem_open): Rewrite initialization of initsem to
616         avoid warnings.
617
618         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
619         Avoid warning by using may_alias attribute on ptrhack.
620
621 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
622
623         [BZ #10090]
624         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
625         Check policy and priority for validity.
626         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
627
628 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
629
630         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
631         (__pthread_cond_timedwait): Change to use cfi directives instead of
632         hand-coded unwind sections.
633
634 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
635
636         * init.c (nptl_freeres): Compile only for SHARED.
637
638 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
639
640         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
641         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
642         FUTEX_BITSET_MATCH_ANY.
643
644 2009-02-27  Roland McGrath  <roland@redhat.com>
645
646         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
647         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
648
649 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
650
651         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
652         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
653         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
654         200112L to 200809L.
655
656 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
657
658         * sysdeps/pthread/pthread.h: The robust mutex functions are in
659         POSIX 2008.
660
661 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
662
663         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
664         Unify name of include protector macro.
665
666 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
667
668         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
669         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
670
671 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
672
673         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
674         pointer variables.
675
676         * allocatestack.c (__free_stacks): Renamed from free_stacks.
677         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
678         * init.c (nptl_freeres): New function.
679         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
680         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
681         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
682         variable.
683         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
684         load DSO.  Assign last.
685         (__unwind_freeres): New function.
686
687         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
688         for better debugging.  No need to use stack_list_add here.
689
690 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
691
692         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
693         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
694         instead of computing relative timeout.
695         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
696         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
697
698 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
699
700         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
701
702 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
703
704         * sysdeps/pthread/list.h (list_add): Initialize new element first.
705         (list_add_tail): Removed.
706
707 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
708
709         * (in_flight_stack): New variable.
710         (stack_list_del): New function.  Use instead of list_del.
711         (stack_list_add): New function.  Use instead of list_add when adding to
712         stack_cache and stack_used lists.
713         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
714         when the fork call interrupted another thread.
715
716 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
717
718         * init.c (__pthread_initialize_minimal_internal): Optimize test
719         FUTEX_CLOCK_REALTIME a bit.
720
721 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
722
723         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
724         only passing five parameters to FUTEX_WAIT_BITSET call.
725
726         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
727         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
728         instead of computing relative timeout.
729
730 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
731
732         * init.c (__pthread_initialize_minimal_internal): Check for
733         FUTEX_CLOCK_REALTIME flag.
734         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
735         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
736         relative timeout.
737
738         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
739         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
740         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
741         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
742         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
743         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
744
745 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
746
747         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
748         loop body instead of ; to avoid gcc warnings.
749         (pthread_cleanup_pop_restore_np): Likewise.
750         Patch by Caolán McNamara <caolanm@redhat.com>.
751
752 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
753
754         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
755         fast path here, for robust/PI/PP mutexes call
756         __pthread_mutex_lock_full.  Don't use switch, instead use a series
757         of ifs according to their probability.
758         (__pthread_mutex_lock_full): New function.
759         * pthread_mutex_unlock.c: Include assert.h.
760         (__pthread_mutex_unlock_usercnt): Handle only the
761         fast path here, for robust/PI/PP mutexes call
762         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
763         of ifs according to their probability.
764         (__pthread_mutex_unlock_full): New function.
765         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
766         (__pthread_mutex_lock_full): Define.
767
768 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
769
770         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
771         implementation.  Add necessary padding and.
772         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
773         words.
774
775 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
776
777         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
778         and FUTEX_WAKE_BITSET.
779
780 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
781
782         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
783         and FUTEX_WAKE_BITSET.
784         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
785         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
786         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
787         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
788
789 2008-11-25  Roland McGrath  <roland@redhat.com>
790
791         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
792         Subdirectories moved to ports repository as
793         sysdeps/.../nptl subdirectories.
794
795 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
796
797         [BZ #7008]
798         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
799         of old value.
800         * pthread_cond_init.c (__pthread_cond_init): Fix
801         cond->__data.__nwaiters initialization.
802         * Makefile (tests): Add tst-cond23.
803         * tst-cond23.c: New test.
804
805 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
806
807         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
808         arguments.
809         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
810         arguments.
811
812 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
813
814         [BZ #6955]
815         * pthread_mutex_lock.c: Add support for private PI mutexes.
816         * pthread_mutex_timedlock.c: Likewise.
817         * pthread_mutex_trylock.c: Likewise.
818         * pthread_mutex_unlock.c: Likewise.
819         Patch mostly by Ben Jackson <ben@ben.com>.
820
821 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
822
823         [BZ #6843]
824         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
825         Increase stack size for helper thread.
826
827 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
828
829         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
830         assembly with a clobber list for access registers a0 and a1.
831
832 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
833
834         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
835         to force runp->refcntr to be read from memory.
836
837 2008-09-08  Richard Guenther  <rguenther@suse.de>
838
839         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
840         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
841         lll_timedlock, lll_robust_timedlock, lll_unlock,
842         lll_robust_unlock): Promote private to int.
843
844 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
845
846         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
847         ARCH_RETRY_MMAP definitions.
848         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
849         Define MAP_STACK when not defined.
850         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
851         handling of ARCH_RETRY_MMAP.
852
853 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
854
855         * tst-align2.c (f): Print message that f is reached.
856
857 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
858
859         [BZ #6740]
860         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
861         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
862
863 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
864
865         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
866         SOCK_CLOEXEC if possible.
867
868 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
869
870         * Makefile (tests): Add tst-rwlock2a.
871         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
872         * tst-rwlock2a.c: New file.
873
874 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
875
876         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
877
878 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
879
880         * sysdeps/pthread/pthread.h: Fix typo in comment.
881
882 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
883
884         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
885         of CPU set to the kernel.
886
887 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
888
889         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
890         cfi directives.
891         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
892         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
893         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
894         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
895         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
896         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
897
898 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
899
900         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
901         cfi directives.
902         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
903         Likewise.
904         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
905         Likewise.
906         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
907         Likewise.
908
909 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
910
911         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
912
913 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
914
915         David S. Miller  <davem@davemloft.net>
916
917         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
918
919 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
920
921         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
922         __pshared correctly.
923         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
924         Likewise.
925         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
926         Likewise.
927         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
928         Likewise.
929         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
930         Likewise.
931         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
932
933 2008-04-14  David S. Miller  <davem@davemloft.net>
934
935         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
936         (__old_sem_wait): Fix argument to lll_futex_wait().
937
938 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
939
940         * pthread_create.c: Require pthread_mutex_trylock and
941         pthread_key_delete for libgcc.
942
943 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
944
945         [BZ #6020]
946         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
947         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
948         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
949
950 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
951
952         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
953         <linux/limits.h> has defined it.
954         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
955         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
956         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
957         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
958
959 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
960
961         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
962         of ASSEMBLER.
963         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
964         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
965
966 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
967
968         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
969         HAVE_DL_DISCOVER_OSVERSION.
970         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
971         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
972
973 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
974
975         [BZ #5778]
976         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
977         _POSIX_CHOWN_RESTRICTED value to zero.
978
979 2008-01-31  Roland McGrath  <roland@redhat.com>
980
981         * Makefile (omit-deps): Variable removed.
982
983 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
984
985         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
986         unnecessary addr32 prefix.
987
988 2008-01-29  Roland McGrath  <roland@redhat.com>
989
990         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
991
992 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
993
994         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
995
996 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
997
998         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
999         a scratch register.
1000         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1001         (__lll_lock_wait_private): Fix typo.
1002         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
1003         (pthread_barrier_wait): Likewise.  Adjust XADD use.
1004         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1005         Adjust XADD use.
1006         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
1007         (pthread_rwlock_timedrdlock): Return correct return value.
1008         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
1009         (pthread_rwlock_timedwrlock): Likewise.
1010
1011 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
1012
1013         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
1014         thread returns the program exits with an error code.
1015
1016 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
1017
1018         * pthread-errnos.sym: Add EOVERFLOW.
1019         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
1020         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
1021         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1022         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1023
1024 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
1025
1026         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
1027         parameter.  Passed it as permission to mmap.
1028         * allocatestack.c (allocate_stack): Pass prot as second parameter
1029         to ARCH_RETRY_MMAP.
1030
1031 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
1032
1033         * tst-basic7.c: Allocate memory for the stack.
1034
1035         [BZ #5465]
1036         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
1037         (__pthread_cond_timedwait): Don't use VDSO.
1038         Patch by Michal Januszewski.
1039
1040 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
1041
1042         [BZ #5455]
1043         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
1044         Allow label before pthread_cleanup_pop.
1045         (pthread_cleanup_pop_restore_np): Likewise.
1046
1047 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1048
1049         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
1050         Store 2 before returning ETIMEDOUT.
1051
1052 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
1053
1054         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
1055         Store 2 before returning ETIMEDOUT.
1056         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
1057         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1058         (__lll_lock_wait_private): Optimize.
1059         (__lll_lock_wait): Likewise.
1060
1061 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
1062
1063         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
1064         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
1065         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
1066
1067 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
1068
1069         [BZ #5240]
1070         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1071         If we time out, try one last time to lock the futex to avoid
1072         losing a wakeup signal.
1073         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1074         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1075
1076         [BZ #5245]
1077         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
1078         if necessary.
1079
1080 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
1081
1082         [BZ #5245]
1083         * allocatestack.c (allocate_stack): Change ENOMEM error in case
1084         mmap failed to EAGAIN.
1085         * Makefile (tests): Add tst-basic7.
1086         * tst-basic7.c: New file.
1087
1088 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
1089
1090         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
1091         Use __linkin_atfork.
1092
1093 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
1094
1095         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
1096         missing line continuations.
1097         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
1098         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
1099
1100 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
1101
1102         [BZ #5220]
1103         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
1104         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
1105         (struct timer): Add next element.
1106         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
1107         enqueue timer structure into __active_timer_sigev_thread list.
1108         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
1109         remove timer struct from __active_timer_sigev_thread.
1110         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1111         Before using timer structure make sure it is still on the
1112         __active_timer_sigev_thread list.  Keep lock until done.
1113         Define __active_timer_sigev_thread and
1114         __active_timer_sigev_thread_lock.
1115
1116 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
1117
1118         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
1119         Redefine thread_atfork for use of ATFORK_MEM.
1120         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
1121         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
1122         function.
1123         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1124         Use atomic operation when removing first element of list.
1125
1126 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
1127
1128         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
1129         routine instead of an alias to __new_sem_post.
1130
1131 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
1132
1133         * init.c (__pthread_initialize_minimal): Initialize word to appease
1134         valgrind.
1135
1136 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
1137
1138         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
1139         libc.so just clear NAME.
1140         (__libc_rwlock_fini): Nop inside of libc.so.
1141         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
1142         all zeros.
1143
1144 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
1145
1146         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1147         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
1148         unlocking failed.
1149         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
1150
1151 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
1152
1153         [BZ #4938]
1154         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
1155         reclaimed stack if necessary.
1156         * Makefile (tests): Add tst-tsd6.
1157         * tst-tsd6.c: New file.
1158
1159 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1160
1161         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
1162         Add private argument.
1163
1164 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
1165
1166         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1167         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
1168
1169 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
1170
1171         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
1172         (__lll_robust_timedlock): Pass private as last argument to
1173         __lll_robust_timedlock_wait.
1174         (__lll_unlock): Fix a pasto.
1175
1176 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1177
1178         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
1179         sparc_old_sem): New structs.
1180         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
1181         (__sem_wait_cleanup): New function.
1182         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
1183         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1184         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1185         lll_futex_wait.
1186         (__old_sem_wait): New function.
1187         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
1188         nptl/sysdeps/unix/sysv/linux/sparc version.
1189         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
1190         Likewise.
1191         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
1192         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
1193         (__new_sem_trywait): Use sparc_old_sem structure.
1194         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
1195         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
1196         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1197         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1198         lll_futex_timed_wait.
1199         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
1200         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
1201         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1202         lll_futex_wake.
1203         (__old_sem_post): New function.
1204         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
1205         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
1206         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
1207         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
1208         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
1209         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
1210
1211 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1212
1213         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1214         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1215         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1216         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1217         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
1218         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1219         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1220         Use FUTEX_WAKE_OP.
1221         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1222         kernel-features.h and tcb-offsets.h.
1223         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1224         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1225         process private.
1226         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1227         tcb-offsets.h.
1228         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
1229         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1230         process private.
1231         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
1232         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1233         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1234         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1235         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1236         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1237         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1238
1239 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
1240
1241         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
1242         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1243         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
1244         lll_futex_timed_wait.
1245
1246         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
1247         __lll_robust_unlock): Rewrite as macros instead of inline functions.
1248         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
1249         __lll_robust_unlock, __lll_wait_tid): Likewise.
1250
1251 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1252
1253         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1254         Fix a pasto.
1255         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1256         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1257         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1258         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1259         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1260         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1261         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1262         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
1263         kernel-features.h.
1264         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1265         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1266         process private.  Switch DW_CFA_advance_loc1 and some
1267         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1268         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1269         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
1270         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1271         process private.  Switch DW_CFA_advance_loc{1,2} and some
1272         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1273         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
1274         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1275         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1276         Likewise.
1277         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1278         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1279         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1280         Likewise.
1281         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1282         (__pthread_cond_broadcast): Compare %r8 instead of
1283         dep_mutex-cond_*(%rdi) with $-1.
1284         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1285         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1286         of oring.
1287
1288 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1289
1290         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1291
1292 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1293
1294         * allocatestack.c: Include kernel-features.h.
1295         * pthread_create.c: Likewise.
1296         * pthread_mutex_init.c: Likewise.
1297         * init.c: Likewise.
1298         * pthread_cond_timedwait.c: Likewise.
1299         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1300         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1301         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1302         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1303         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1304         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1305         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1306         Likewise.
1307         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1308         Likewise.
1309         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1310         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1311         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1312         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1313
1314 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1315
1316         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1317         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1318         byte elements.  One of them is the new __shared element.
1319         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1320         adjust names of other padding elements.
1321         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1322         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1323         byte elements.  One of them is the new __shared element.
1324         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1325         adjust names of other padding elements.
1326         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1327         Renamed __pad1 element to __shared, adjust names of other padding
1328         elements.
1329         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1330         (pthread_rwlock_t): Likewise.
1331         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1332         typo.
1333
1334 2007-08-09  Anton Blanchard  <anton@samba.org>
1335
1336         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1337
1338 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1339
1340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1341         <kernel-features.h>.
1342         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1343
1344 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1345
1346         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1347         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1348         dealing with robust mutexes.
1349         * pthread_mutex_timedlock.c: Likewise.
1350         * pthread_mutex_trylock.c: Likewise.
1351         * pthread_mutex_unlock.c: Likewise.
1352         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1353
1354 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1355
1356         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1357         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1358         (PTHREAD_MUTEX_PSHARED): Define.
1359         * pthread_mutex_init.c (__pthread_mutex_init): Set
1360         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1361         mutexes.
1362         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1363         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1364         as second argument to lll_lock.
1365         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1366         instead of its __data.__lock field.
1367         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1368         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1369         to lll_robust_lock.
1370         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1371         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1372         instead of mutex->__data.__kind directly, pass
1373         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1374         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1375         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1376         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1377         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1378         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1379         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1380         of mutex->__data.__kind directly.
1381         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1382         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1383         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1384         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1385         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1386         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1387         and lll_futex_wake.
1388         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1389         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1390         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1391         directly.
1392         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1393         Take mutex as argument instead of its __data.__lock field, pass
1394         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1395         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1396         __data.__lock field.
1397         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1398         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1399         to lll_robust_cond_lock.
1400         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1401         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1402         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1403         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1404         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1405         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1406         lll_futex_wait.
1407         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1408         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1409         lll_futex_wake.
1410         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1411         pshared variable, pass it to lll_lock, lll_unlock,
1412         lll_futex_timedwait and lll_futex_wake.
1413         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1414         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1415         and lll_futex_wake.
1416         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1417         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1418         macro.
1419         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1420         lll_futex_wake_unlock): Likewise.
1421         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1422         Likewise.
1423         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1424         lll_futex_wake_unlock): Likewise.
1425         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1426         Likewise.
1427         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1428         lll_futex_wake_unlock): Likewise.
1429         (lll_futex_wake): Fix a typo.
1430         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1431         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1432         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1433         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1434         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1435         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1436         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1437         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1438         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1439         (__pthread_cond_timedwait): Likewise.
1440         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1441         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1442
1443 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1444
1445         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1446         Don't use CGOTSETUP and CGOTRESTORE macros.
1447         (CGOTSETUP, CGOTRESTORE): Remove.
1448         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1449         @local symbol.
1450
1451 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1452
1453         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1454         definitions for private futexes.
1455         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1456         kernel-features.h and lowlevellock.h.  Use private futexes if
1457         they are available.
1458         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1459         (__lll_mutex_lock_wait): Rename to
1460         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1461         (__lll_mutex_timedlock_wait): Rename to ...
1462         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1463         Don't compile in for libc.so.
1464         (__lll_mutex_unlock_wake): Rename to ...
1465         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1466         (__lll_timedwait_tid): Use __NR_gettimeofday.
1467         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1468         the header from assembler.  Renamed all lll_mutex_* resp.
1469         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1470         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1471         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1472         Define.
1473         (__lll_lock_wait_private): Add prototype.
1474         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1475         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1476         __lll_unlock_wake): Likewise.
1477         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1478         if private is constant LLL_PRIVATE.
1479         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1480         lll_timedlock, lll_robust_timedlock): Add private argument.
1481         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1482         if private is constant LLL_PRIVATE.
1483         (lll_robust_unlock, lll_robust_dead): Add private argument.
1484         (lll_lock_t): Remove.
1485         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1486         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1487         lll_cond_wake, lll_cond_broadcast): Remove.
1488         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1489         kernel-features.h and lowlevellock.h.
1490         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1491         (LOAD_FUTEX_WAIT): Define.
1492         (__lll_robust_mutex_lock_wait): Rename to ...
1493         (__lll_robust_lock_wait): ... this.  Add private argument.
1494         Use LOAD_FUTEX_WAIT macro.
1495         (__lll_robust_mutex_timedlock_wait): Rename to ...
1496         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1497         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1498         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1499         lowlevellock.h.
1500         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1501         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1502         __lll_mutex_{lock,unlock}_*.
1503         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1504         lowlevellock.h and pthread-errnos.h.
1505         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1506         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1507         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1508         __lll_mutex_{lock,unlock}_*.
1509         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1510         lowlevellock.h and pthread-errnos.h.
1511         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1512         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1513         __lll_mutex_{lock,unlock}_*.
1514         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1515         lowlevellock.h.
1516         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1517         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1518         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1519         (__condvar_tw_cleanup): Likewise.
1520         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1521         lowlevellock.h.
1522         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1523         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1524         __lll_mutex_{lock,unlock}_*.
1525         ( __condvar_w_cleanup): Likewise.
1526         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1527         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1528         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1529         lowlevellock.h.
1530         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1531         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1532         __lll_mutex_{lock,unlock}_*.
1533         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1534         lowlevellock.h.
1535         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1536         FUTEX_PRIVATE_FLAG): Remove.
1537         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1538         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1539         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1540         lowlevellock.h.
1541         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1542         FUTEX_PRIVATE_FLAG): Remove.
1543         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1544         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1545         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1546         lowlevellock.h.
1547         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1548         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1549         __lll_mutex_{lock,unlock}_*.
1550         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1551         lowlevellock.h.
1552         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1553         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1554         __lll_mutex_{lock,unlock}_*.
1555         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1556         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1557         (__new_sem_post): Use standard initial exec code sequences.
1558         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1559         lowlevellock.h.
1560         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1561         FUTEX_PRIVATE_FLAG): Remove.
1562         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1563         exec code sequences.
1564         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1565         (__new_sem_trywait): Use standard initial exec code sequences.
1566         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1567         (__new_sem_wait): Use standard initial exec code sequences.
1568
1569 2007-07-31  Anton Blanchard  <anton@samba.org>
1570
1571         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1572         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1573         atomic_full_barrier.
1574
1575 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1576
1577         * allocatestack.c (stack_cache_lock): Change type to int.
1578         (get_cached_stack, allocate_stack, __deallocate_stack,
1579         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1580         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1581         as second argument to lll_lock and lll_unlock macros on
1582         stack_cache_lock.
1583         * pthread_create.c (__find_in_stack_list): Likewise.
1584         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1585         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1586         as second argument.
1587         * descr.h (struct pthread): Change lock and setxid_futex field
1588         type to int.
1589         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1590         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1591         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1592         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1593         Likewise.
1594         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1595         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1596         * pthreadP.h (__attr_list_lock): Change type to int.
1597         * pthread_attr_init.c (__attr_list_lock): Likewise.
1598         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1599         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1600         lll_{,un}lock.
1601         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1602         also for lll_futex_{wake,wait}.
1603         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1604         a pointer to const.
1605         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1606         LLL_SHARED as second argument to lll_{,un}lock.
1607         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1608         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1609         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1610         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1611         Likewise.
1612         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1613         as second argument to lll_{,un}lock macros on pd->lock.
1614         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1615         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1616         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1617         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1618         Likewise.
1619         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1620         Likewise.
1621         * pthread_once.c (once_lock): Change type to int.
1622         (__pthread_once): Pass LLL_PRIVATE as second argument to
1623         lll_{,un}lock macros on once_lock.
1624         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1625         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1626         rwlock->__data.__shared as second argument to them and similarly
1627         for lll_futex_w*.
1628         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1629         Likewise.
1630         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1631         Likewise.
1632         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1633         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1634         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1635         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1636         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1637         to lll_{,un}lock macros on __sem_mappings_lock.
1638         * sem_open.c (check_add_mapping): Likewise.
1639         (__sem_mappings_lock): Change type to int.
1640         * semaphoreP.h (__sem_mappings_lock): Likewise.
1641         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1642         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1643         instead of lll_*mutex_*, pass LLL_SHARED as last
1644         argument.
1645         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1646         pass LLL_SHARED as last argument.
1647         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1648         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1649         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1650         pass LLL_SHARED as last argument.
1651         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1652         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1653         LLL_SHARED as last argument.
1654         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1655         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1656         Similarly.
1657         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1658         __libc_lock_lock_recursive, __libc_lock_unlock,
1659         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1660         argument to lll_{,un}lock.
1661         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1662         _IO_lock_unlock): Likewise.
1663         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1664         compound literal.
1665         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1666         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1667         __fork_lock.
1668         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1669         free_mem): Likewise.
1670         (__fork_lock): Change type to int.
1671         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1672         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1673         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1674         lll_futex_wake.
1675         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1676         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1677         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1678         New function.
1679         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1680         pass it through to lll_futex_*wait, only compile in when
1681         IS_IN_libpthread.
1682         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1683         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1684         argument and pass it through to lll_futex_*wait.
1685         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1686         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1687         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1688         inline functions to __lll_* resp. __lll_robust_*.
1689         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1690         (lll_mutex_dead): Add private argument.
1691         (__lll_lock_wait_private): New prototype.
1692         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1693         __lll_robust_lock_timedwait): Add private argument to prototypes.
1694         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1695         call __lll_lock_wait_private, otherwise pass private to
1696         __lll_lock_wait.
1697         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1698         __lll_robust_timedlock): Add private argument, pass it to
1699         __lll_*wait functions.
1700         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1701         call __lll_unlock_wake_private, otherwise pass private to
1702         __lll_unlock_wake.
1703         (__lll_robust_unlock): Add private argument, pass it to
1704         __lll_robust_unlock_wake.
1705         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1706         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1707         argument, pass it through to __lll_* inline function.
1708         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1709         (lll_lock_t): Remove.
1710         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1711         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1712         lll_cond_wake, lll_cond_broadcast): Remove.
1713         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1714         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1715         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1716         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1717         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1718         the header from assembler.  Renamed all lll_mutex_* resp.
1719         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1720         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1721         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1722         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1723         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1724         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1725         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1726         Remove prototype.
1727         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1728         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1729         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1730         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1731         MULTIPLE_THREADS_OFFSET as another asm operand.
1732         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1733         MULTIPLE_THREADS_OFFSET as last asm operand, call
1734         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1735         otherwise pass private as another argument to __lll_lock_wait.
1736         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1737         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1738         private as another argument to __lll_*lock_wait call.
1739         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1740         MULTIPLE_THREADS_OFFSET as another asm operand, call
1741         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1742         otherwise pass private as another argument to __lll_unlock_wake.
1743         (lll_robust_unlock): Add private argument, pass private as another
1744         argument to __lll_unlock_wake.
1745         (lll_robust_dead): Add private argument, use __lll_private_flag
1746         macro.
1747         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1748         LLL_MUTEX_LOCK_INITIALIZER.
1749         (lll_lock_t): Remove.
1750         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1751         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1752         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1753         lll_cond_wake, lll_cond_broadcast): Remove.
1754         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1755         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1756         2007-05-2{3,9} changes.
1757         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1758         kernel-features.h and lowlevellock.h.
1759         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1760         (LOAD_FUTEX_WAIT): Rewritten.
1761         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1762         define.
1763         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1764         (__lll_mutex_lock_wait): Rename to ...
1765         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1766         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1767         (__lll_mutex_timedlock_wait): Rename to ...
1768         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1769         contains private argument.  Don't compile in for libc.so.
1770         (__lll_mutex_unlock_wake): Rename to ...
1771         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1772         Don't compile in for libc.so.
1773         (__lll_timedwait_tid): Use __NR_gettimeofday.
1774         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1775         kernel-features.h and lowlevellock.h.
1776         (LOAD_FUTEX_WAIT): Define.
1777         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1778         define.
1779         (__lll_robust_mutex_lock_wait): Rename to ...
1780         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1781         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1782         macro.
1783         (__lll_robust_mutex_timedlock_wait): Rename to ...
1784         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1785         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1786         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1787         lowlevellock.h.
1788         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1789         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1790         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1791         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1792         to __lll_lock_wait in %edx.
1793         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1794         Include lowlevellock.h and pthread-errnos.h.
1795         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1796         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1797         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1798         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1799         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1800         __lll_unlock_wake.
1801         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1802         Include lowlevellock.h and pthread-errnos.h.
1803         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1804         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1805         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1806         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1807         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1808         __lll_unlock_wake.
1809         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1810         Include lowlevellock.h.
1811         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1812         Don't define.
1813         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1814         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1815         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1816         __lll_unlock_wake.  Use __NR_gettimeofday.
1817         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1818         Include lowlevellock.h.
1819         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1820         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1821         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1822         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1823         and __lll_unlock_wake.
1824         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1825         Include lowlevellock.h.
1826         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1827         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1828         MUTEX(%ebx) address in %edx rather than %ecx to
1829         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1830         and __lll_unlock_wake.  Move return value from %ecx to %edx
1831         register.
1832         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1833         Include lowlevellock.h.
1834         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1835         Don't define.
1836         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1837         MUTEX(%ebp) address in %edx rather than %ecx to
1838         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1839         and __lll_unlock_wake.  Move return value from %ecx to %edx
1840         register.  Use __NR_gettimeofday.
1841         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1842         Include lowlevellock.h.
1843         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1844         Don't define.
1845         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1846         MUTEX(%ebp) address in %edx rather than %ecx to
1847         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1848         and __lll_unlock_wake.  Move return value from %ecx to %edx
1849         register.  Use __NR_gettimeofday.
1850         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1851         Include lowlevellock.h.
1852         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1853         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1854         MUTEX(%edi) address in %edx rather than %ecx to
1855         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1856         and __lll_unlock_wake.
1857         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1858         Include lowlevellock.h.
1859         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1860         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1861         MUTEX(%ebx) address in %edx rather than %ecx to
1862         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1863         and __lll_unlock_wake.  Move return value from %ecx to %edx
1864         register.
1865         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1866         lowlevellock.h.
1867         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1868         define.
1869         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1870         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1871         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1872         lowlevellock.h.
1873         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1874         (sem_timedwait): Use __NR_gettimeofday.
1875         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1876         lowlevellock.h.
1877         (LOCK): Don't define.
1878         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1879         lowlevellock.h.
1880         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1881         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1882         are waiters.
1883         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1884         2007-05-2{3,9} changes.
1885         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1886         kernel-features.h and lowlevellock.h.
1887         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1888         (LOAD_FUTEX_WAIT): Rewritten.
1889         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1890         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1891         (__lll_mutex_lock_wait): Rename to ...
1892         (__lll_lock_wait): ... this.  %esi is now private argument.
1893         Don't compile in for libc.so.
1894         (__lll_mutex_timedlock_wait): Rename to ...
1895         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1896         Don't compile in for libc.so.
1897         (__lll_mutex_unlock_wake): Rename to ...
1898         (__lll_unlock_wake): ... this.  %esi contains private argument.
1899         Don't compile in for libc.so.
1900         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1901         kernel-features.h and lowlevellock.h.
1902         (LOAD_FUTEX_WAIT): Define.
1903         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1904         (__lll_robust_mutex_lock_wait): Rename to ...
1905         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1906         Use LOAD_FUTEX_WAIT macro.
1907         (__lll_robust_mutex_timedlock_wait): Rename to ...
1908         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1909         private, use LOAD_FUTEX_WAIT macro.
1910         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1911         lowlevellock.h.
1912         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1913         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1914         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1915         __lll_lock_wait and __lll_unlock_wake.
1916         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1917         Include lowlevellock.h and pthread-errnos.h.
1918         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1919         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1920         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1921         pass LLL_SHARED in %esi to both __lll_lock_wait and
1922         __lll_unlock_wake.
1923         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1924         Include lowlevellock.h and pthread-errnos.h.
1925         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1926         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1927         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1928         pass LLL_SHARED in %esi to both __lll_lock_wait and
1929         __lll_unlock_wake.
1930         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1931         Include lowlevellock.h.
1932         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1933         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1934         pass LLL_SHARED in %esi to both __lll_lock_wait and
1935         __lll_unlock_wake.
1936         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1937         Include lowlevellock.h.
1938         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1939         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1940         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1941         and __lll_unlock_wake.
1942         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1943         Include lowlevellock.h.
1944         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1945         Don't define.
1946         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1947         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1948         and __lll_unlock_wake.
1949         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1950         Include lowlevellock.h.
1951         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1952         Don't define.
1953         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1954         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1955         and __lll_unlock_wake.
1956         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1957         Include lowlevellock.h.
1958         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1959         Don't define.
1960         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1961         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1962         and __lll_unlock_wake.
1963         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1964         Include lowlevellock.h.
1965         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1966         Don't define.
1967         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1968         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1969         and __lll_unlock_wake.
1970         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1971         Include lowlevellock.h.
1972         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1973         Don't define.
1974         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1975         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1976         and __lll_unlock_wake.
1977         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1978         lowlevellock.h.
1979         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1980         define.
1981         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1982         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1983         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1984         lowlevellock.h.
1985         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1986         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1987         lowlevellock.h.
1988         (LOCK): Don't define.
1989         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1990         lowlevellock.h.
1991         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1992         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1993         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1994         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1995         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1996         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1997         (__lll_lock_wait_private): New function.
1998         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1999         it to lll_futex_*wait.  Don't compile in for libc.so.
2000         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
2001         Remove.
2002         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
2003         (struct sparc_pthread_barrier): Remove.
2004         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
2005         struct sparc_pthread_barrier.  Pass
2006         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
2007         and lll_futex_wait macros.
2008         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2009         Remove.
2010         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2011         Include sparc pthread_barrier_wait.c instead of generic one.
2012
2013 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
2014
2015         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
2016
2017         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
2018         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
2019         %ecx.
2020         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
2021         (pthread_rwlock_timedwrlock): Likewise.
2022         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
2023         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
2024
2025 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
2026
2027         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
2028
2029 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
2030
2031         * tst-locale2.c (useless): Add return statement.
2032
2033 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
2034
2035         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
2036         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
2037         * pthread_create.c (start_thread): Likewise.
2038         * init.c (sighandler_setxid): Likewise.
2039         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2040         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2041         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2042         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2043         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2044         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2045         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2046         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
2047         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
2048         Likewise.
2049         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
2050         Likewise.
2051         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
2052         Likewise.
2053         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
2054         __rtld_notify): Likewise.
2055         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
2056         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
2057         __pthread_once): Likewise.
2058         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
2059         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2060         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2061         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2062         (lll_futex_wait): Add private argument, define as wrapper around
2063         lll_futex_timed_wait.
2064         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2065         use __lll_private_flag macro.
2066         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2067         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
2068         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
2069         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2070         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2071         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2072         (lll_futex_wait): Add private argument, define as wrapper around
2073         lll_futex_timed_wait.
2074         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2075         use __lll_private_flag macro.
2076         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
2077         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
2078         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
2079         Define.
2080         (lll_futex_timed_wait, lll_futex_wake): Use it.
2081         (lll_private_futex_wait, lll_private_futex_timed_wait,
2082         lll_private_futex_wake): Removed.
2083         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
2084         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2085         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2086         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2087         (lll_futex_wait): Add private argument, define as wrapper around
2088         lll_futex_timed_wait.
2089         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2090         use __lll_private_flag macro.
2091         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2092         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
2093         to lll_futex_*.
2094         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2095         (lll_private_futex_wait, lll_private_futex_timed_wait,
2096         lll_private_futex_wake): Removed.
2097         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
2098         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
2099         (lll_private_futex_wait, lll_private_futex_timed_wait,
2100         lll_private_futex_wake): Removed.
2101         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
2102         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
2103         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
2104         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
2105         (lll_futex_wait): Add private argument, define as wrapper around
2106         lll_futex_timed_wait.
2107         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
2108         use __lll_private_flag macro.
2109         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
2110         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
2111         to lll_futex_*.
2112         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
2113         Define.
2114         (lll_futex_timed_wait, lll_futex_wake): Use it.
2115         (lll_private_futex_wait, lll_private_futex_timed_wait,
2116         lll_private_futex_wake): Removed.
2117
2118 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
2119
2120         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
2121         of the structure for sparc32.
2122
2123 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
2124
2125         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
2126
2127 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2128
2129         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2130         code used when private futexes are assumed.
2131         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2132         Likewise.
2133
2134 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
2135
2136         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2137         (__lll_private_flag): Define.
2138         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
2139         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
2140         __lll_private_flag.
2141         (lll_private_futex_wait, lll_private_futex_timedwait,
2142         lll_private_futex_wake): Define as wrapper around non-_private
2143         macros.
2144         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2145         (__lll_private_flag): Define.
2146         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
2147         (lll_private_futex_wait, lll_private_futex_timedwait,
2148         lll_private_futex_wake): Define as wrapper around non-_private
2149         macros.
2150
2151 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
2152
2153         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
2154         parameter to lll_futex_wait call.
2155         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
2156
2157         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2158         Replace lll_futex_wait with lll_private_futex_wait.
2159         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
2160         Add LLL_SHARED parameter to lll_futex_wake().
2161
2162         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
2163         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
2164         lll_private_futex_wake.
2165         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
2166         bit from private parm before syscall.
2167         (lll_futex_timed_wait): Likewise.
2168         (lll_futex_wake): Likewise.
2169         (lll_futex_wake_unlock): Likewise.
2170         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
2171         (lll_robust_mutex_unlock): Likewise.
2172         (lll_mutex_unlock_force): Likewise.
2173         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
2174
2175 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2176
2177         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2178         compilation when unconditionally using private futexes.
2179         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2180         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2181         Likewise.
2182         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2183         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2184
2185 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
2186
2187         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
2188         Define.
2189
2190 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2191
2192         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
2193         kernel-features.h.
2194
2195 2007-05-16  Roland McGrath  <roland@redhat.com>
2196
2197         * init.c (__nptl_initial_report_events): New variable.
2198         (__pthread_initialize_minimal_internal): Initialize pd->report_events
2199         to that.
2200
2201 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
2202
2203         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
2204         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2205
2206 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
2207
2208         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
2209         implementation.
2210
2211 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
2212
2213         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
2214         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
2215         * pthread_mutex_timedlock.c: Likewise.
2216         * pthread_mutex_trylock.c: Likewise.
2217         * pthread_mutex_unlock.c: Likewise.
2218
2219 2007-06-17  Andreas Schwab  <schwab@suse.de>
2220
2221         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
2222         sections.
2223
2224 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
2225
2226         * allocatestack.c (allocate_stack): Make code compile if
2227         __ASSUME_PRIVATE_FUTEX is set.
2228
2229 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2230
2231         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
2232         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
2233         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
2234         (__pthread_rwlock_wrlock): Likewise.
2235         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2236         (pthread_rwlock_timedrdlock): Likewise.
2237         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2238         (pthread_rwlock_timedwrlock): Likewise.
2239         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
2240         (__pthread_rwlock_unlock): Likewise.
2241
2242 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2243
2244         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
2245         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
2246         Split __flags into __flags, __shared, __pad1 and __pad2.
2247         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
2248         futexes if they are available.
2249         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
2250         in libc-lowlevellock.S allow using private futexes.
2251         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2252         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
2253         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
2254         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
2255         lll_private_futex_timed_wait and lll_private_futex_wake.
2256         (lll_robust_mutex_unlock): Fix typo.
2257         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
2258         field in futex command setup.
2259         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
2260         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
2261         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2262         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
2263         if they are available.  Remove clear_once_control.
2264         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
2265         futexes if they are available.
2266         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2267         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2268         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2269         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2270         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
2271         Wake only when there are waiters.
2272         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
2273         support.  Indicate that there are waiters.  Remove unnecessary
2274         extra cancellation test.
2275         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
2276         left-over duplication of __sem_wait_cleanup.
2277
2278 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2279
2280         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2281         parameter to lll_futex_wait, lll_futex_timed_wait, and
2282         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2283         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2284         lll_private_futex_wake.
2285         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2286         * allocatestack.c: Adjust use of lll_futex_* macros.
2287         * init.c: Likewise.
2288         * lowlevellock.h: Likewise.
2289         * pthread_barrier_wait.c: Likewise.
2290         * pthread_cond_broadcast.c: Likewise.
2291         * pthread_cond_destroy.c: Likewise.
2292         * pthread_cond_signal.c: Likewise.
2293         * pthread_cond_timedwait.c: Likewise.
2294         * pthread_cond_wait.c: Likewise.
2295         * pthread_create.c: Likewise.
2296         * pthread_mutex_lock.c: Likewise.
2297         * pthread_mutex_setprioceiling.c: Likewise.
2298         * pthread_mutex_timedlock.c: Likewise.
2299         * pthread_mutex_unlock.c: Likewise.
2300         * pthread_rwlock_timedrdlock.c: Likewise.
2301         * pthread_rwlock_timedwrlock.c: Likewise.
2302         * pthread_rwlock_unlock.c: Likewise.
2303         * sysdeps/alpha/tls.h: Likewise.
2304         * sysdeps/i386/tls.h: Likewise.
2305         * sysdeps/ia64/tls.h: Likewise.
2306         * sysdeps/powerpc/tls.h: Likewise.
2307         * sysdeps/pthread/aio_misc.h: Likewise.
2308         * sysdeps/pthread/gai_misc.h: Likewise.
2309         * sysdeps/s390/tls.h: Likewise.
2310         * sysdeps/sh/tls.h: Likewise.
2311         * sysdeps/sparc/tls.h: Likewise.
2312         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2313         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2314         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2315         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2316         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2317         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2318         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2319         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2320         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2321         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2322         Likewise.
2323         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2324         * sysdeps/x86_64/tls.h: Likewise.
2325
2326 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2327
2328         * pthread_getattr_np.c: No need to install a cancellation handler,
2329         this is no cancellation point.
2330         * pthread_getschedparam.c: Likewise.
2331         * pthread_setschedparam.c: Likewise.
2332         * pthread_setschedprio.c: Likewise.
2333         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2334         lll_unlock_wake_cb.
2335         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2336         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2337         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2338         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2339         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2340         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2341         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2342         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2343         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2344         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2345         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2346         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2347
2348         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2349         whether there are more than one thread makes no sense here since
2350         we only call the slow path if the locks are taken.
2351         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2352
2353         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2354         COND_NWAITERS_SHIFT.
2355         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2356         COND_CLOCK_BITS.
2357         * pthread_cond_init.c: Likewise.
2358         * pthread_cond_timedwait.c: Likewise.
2359         * pthread_cond_wait.c: Likewise.
2360         * pthread_condattr_getclock.c: Likewise.
2361         * pthread_condattr_setclock.c: Likewise.
2362         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2363         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2364         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2365         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2366         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2367
2368 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2369
2370         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2371         unistd.h.
2372
2373         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2374         insn suffix.
2375         (THREAD_GSCOPE_GET_FLAG): Remove.
2376         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2377         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2378         changes.
2379         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2380         (THREAD_GSCOPE_GET_FLAG): Remove.
2381         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2382         instead of THREAD_GSCOPE_GET_FLAG.
2383         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2384         it.
2385         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2386         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2387         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2388         THREAD_GSCOPE_WAIT): Define.
2389         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2390         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2391         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2392         THREAD_GSCOPE_WAIT): Define.
2393         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2394         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2395         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2396         THREAD_GSCOPE_WAIT): Define.
2397         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2398         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2399         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2400         THREAD_GSCOPE_WAIT): Define.
2401
2402 2007-05-24  Richard Henderson  <rth@redhat.com>
2403
2404         * descr.h (struct pthread): Add header.gscope_flag.
2405         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2406         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2407         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2408         THREAD_GSCOPE_WAIT): Define.
2409
2410 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2411
2412         * init.c: Make it compile with older kernel headers.
2413
2414         * tst-initializers1.c: Show through exit code which test failed.
2415
2416         * pthread_rwlock_init.c: Also initialize __shared field.
2417         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2418         element in rwlock structure into four byte elements.  One of them is
2419         the new __shared element.
2420         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2421         Likewise.
2422         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2423         __shared, adjust names of other padding elements.
2424         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2425         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2426         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2427         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2428         FUTEX_PRIVATE_FLAG.
2429         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2430         futex to use private operations if possible.
2431         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2432         Likewise.
2433         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2434         Likewise.
2435         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2436         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2437         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2438         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2439         Likewise.
2440         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2441         Likewise.
2442         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2443         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2444
2445 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2446
2447         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2448         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2449         * pthread_rwlock_timedrdlock.c: Likewise.
2450         * pthread_rwlock_tryrdlock.c: Likewise.
2451
2452         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2453         optimization.
2454
2455         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2456         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2457         duplication of __sem_wait_cleanup.
2458
2459         * allocatestack.c: Revert last change.
2460         * init.c: Likewise.
2461         * sysdeps/i386/tls.h: Likewise.
2462         * sysdeps/x86_64/tls.h: Likewise.
2463         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2464         header structure.
2465         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2466
2467         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2468         Add private field.
2469         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2470         * pthread_barrier_init.c: Set private flag if pshared and private
2471         futexes are supported.
2472         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2473         private field in futex command setup.
2474         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2475
2476 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2477
2478         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2479         support.
2480         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2481         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2482         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2483         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2484         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2485
2486         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2487         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2488         fields in the structure.
2489         (__old_sem_init): New function.
2490         * sem_open.c: Initialize all fields of the structure.
2491         * sem_getvalue.c: Adjust for renamed element.
2492         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2493         (gen-as-const-headers): Add structsem.sym.
2494         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2495         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2496         struct new_sem.  Add struct old_sem.
2497         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2498         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2499         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2500         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2501         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2502         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2503         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2504         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2505         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2506         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2507         * tst-sem10.c: New file.
2508         * tst-sem11.c: New file.
2509         * tst-sem12.c: New file.
2510         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2511         of struct sem.
2512
2513 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2514             Jakub Jelinek  <jakub@redhat.com>
2515
2516         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2517         Move __pthread_enable_asynccancel right before futex syscall.
2518         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2519         Likewise.
2520
2521 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2522
2523         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2524         THREAD_COPY_PRIVATE_FUTEX): Define.
2525         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2526         THREAD_COPY_PRIVATE_FUTEX): Define.
2527         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2528         * init.c (__pthread_initialize_minimal_internal): Use
2529         THREAD_SET_PRIVATE_FUTEX.
2530
2531         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2532         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2533         THREAD_GSCOPE_FLAG_WAIT): Define.
2534         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2535         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2536         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2537         PTR_DEMANGLE.
2538         (THREAD_GSCOPE_GET_FLAG): Define.
2539         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2540         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2541         instead of ->header.gscope_flag directly.
2542
2543 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2544
2545         * init.c (__pthread_initialize_minimal_internal): Check whether
2546         private futexes are available.
2547         * allocatestack.c (allocate_stack): Copy private_futex field from
2548         current thread into the new stack.
2549         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2550         futexes if they are available.
2551         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2552         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2553         in libc-lowlevellock.S allow using private futexes.
2554         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2555         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2556         FUTEX_PRIVATE_FLAG.
2557         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2558         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2559         if they are available.
2560         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2561         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2562         * sysdeps/i386/tcb-offsets.sym: Likewise.
2563         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2564         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2565
2566 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2567
2568         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2569         Remove ptr_wait_lookup_done again.
2570         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2571         (__pthread_initialize_minimal_internal): Initialize
2572         _dl_wait_lookup_done pointer in _rtld_global directly.
2573         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2574         Remove code to code _dl_wait_lookup_done.
2575         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2576         encrypted for now.
2577
2578 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2579
2580         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2581         pthread_mutex_init failed with ENOTSUP.
2582
2583 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2584
2585         * allocatestack.c (__wait_lookup_done): New function.
2586         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2587         Add ptr_wait_lookup_done.
2588         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2589         * pthreadP.h: Declare __wait_lookup_done.
2590         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2591         Define macros to implement reference handling of global scope.
2592         * sysdeps/x86_64/tls.h: Likewise.
2593         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2594         Initialize GL(dl_wait_lookup_done).
2595
2596 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2597
2598         [BZ #4512]
2599         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2600         is detected.
2601         * pthread_mutex_timedlock.c: Likewise.
2602         * pthread_mutex_trylock.c: Likewise.
2603         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2604
2605         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2606         * tst-robust9.c: New file.
2607         * tst-robustpi9.c: New file.
2608
2609         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2610         unnecessary extra cancellation test.
2611
2612 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2613
2614         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2615         extra cancellation test.
2616         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2617
2618 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2619
2620         * descr.h (struct pthread): Rearrange members to fill hole in
2621         64-bit layout.
2622
2623         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2624         (__pthread_setaffinity_new): If syscall was successful and
2625         RESET_VGETCPU_CACHE is defined, use it before returning.
2626         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2627
2628 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2629
2630         [BZ #4455]
2631         * tst-align2.c: Include stackinfo.h.
2632         * tst-getpid1.c: Likewise.
2633
2634 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2635
2636         [BZ #4455]
2637         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2638         * tst-getpid1.c (do_test): Likewise.
2639
2640         [BZ #4456]
2641         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2642         (allocate_stack): Likewise.
2643
2644 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2645
2646         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2647         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2648         (__lll_robust_timedlock_wait): Likewise.
2649         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2650
2651 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2652
2653         [BZ #4465]
2654         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2655         * tst-cancel4.c (tf_fdatasync): New test.
2656
2657 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2658
2659         [BZ #4392]
2660         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2661         check mutexes like normal mutexes.
2662
2663         [BZ #4306]
2664         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2665         Initialize the whole sigevent structure to appease valgrind.
2666
2667 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2668
2669         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2670         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2671
2672 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2673
2674         * tst-locale1.c: Avoid warnings.
2675         * tst-locale2.c: Likewise.
2676
2677 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2678
2679         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2680         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2681
2682 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2683
2684         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2685         __extern_always_inline where appropriate.
2686         * sysdeps/pthread/pthread.h: Likewise.
2687
2688 2007-03-13  Richard Henderson  <rth@redhat.com>
2689
2690         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2691         separate cfi regions for the two subsections.
2692
2693 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2694
2695         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2696         new thread, don't just decrement it.
2697         Patch by Suzuki K P <suzuki@in.ibm.com>.
2698
2699 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2700
2701         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2702         PTHFCT_CALL definition.
2703
2704 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2705
2706         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2707         available, don't use it.
2708
2709 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2710
2711         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2712         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2713         call into the kernel to delay.
2714
2715 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2716
2717         * tst-initializers1.c: We want to test the initializers as seen
2718         outside of libc, so undefined _LIBC.
2719
2720         * pthread_join.c (cleanup): Avoid warning.
2721
2722 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2723
2724         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2725         (__lll_timedwait_tid): Add unwind info.
2726
2727         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2728         function table, mangle the pointers.
2729         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2730         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2731         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2732         demangle pointers before use.
2733         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2734         demangle pointer.
2735         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2736         * sysdeps/pthread/setxid.h: Likewise.
2737
2738 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2739
2740         * tst-rwlock7.c: Show some more information in case of correct
2741         behavior.
2742
2743 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2744
2745         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2746         (lll_futex_timed_wait): Undo part of last change, don't negate
2747         return value.
2748
2749 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2750
2751         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2752         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2753
2754 2006-12-28  David S. Miller  <davem@davemloft.net>
2755
2756         * shlib-versions: Fix sparc64 linux target specification.
2757
2758 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2759
2760         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2761         Adjust include path for pthread_barrier_wait.c move.
2762
2763 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2764
2765         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2766         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2767
2768 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2769
2770         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2771         6 argument cancellable syscalls.
2772         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2773         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2774         6 argument cancellable syscalls.
2775         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2776
2777 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2778
2779         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2780         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2781
2782 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2783
2784         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2785         __sync_lock_release instead of __sync_lock_release_si.
2786
2787 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2788
2789         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2790         Define.
2791         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2792         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2793         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2794         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2795         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2796         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2797         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2798         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2799         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2800         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2801         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2802
2803 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2804
2805         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2806         * pthread_barrier_wait.c: ...here.
2807         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2808         * pthread_cond_broadcast.c: ...here.
2809         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2810         * pthread_cond_signal.c: ...here.
2811         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2812         * pthread_cond_timedwait.c: ...here.
2813         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2814         * pthread_cond_wait.c: ...here.
2815         * sysdeps/pthread/pthread_once.c: Move to...
2816         * pthread_once.c: ...here.
2817         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2818         * pthread_rwlock_rdlock.c: ...here.
2819         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2820         * pthread_rwlock_timedrdlock.c: ...here.
2821         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2822         * pthread_rwlock_timedwrlock.c: ...here.
2823         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2824         * pthread_rwlock_unlock.c: ...here.
2825         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2826         * pthread_rwlock_wrlock.c: ...here.
2827         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2828         * pthread_spin_destroy.c: ...here.
2829         * sysdeps/pthread/pthread_spin_init.c: Move to...
2830         * pthread_spin_init.c: ...here.
2831         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2832         * pthread_spin_unlock.c: ...here.
2833         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2834         * pthread_getcpuclockid.c: ...here.
2835
2836         * init.c: USE_TLS support is now always enabled.
2837         * tst-tls5.h: Likewise.
2838         * sysdeps/alpha/tls.h: Likewise.
2839         * sysdeps/i386/tls.h: Likewise.
2840         * sysdeps/ia64/tls.h: Likewise.
2841         * sysdeps/powerpc/tls.h: Likewise.
2842         * sysdeps/s390/tls.h: Likewise.
2843         * sysdeps/sh/tls.h: Likewise.
2844         * sysdeps/sparc/tls.h: Likewise.
2845         * sysdeps/x86_64/tls.h: Likewise.
2846
2847 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2848
2849         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2850         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2851         failed.
2852
2853         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2854         Define to THREAD_SELF->header.multiple_threads.
2855         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2856         Likewise.
2857         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2858         Likewise.
2859         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2860         (SINGLE_THREAD_P): Likewise.
2861         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2862         (SINGLE_THREAD_P): Likewise.
2863         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2864         (SINGLE_THREAD_P): Likewise.
2865         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2866         (SINGLE_THREAD_P): Likewise.
2867         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2868         Likewise.
2869         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2870         (SINGLE_THREAD_P): Likewise.
2871         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2872         (SINGLE_THREAD_P): Likewise.
2873         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2874         Likewise.
2875
2876 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2877
2878         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2879         by default rather than 2_3_3.
2880
2881 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2882
2883         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2884         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2885         atomic_* instead of catomic_* macros.
2886
2887 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2888
2889         [BZ #3285]
2890         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2891         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2892         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2893         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2894         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2895         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2896         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2897         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2898         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2899         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2900         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2901         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2902         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2903
2904 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2905
2906         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2907         cancelable syscalls with six parameters.
2908
2909         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2910         operations instead of atomic_*.
2911
2912 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2913
2914         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2915
2916 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2917
2918         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2919         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2920         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2921         New file.
2922         * pthread_attr_setstack.c: Allow overwriting the version number of the
2923         new symbol.
2924         * pthread_attr_setstacksize.c: Likewise.
2925         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2926         it.
2927         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2928         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2929
2930 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2931
2932         [BZ #3251]
2933         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2934         Patch by Petr Baudis.
2935
2936 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2937
2938         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2939
2940         * tst-cancel2.c (tf): Loop as long as something was written.
2941
2942 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2943
2944         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2945         mutexes wake all mutexes.
2946         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2947         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2948         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2949
2950 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2951
2952         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2953         to guarantee the thread is always canceled.
2954
2955 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2956
2957         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2958         Include stdlib.h.
2959         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2960         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2961         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2962         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2963         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2964
2965 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2966
2967         [BZ #3123]
2968         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2969         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2970         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2971         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2972         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2973         * Makefile (tests): Add tst-cond22.
2974         * tst-cond22.c: New file.
2975
2976 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2977
2978         [BZ #3124]
2979         * descr.h (struct pthread): Add parent_cancelhandling.
2980         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2981         cancelhandling value to child.
2982         * pthread_create.c (start_thread): If parent thread was canceled
2983         reset the SIGCANCEL mask.
2984         * Makefile (tests): Add tst-cancel25.
2985         * tst-cancel25.c: New file.
2986
2987 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2988             Ulrich Drepper  <drepper@redhat.com>
2989
2990         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2991         counterp if it is already zero.
2992         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2993
2994 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2995             Roland McGrath  <roland@redhat.com>
2996
2997         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2998         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2999         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
3000         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
3001         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
3002         lll_robust_mutex_timedlock, lll_mutex_unlock,
3003         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
3004         Add _L_*_ symbols around the subsection.
3005         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
3006         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
3007
3008 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
3009             Roland McGrath  <roland@redhat.com>
3010
3011         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3012         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
3013         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
3014         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
3015         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
3016         lll_robust_mutex_timedlock, lll_mutex_unlock,
3017         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
3018         Add _L_*_ symbols around the subsection.
3019         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
3020         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
3021
3022 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
3023
3024         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
3025         change because it can disturb too much existing code.  If real hard
3026         reader preference is needed we'll introduce another type.
3027         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3028         (pthread_rwlock_timedwrlock): Likewise.
3029         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
3030         Likewise.
3031
3032 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
3033
3034         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
3035         reader preference.
3036         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
3037         (pthread_rwlock_timedwrlock): Likewise.
3038         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
3039         Likewise.
3040
3041 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
3042
3043         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
3044         Only define ifdef SHARED.
3045
3046 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
3047
3048         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
3049         (free_stacks): ...here.
3050         (__free_stack_cache): New function.
3051         * pthreadP.h: Declare __free_stack_cache.
3052         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
3053         ptr_freeres.
3054         * init.c (pthread_functions): Initialize ptr_freeres.
3055         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
3056         New freeres function.
3057
3058 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
3059
3060         [BZ #3018]
3061         * Makefile (extra-objs): Add modules to extra-test-objs instead.
3062
3063 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
3064
3065         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3066         _XOPEN_REALTIME_THREADS.
3067
3068 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
3069
3070         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
3071         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
3072         HAVE_CLOCK_GETTIME_VSYSCALL.
3073         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
3074
3075 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
3076
3077         * sysdeps/unix/sysv/linux/bits/posix_opt.h
3078         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
3079         * descr.h (struct priority_protection_data): New type.
3080         (struct pthread): Add tpp field.
3081         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
3082         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
3083         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
3084         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
3085         TPP mutexes.
3086         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
3087         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
3088         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
3089         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
3090         * tpp.c: New file.
3091         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
3092         boosted by TPP.
3093         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
3094         * pthread_mutexattr_getprioceiling.c
3095         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
3096         in the SCHED_FIFO priority range.
3097         * pthread_mutexattr_setprioceiling.c
3098         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
3099         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
3100         if mutex is not TPP.  Ceiling is now in __data.__lock.
3101         * pthread_mutex_setprioceiling.c: Include stdbool.h.
3102         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
3103         is now in __data.__lock.  Add locking.
3104         * pthread_create.c (__free_tcb): Free pd->tpp structure.
3105         * Makefile (libpthread-routines): Add tpp.
3106         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
3107         * tst-tpp.h: New file.
3108         * tst-mutexpp1.c: New file.
3109         * tst-mutexpp6.c: New file.
3110         * tst-mutexpp10.c: New file.
3111         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
3112         * tst-mutex6.c (TEST_FUNCTION): Likewise.
3113
3114 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
3115
3116         [BZ #2843]
3117         * pthread_join.c (pthread_join): Account for self being canceled
3118         when checking for deadlocks.
3119         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
3120         (tf1): Don't print anything after pthread_join returns, this would be
3121         another cancellation point.
3122         (tf2): Likewise.
3123         * tst-join6.c: New file.
3124         * Makefile (tests): Add tst-join6.
3125
3126 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
3127
3128         [BZ #2892]
3129         * pthread_setspecific.c (__pthread_setspecific): Check
3130         out-of-range index before checking for unused key.
3131
3132         * sysdeps/pthread/gai_misc.h: New file.
3133
3134 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
3135
3136         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
3137         file.  Don't use sysctl.
3138         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
3139         overwrite the file if this is likely not true.
3140
3141 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
3142
3143         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
3144         * Makefile (tests): Add tst-getpid3.
3145         * tst-getpid3.c: New file.
3146
3147 2006-07-30  Roland McGrath  <roland@redhat.com>
3148
3149         * Makefile (libpthread-routines): Add ptw-sigsuspend.
3150
3151         * sysdeps/unix/sysv/linux/i386/not-cancel.h
3152         (pause_not_cancel): New macro.
3153         (nanosleep_not_cancel): New macro.
3154         (sigsuspend_not_cancel): New macro.
3155         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
3156         nanosleep_not_cancel macro from <not-cancel.h>.
3157         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
3158         macro from <not-cancel.h>.
3159
3160 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
3161             Jakub Jelinek  <jakub@redhat.com>
3162
3163         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
3164         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
3165         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
3166         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
3167         * pthread_mutex_init.c: Add support for priority inheritance mutex.
3168         * pthread_mutex_lock.c: Likewise.
3169         * pthread_mutex_timedlock.c: Likewise.
3170         * pthread_mutex_trylock.c: Likewise.
3171         * pthread_mutex_unlock.c: Likewise.
3172         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
3173         all mutexes.
3174         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
3175         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
3176         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
3177         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
3178         pthread-pi-defines.sym.
3179         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
3180         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
3181         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3182         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
3183         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3184         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3185         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3186         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
3187         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3188         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3189         _POSIX_THREAD_PRIO_INHERIT to 200112L.
3190         * tst-mutex1.c: Adjust to allow use in PI mutex test.
3191         * tst-mutex2.c: Likewise.
3192         * tst-mutex3.c: Likewise.
3193         * tst-mutex4.c: Likewise.
3194         * tst-mutex5.c: Likewise.
3195         * tst-mutex6.c: Likewise.
3196         * tst-mutex7.c: Likewise.
3197         * tst-mutex7a.c: Likewise.
3198         * tst-mutex8.c: Likewise.
3199         * tst-mutex9.c: Likewise.
3200         * tst-robust1.c: Likewise.
3201         * tst-robust7.c: Likewise.
3202         * tst-robust8.c: Likewise.
3203         * tst-mutexpi1.c: New file.
3204         * tst-mutexpi2.c: New file.
3205         * tst-mutexpi3.c: New file.
3206         * tst-mutexpi4.c: New file.
3207         * tst-mutexpi5.c: New file.
3208         * tst-mutexpi6.c: New file.
3209         * tst-mutexpi7.c: New file.
3210         * tst-mutexpi7a.c: New file.
3211         * tst-mutexpi8.c: New file.
3212         * tst-mutexpi9.c: New file.
3213         * tst-robust1.c: New file.
3214         * tst-robust2.c: New file.
3215         * tst-robust3.c: New file.
3216         * tst-robust4.c: New file.
3217         * tst-robust5.c: New file.
3218         * tst-robust6.c: New file.
3219         * tst-robust7.c: New file.
3220         * tst-robust8.c: New file.
3221         * Makefile (tests): Add the new tests.
3222
3223         * pthread_create.c (start_thread): Add some casts to avoid warnings.
3224         * pthread_mutex_destroy.c: Remove unneeded label.
3225
3226 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
3227
3228         * pthread_mutex_init.c (__pthread_mutex_init): Move some
3229         computations to compile time.
3230
3231 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
3232
3233         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
3234
3235 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
3236
3237         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
3238
3239 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
3240
3241         * pthread_key_create.c (__pthread_key_create): Do away with
3242         __pthread_keys_lock.
3243
3244         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3245         (__kernel_cpumask_size): Mark as hidden.
3246         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3247
3248         * sem_open.c (__sem_mappings_lock): Mark as hidden.
3249         * semaphoreP.h (__sem_mappings_lock): Likewise.
3250
3251 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
3252
3253         * pthread_atfork.c: Mark __dso_handle as hidden.
3254
3255 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
3256
3257         [BZ #2644]
3258         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
3259         the reload problem.  Change the one path in pthread_cancel_init
3260         which causes the problem.  Force gcc to reload.  Simplify callers.
3261         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
3262         (_Unwind_GetBSP): Undo last patch.
3263
3264 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3265
3266         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
3267         function pointer is reloaded after pthread_cancel_init calls.
3268
3269         [BZ #2644]
3270         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
3271         pointers are reloaded after pthread_cancel_init calls.
3272
3273 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
3274
3275         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
3276         __always_inline.
3277
3278 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3279
3280         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3281         Allocate new object which is passed to timer_sigev_thread so that
3282         the timer can be deleted before the new thread is scheduled.
3283
3284 2006-04-26  Roland McGrath  <roland@redhat.com>
3285
3286         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3287
3288 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3289
3290         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3291         suffix for conditional jumps.
3292         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3293         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3294         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3295         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3296         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3297         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3298
3299         * init.c (sigcancel_handler): Compare with correct PID even if the
3300         thread is in the middle of a fork call.
3301         (sighandler_setxid): Likewise.
3302         Reported by Suzuki K P <suzuki@in.ibm.com> .
3303
3304 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3305
3306         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3307
3308 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3309
3310         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3311         fails [Coverity CID 105].
3312
3313 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3314
3315         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3316
3317 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3318
3319         [BZ #2505]
3320         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3321         Define __lll_rel_instr using lwsync.
3322
3323 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3324
3325         * allocatestack.c (allocate_stack): Always initialize robust_head.
3326         * descr.h: Define struct robust_list_head.
3327         (struct pthread): Use robust_list_head in robust mutex list definition.
3328         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3329         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3330         (__pthread_initialize_minimal_internal): Register robust_list with
3331         the kernel.
3332         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3333         Declare __set_robust_list_avail.
3334         * pthread_create.c (start_thread): Register robust_list of new thread.
3335         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3336         waiters.
3337         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3338         number of users, it's unreliable.
3339         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3340         set_robust_list syscall is available.
3341         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3342         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3343         Set robust_head.list_op_pending before trying to lock a robust mutex.
3344         * pthread_mutex_timedlock.c: Likewise.
3345         * pthread_mutex_trylock.c: Likewise.
3346         * pthread_mutex_unlock.c: Likewise for unlocking.
3347         * Makefile (tests): Add tst-robust8.
3348         * tst-robust8.c: New file.
3349
3350 2006-03-08  Andreas Schwab  <schwab@suse.de>
3351
3352         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3353         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3354
3355 2006-03-05  Roland McGrath  <roland@redhat.com>
3356
3357         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3358         and $config_os doesn't match *linux*.
3359
3360 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3361
3362         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3363         Use __syscall_error.
3364         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3365         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3366         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3367         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3368         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3369         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3370
3371 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3372
3373         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3374
3375 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3376
3377         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3378         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3379         mutex.
3380         (__lll_robust_timedlock_wait): Likewise.
3381         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3382         (__lll_robust_lock_wait): Likewise.
3383         (__lll_robust_timedlock_wait): Likewise.
3384         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3385         (__lll_robust_lock_wait): Likewise.
3386         (__lll_robust_timedlock_wait): Likewise.
3387
3388 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3389
3390         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3391         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3392         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3393         lll_robust_mutex_unlock): Define.
3394         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3395
3396 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3397
3398         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3399         instead of <clone.S>.
3400
3401 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3402
3403         * Makefile (libpthread-routines): Add
3404         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3405         and pthread_mutex_[sg]etprioceiling.
3406         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3407         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3408         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3409         pthread_mutex_setprioceiling.
3410         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3411         PTHREAD_PRIO_PROTECT): New enum values.
3412         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3413         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3414         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3415         prototypes.
3416         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3417         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3418         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3419         Define.
3420         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3421         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3422         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3423         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3424         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3425         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3426         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3427         protocol mutexes.
3428         * pthread_mutex_getprioceiling.c: New file.
3429         * pthread_mutex_setprioceiling.c: New file.
3430         * pthread_mutexattr_getprioceiling.c: New file.
3431         * pthread_mutexattr_setprioceiling.c: New file.
3432         * pthread_mutexattr_getprotocol.c: New file.
3433         * pthread_mutexattr_setprotocol.c: New file.
3434
3435 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3436
3437         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3438
3439 2006-02-27  Roland McGrath  <roland@redhat.com>
3440
3441         * sysdeps/pthread/Subdirs: List nptl here too.
3442         * configure (libc_add_on_canonical): New variable.
3443
3444         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3445
3446         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3447         self to get main source tree's file.
3448         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3449         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3450         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3451         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3452         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3453         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3454         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3455         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3456         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3457         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3458         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3459         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3460         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3461
3462         * Makefile: Use $(sysdirs) in vpath directive.
3463
3464         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3465         (CPPFLAGS-timer_routines.c): Likewise.
3466
3467         * Makeconfig (includes): Variable removed.
3468
3469 2006-02-26  Roland McGrath  <roland@redhat.com>
3470
3471         * sysdeps/generic/pt-raise.c: Moved to ...
3472         * pt-raise.c: ... here.
3473         * sysdeps/generic/lowlevellock.h: Moved to ...
3474         * lowlevellock.h: ... here.
3475
3476 2006-02-23  Roland McGrath  <roland@redhat.com>
3477
3478         * descr.h (struct pthread): Add final member `end_padding'.
3479         (PTHREAD_STRUCT_END_PADDING): Use it.
3480
3481 2006-02-20  Roland McGrath  <roland@redhat.com>
3482
3483         * sysdeps/mips: Directory removed, saved in ports repository.
3484         * sysdeps/unix/sysv/linux/mips: Likewise.
3485
3486 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3487
3488         * tst-robust1.c: Add second mutex to check that the mutex list is
3489         handled correctly.
3490
3491 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3492
3493         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3494         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3495         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3496         lll_robust_mutex_unlock): New macros.
3497         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3498         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3499         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3500         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3501         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3502
3503 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3504
3505         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3506         definitions.
3507         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3508
3509 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3510
3511         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3512         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3513         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3514         (lll_robust_mutex_unlock): Likewise.
3515
3516 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3517
3518         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3519         Set robust_list.__next rather than robust_list.
3520         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3521         (__pthread_list_t): New typedef.
3522         (pthread_mutex_t): Replace __next and __prev fields with __list.
3523         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3524         (__pthread_list_t): New typedef.
3525         (pthread_mutex_t): Replace __next and __prev fields with __list.
3526         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3527         (__pthread_list_t, __pthread_slist_t): New typedefs.
3528         (pthread_mutex_t): Replace __next and __prev fields with __list.
3529         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
3530         (__pthread_list_t, __pthread_slist_t): New typedefs.
3531         (pthread_mutex_t): Replace __next and __prev fields with __list.
3532         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3533         (__pthread_list_t, __pthread_slist_t): New typedefs.
3534         (pthread_mutex_t): Replace __next and __prev fields with __list.
3535         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3536         (__pthread_slist_t): New typedef.
3537         (pthread_mutex_t): Replace __next field with __list.
3538
3539 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3540
3541         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3542         PTHREAD_MUTEX_OWNERDEAD.
3543         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3544         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3545         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3546         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3547         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3548         to PTHREAD_MUTEX_INCONSISTENT.
3549         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3550         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3551         * pthread_mutex_trylock.c: Likewise.
3552         * pthread_mutex_timedlock.c: Likewise.
3553         * pthread_mutex_unlock.c: Likewise.
3554         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3555         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3556         lowlevelrobustlock.sym.
3557         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3558         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3559         definitions.
3560         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3561         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3562         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3563         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3564         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3565
3566 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3567
3568         * allocatestack.c (allocate_stack): Initialize robust_list.
3569         * init.c (__pthread_initialize_minimal_internal): Likewise.
3570         * descr.h (struct xid_command): Pretty printing.
3571         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3572         robust_list.  Adjust macros.
3573         * pthread_create.c (start_thread): Adjust robust_list handling.
3574         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3575         but the owner for all robust mutex types.
3576         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3577         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3578         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3579         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3580
3581         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3582         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3583
3584 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3585
3586         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3587         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3588
3589 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3590
3591         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3592         Return status.
3593         (lll_futex_timed_wait): Define.
3594
3595 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3596
3597         * tst-cancel4.c: Test ppoll.
3598
3599 2006-01-18  Andreas Jaeger  <aj@suse.de>
3600
3601         [BZ #2167]
3602         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3603         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3604         by Jim Gifford <patches@jg555.com>.
3605
3606 2006-01-13  Richard Henderson  <rth@redhat.com>
3607
3608         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3609
3610 2006-01-10  Roland McGrath  <roland@redhat.com>
3611
3612         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3613         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3614         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3615         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3616         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3617         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3618         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3619         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3620         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3621         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3622
3623 2006-01-09  Roland McGrath  <roland@redhat.com>
3624
3625         * tst-initializers1-c89.c: New file.
3626         * tst-initializers1-c99.c: New file.
3627         * tst-initializers1-gnu89.c: New file.
3628         * tst-initializers1-gnu99.c: New file.
3629         * Makefile (tests): Add them.
3630         (CFLAGS-tst-initializers1-c89.c): New variable.
3631         (CFLAGS-tst-initializers1-c99.c): New variable.
3632         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3633         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3634
3635         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3636         Use __extension__ on anonymous union definition.
3637         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3638         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3639         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3640         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3641         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3642
3643 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3644
3645         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3646         Don't give the union a name because it changes the mangled name.
3647         Instead name the struct for __data.
3648         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3649         Likewise.
3650         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3651         Likewise.
3652
3653 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3654
3655         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3656         stack bias to mc_ftp field.
3657
3658 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3659
3660         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3661         being too clever and reloading the futex value where it shouldn't.
3662
3663 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3664
3665         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3666         correct type.
3667
3668 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3669
3670         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3671         Add cfi directives.
3672
3673 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3674
3675         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3676         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3677         rename in tcbhead_t.
3678
3679         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3680         Don't give the union a name because it changes the mangled name.
3681         Instead name the struct for __data.
3682         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3683         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3684         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3685         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3686         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3687         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3688
3689 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3690
3691         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3692         Return status.
3693         (lll_futex_timed_wait): Define.
3694         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3695         * sysdeps/pthread/aio_misc.h: New file.
3696
3697 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3698
3699         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3700
3701 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3702
3703         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3704         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3705         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3706
3707 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3708
3709         * tst-cancel24.cc: Use C headers instead of C++ headers.
3710
3711 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3712
3713         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3714         sparc-linux configured glibc.
3715         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3716         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3717         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3718         atomic_compare_and_exchange_val_24_acq instead of
3719         atomic_compare_and_exchange_val_acq.
3720         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3721         instead of atomic_exchange_rel.
3722         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3723         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3724         file.
3725         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3726         file.
3727         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3728         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3729         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3730         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3731         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3732         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3733         New file.
3734         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3735         New file.
3736         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3737         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3738         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3739         file.
3740         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3741         file.
3742         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3743
3744 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3745
3746         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3747         mutex initializers.
3748
3749 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3750
3751         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3752         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3753         THREAD_COPY_POINTER_GUARD): Define.
3754         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3755         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3756
3757 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3758
3759         * version.c: Update copyright year.
3760
3761 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3762
3763         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3764         .eh_frame section, use cfi_* directives.
3765         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3766
3767 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3768
3769         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3770         now.
3771
3772 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3773
3774         * sysdeps/pthread/sigaction.c: Removed.
3775         * sigaction.c: New file.
3776         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3777
3778 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3779
3780         * Makefile (tests): Add tst-signal7.
3781         * tst-signal7.c: New file.
3782
3783 2005-12-27  Roland McGrath  <roland@redhat.com>
3784
3785         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3786         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3787         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3788         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3789         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3790         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3791         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3792         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3793         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3794         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3795         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3796
3797 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3798
3799         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3800         and __prev field to pthread_mutex_t.
3801         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3802         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3803         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3804         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3805         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3806         to pthread_mutex_t.
3807
3808 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3809
3810         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3811         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3812         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3813         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3814         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3815         and PTHREAD_MUTEXATTR_FLAG_BITS.
3816         * descr.h (struct pthread): Add robust_list field and define
3817         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3818         * pthread_mutexattr_getrobust.c: New file.
3819         * pthread_mutexattr_setrobust.c: New file.
3820         * pthread_mutex_consistent.c: New file.
3821         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3822         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3823         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3824         Adjust pthread_mutex_t initializers.
3825         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3826         field to pthread_mutex_t.
3827         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3828         and __prev field to pthread_mutex_t.
3829         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3830         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3831         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3832         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3833         * pthread_mutexattr_gettype.c: Likewise.
3834         * pthread_mutexattr_setpshared.c: Likewise.
3835         * pthread_mutexattr_settype.c: Likewise.
3836         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3837         Initialize mutex kind according to robust flag.
3838         * pthread_mutex_lock.c: Implement local robust mutex.
3839         * pthread_mutex_timedlock.c: Likewise.
3840         * pthread_mutex_trylock.c: Likewise.
3841         * pthread_mutex_unlock.c: Likewise.
3842         * pthread_create.c (start_thread): Mark robust mutexes which remained
3843         locked as dead.
3844         * tst-robust1.c: New file.
3845         * tst-robust2.c: New file.
3846         * tst-robust3.c: New file.
3847         * tst-robust4.c: New file.
3848         * tst-robust5.c: New file.
3849         * tst-robust6.c: New file.
3850         * tst-robust7.c: New file.
3851         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3852         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3853         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3854         tst-robust5, tst-robust6, and tst-robust7.
3855
3856         * tst-typesizes.c: New file.
3857         * Makefile (tests): Add tst-typesizes.
3858
3859         * tst-once3.c: More debug output.
3860
3861 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3862
3863         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3864         missing after last change.
3865
3866         * version.c: Update copyright year.
3867
3868 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3869
3870         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3871         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3872         * pthread_mutex_trylock.c: Likewise.
3873         * pthread_mutex_timedlock.c: Likewise.
3874         * pthread_mutex_unlock.c: Likewise.
3875
3876 2005-12-22  Roland McGrath  <roland@redhat.com>
3877
3878         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3879         so that #include_next's search location is not reset to the -I..
3880         directory where <nptl/...> can be found.
3881
3882 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3883
3884         [BZ #1913]
3885         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3886         Fix unwind info.  Remove useless branch prediction prefix.
3887         * tst-cancel24.cc: New file.
3888         * Makefile: Add rules to build and run tst-cancel24.
3889
3890 2005-12-21  Roland McGrath  <roland@redhat.com>
3891
3892         * libc-cancellation.c: Use <> rather than "" #includes.
3893         * pt-cleanup.c: Likewise.
3894         * pthread_create.c: Likewise.
3895         * pthread_join.c: Likewise.
3896         * pthread_timedjoin.c: Likewise.
3897         * pthread_tryjoin.c: Likewise.
3898         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3899         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3900         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3901         * unwind.c: Likewise.
3902
3903 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3904
3905         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3906         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3907         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3908         THREAD_COPY_POINTER_GUARD): Define.
3909
3910 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3911
3912         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3913         rather than one.
3914         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3915         THREAD_COPY_POINTER_GUARD): Define.
3916         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3917         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3918         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3919         THREAD_COPY_POINTER_GUARD): Define.
3920         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3921         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3922         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3923         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3924         Use PTR_DEMANGLE for B0 if defined.
3925
3926 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3927
3928         * pthread_create.c (__pthread_create_2_1): Use
3929         THREAD_COPY_POINTER_GUARD if available.
3930         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3931         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3932         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3933         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3934         * sysdeps/x86_64/tls.h: Likewise.
3935
3936 2005-12-15  Roland McGrath  <roland@redhat.com>
3937
3938         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3939
3940 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3941
3942         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3943         sysdeps/generic.
3944         * errno-loc.c: New file.
3945
3946 2005-12-12  Roland McGrath  <roland@redhat.com>
3947
3948         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3949         adjustments before choosing stack size.  Update minimum stack size
3950         calculation to match allocate_stack change.
3951
3952 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3953
3954         * allocatestack.c (allocate_stack): Don't demand that there is an
3955         additional full page available on the stack beside guard, TLS, the
3956         minimum stack.
3957
3958 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3959
3960         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3961         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3962
3963         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3964         compiling 32-bit code we must define __cleanup_fct_attribute.
3965
3966 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3967
3968         [BZ #1920]
3969         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3970         __attribute__ instead of __attribute.
3971         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3972         (__cleanup_fct_attribute): Likewise.
3973
3974 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3975
3976         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3977         a write barrier before writing libgcc_s_getcfa.
3978
3979 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3980
3981         * sysdeps/unix/sysv/linux/configure: Removed.
3982
3983 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3984
3985         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3986         optional init_array/fini_array support.
3987
3988 2005-10-24  Roland McGrath  <roland@redhat.com>
3989
3990         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3991         versioned_symbol use.
3992
3993 2005-10-16  Roland McGrath  <roland@redhat.com>
3994
3995         * init.c (__pthread_initialize_minimal_internal): Even when using a
3996         compile-time default stack size, apply the minimum that allocate_stack
3997         will require, and round up to page size.
3998
3999 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
4000
4001         * Makefile ($(test-modules)): Remove static pattern rule.
4002
4003 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
4004             Ulrich Drepper  <drepper@redhat.com>
4005
4006         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
4007         alignment in callback function.
4008         * Makefile: Add rules to build and run tst-align3.
4009         * tst-align3.c: New file.
4010
4011 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
4012
4013         * allocatestack.c (setxid_signal_thread): Add
4014         INTERNAL_SYSCALL_DECL (err).
4015
4016 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
4017
4018         * allocatestack.c (setxid_signal_thread): Need to use
4019         atomic_compare_and_exchange_bool_acq.
4020
4021 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
4022             Jakub Jelinek  <jakub@redhat.com>
4023
4024         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
4025         CANCEL_RESTMASK.
4026         (struct pthread): Move specific_used field to avoid padding.
4027         Add setxid_futex field.
4028         * init.c (sighandler_setxid): Reset setxid flag and release the
4029         setxid futex.
4030         * allocatestack.c (setxid_signal_thread): New function.  Broken
4031         out of the bodies of the two loops in __nptl_setxid.  For undetached
4032         threads check whether they are exiting and if yes, don't send a signal.
4033         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
4034         * pthread_create.c (start_thread): For undetached threads, check
4035         whether setxid bit is set.  If yes, wait until signal has been
4036         processed.
4037
4038         * allocatestack.c (STACK_VARIABLES): Initialize them.
4039         * pthread_create.c (__pthread_create_2_1): Initialize pd.
4040
4041 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
4042
4043         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
4044         waiters, awake all waiters on the associated mutex.
4045
4046 2005-09-22  Roland McGrath  <roland@redhat.com>
4047
4048         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
4049         ../sysdeps/x86_64/hp-timing.h).
4050
4051 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
4052
4053         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
4054         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4055         (lll_futex_wake_unlock): Define.
4056         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
4057         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4058         (lll_futex_wake_unlock): Define.
4059         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
4060         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4061         (lll_futex_wake_unlock): Define.
4062         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
4063         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4064         (lll_futex_wake_unlock): Define.
4065         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
4066         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4067         (lll_futex_wake_unlock): Define.
4068         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
4069         lll_futex_wake_unlock.
4070         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4071         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4072         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
4073         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4074         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
4075         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
4076
4077 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4078
4079         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4080         Fix typo in register name.
4081
4082 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
4083
4084         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4085         Use __sigfillset.  Document that sigfillset does the right thing wrt
4086         to SIGSETXID.
4087
4088 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
4089
4090         [BZ #1102]
4091         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
4092         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
4093         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
4094         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
4095         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
4096         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
4097         in the structure.
4098         * Makefile (tests): Add tst-initializers1.
4099         (CFLAGS-tst-initializers1.c): Set.
4100         * tst-initializers1.c: New test.
4101
4102 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
4103
4104         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
4105         Make sure __flags are located at offset 48 from the start of the
4106         structure.
4107
4108 2005-07-02  Roland McGrath  <roland@redhat.com>
4109
4110         * Makeconfig: Comment fix.
4111
4112 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
4113
4114         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
4115         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
4116         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
4117         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
4118         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
4119         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4120         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
4121         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
4122         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
4123         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
4124
4125 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
4126
4127         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
4128         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4129         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
4130         fields.
4131         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4132         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
4133         field.  Put in sysinfo field unconditionally.
4134         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4135         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
4136         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4137         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
4138         fields.
4139         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4140         * pthread_create.c (__pthread_create_2_1): Use
4141         THREAD_COPY_STACK_GUARD macro.
4142         * Makefile: Add rules to build and run tst-stackguard1{,-static}
4143         tests.
4144         * tst-stackguard1.c: New file.
4145         * tst-stackguard1-static.c: New file.
4146
4147 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
4148
4149         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
4150         Invoke CGOTSETUP and CGOTRESTORE.
4151         (CGOTSETUP, CGOTRESTORE): Define.
4152
4153 2005-05-29  Richard Henderson  <rth@redhat.com>
4154
4155         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
4156         (tf_write, tf_writev): Use it.
4157         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
4158         the system minimum.
4159
4160 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
4161
4162         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
4163         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
4164         __librt_*_asynccancel@local.
4165
4166 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
4167
4168         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
4169         all occurrences of JUMPTARGET.  Instead append @local to labels.
4170
4171 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
4172
4173         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
4174         size/alignment of struct pthread rather than tcbhead_t.
4175         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4176         Likewise.
4177         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4178         Likewise.
4179         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4180         Likewise.
4181
4182 2005-05-19  Richard Henderson  <rth@redhat.com>
4183
4184         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
4185         __sync_val_compare_and_swap, not explicit _si variant.
4186         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
4187
4188 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
4189
4190         [BZ #915]
4191         * sysdeps/pthread/pthread.h: Avoid empty initializers.
4192
4193 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
4194
4195         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
4196         .eh_frame section, use cfi_* directives.
4197
4198 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
4199
4200         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
4201         of "" includes.
4202
4203 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
4204
4205         [BZ #1075]
4206         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
4207         aio_write blocks.
4208
4209 2005-04-27  Roland McGrath  <roland@redhat.com>
4210
4211         * Makefile (tests): Remove tst-clock2.
4212
4213         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4214         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
4215         translating to the kernel clockid_t for our own process/thread clock.
4216
4217         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
4218
4219 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
4220
4221         * old_pthread_cond_init.c: Include <errno.h>.
4222         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
4223         process shared or uses clock other than CLOCK_REALTIME.
4224         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
4225
4226 2005-04-13  David S. Miller  <davem@davemloft.net>
4227
4228         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
4229         * sysdeps/sparc/sparc64/clone.S: New file.
4230
4231 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4232
4233         [BZ #1102]
4234         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
4235         __inline instead of inline.
4236         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
4237
4238 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
4239
4240         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
4241         functionally equivalent, but shorter instructions.
4242         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4243         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4244         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4245         Likewise.
4246         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
4247         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4248         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4249         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4250         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4251         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4252         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4253         Likewise.
4254         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4255         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4256         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4257         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4258         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4259
4260 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
4261
4262         * sysdeps/mips/Makefile: New file.
4263         * sysdeps/mips/nptl-sysdep.S: New file.
4264         * sysdeps/mips/tcb-offsets.sym: New file.
4265         * sysdeps/mips/pthread_spin_lock.S: New file.
4266         * sysdeps/mips/pthread_spin_trylock.S: New file.
4267         * sysdeps/mips/pthreaddef.h: New file.
4268         * sysdeps/mips/tls.h: New file.
4269         * sysdeps/mips/jmpbuf-unwind.h: New file.
4270         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
4271         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
4272         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
4273         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
4274         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
4275         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
4276         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
4277         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4278         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4279         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4280
4281 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4282
4283         [BZ #1112]
4284         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4285         variable to scerr.
4286
4287 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4288
4289         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4290
4291 2005-02-25  Roland McGrath  <roland@redhat.com>
4292
4293         * alloca_cutoff.c: Correct license text.
4294         * tst-unload.c: Likewise.
4295         * sysdeps/pthread/allocalim.h: Likewise.
4296         * sysdeps/pthread/pt-initfini.c: Likewise.
4297         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4298         * sysdeps/pthread/bits/sigthread.h: Likewise.
4299         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4300         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4301
4302 2005-02-16  Roland McGrath  <roland@redhat.com>
4303
4304         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4305         Use unsigned int * for ptr_nthreads.
4306
4307 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4308
4309         [BZ #721]
4310         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4311         gcc4.
4312
4313 2005-02-07  Richard Henderson  <rth@redhat.com>
4314
4315         [BZ #787]
4316         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4317         argument.
4318
4319 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4320
4321         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4322         order of arguments in invocation of atomic_add_zero.
4323
4324 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4325
4326         [BZ #737]
4327         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4328         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4329         at least gotntpoff relocation and addition.
4330         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4331         Likewise.
4332         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4333         Likewise.
4334         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4335         Likewise.
4336
4337 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4338
4339         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4340         entry for static tls deallocation fix.
4341         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4342         also contains information whether the memory pointed to is static
4343         TLS or not.
4344         * sysdeps/i386/tls.h: Likewise.
4345         * sysdeps/ia64/tls.h: Likewise.
4346         * sysdeps/powerpc/tls.h: Likewise.
4347         * sysdeps/s390/tls.h: Likewise.
4348         * sysdeps/sh/tls.h: Likewise.
4349         * sysdeps/sparc/tls.h: Likewise.
4350         * sysdeps/x86_64/tls.h: Likewise.
4351
4352 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4353
4354         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4355
4356 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4357
4358         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4359         %esp.
4360         * Makefile (tests): Add tst-align2.
4361         * tst-align2.c: New test.
4362         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4363         -mpreferred-stack-boundary=4.
4364
4365 2004-12-18  Roland McGrath  <roland@redhat.com>
4366
4367         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4368         New file removed withdrawn for the moment.
4369
4370 2004-12-17  Richard Henderson  <rth@redhat.com>
4371
4372         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4373         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4374
4375 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4376
4377         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4378         Increased PTHREAD_STACK_MIN.
4379
4380         * tst-context1.c (stacks): Use bigger stack size.
4381
4382 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4383
4384         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4385         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4386
4387 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4388
4389         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4390         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4391         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4392
4393 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4394
4395         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4396
4397 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4398
4399         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4400         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4401
4402         * tst-getpid1.c: If child crashes, report this first.  Print which
4403         signal.
4404
4405 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4406
4407         * init.c (__pthread_initialize_minimal_internal): Also unblock
4408         SIGSETXID.
4409
4410 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4411
4412         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4413         _POSIX_THREAD_CPUTIME): Define to 0.
4414         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4415         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4416         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4417         __timer_signal_thread_tclk): Remove.
4418         (init_module): Remove their initialization.
4419         (thread_cleanup): Remove their cleanup assertions.
4420         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4421         __timer_signal_thread_tclk): Remove.
4422         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4423         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4424         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4425
4426 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4427
4428         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4429         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4430
4431         * Makefile (tests): Add tst-getpid2.
4432         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4433         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4434         * tst-getpid2.c: New test.
4435
4436 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4437
4438         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4439
4440 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4441
4442         * Makefile (tests): Add tst-getpid1.
4443         * tst-getpid1.c: New file.
4444         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4445         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4446
4447 2004-12-02  Roland McGrath  <roland@redhat.com>
4448
4449         * Makefile (libpthread-nonshared): Variable removed.
4450         ($(objpfx)libpthread_nonshared.a): Target removed.
4451         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4452         These are now handled by generic magic from
4453         libpthread-static-only-routines being set.
4454
4455 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4456
4457         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4458         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4459         _POSIX_THREAD_PRIO_PROTECT): Define.
4460         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4461         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4462         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4463
4464 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4465
4466         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4467         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4468         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4469         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4470         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4471         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4472         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4473
4474 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4475
4476         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4477
4478         * Makefile (libpthread-routines): Add pthread_setschedprio.
4479         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4480         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4481         * pthread_setschedprio.c: New file.
4482
4483 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4484
4485         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4486         * pthread_cancel.c (pthread_create): Likewise.
4487
4488         * Makefile (libpthread-routines): Add vars.
4489         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4490         * init.c (__default_stacksize, __is_smp): Remove.
4491         * vars.c: New file.
4492         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4493         and define a wrapper macro.
4494         (PTHREAD_STATIC_FN_REQUIRE): Define.
4495         * allocatestack.c (__find_thread_by_id): Undefine.
4496         * pthread_create (__pthread_keys): Remove.
4497         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4498         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4499         PTHREAD_STATIC_FN_REQUIRE.
4500
4501 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4502
4503         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4504         parameter to REGISTER macro.
4505
4506 2004-11-17  Roland McGrath  <roland@redhat.com>
4507
4508         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4509         Make sure SIGCANCEL is blocked as well.
4510
4511 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4512
4513         * sysdeps/pthread/setxid.h: New file.
4514         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4515         (struct xid_command): Add forward decl.
4516         (struct pthread_functions): Change return type of __nptl_setxid hook
4517         to int.
4518         * pthreadP.h (__nptl_setxid): Change return type to int.
4519         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4520         calling thread, return its return value and set errno on failure.
4521         * descr.h (struct xid_command): Change id type to long array.
4522
4523         * Makefile: Add rules to build and test tst-setuid1 and
4524         tst-setuid1-static.
4525         * tst-setuid1.c: New test.
4526         * tst-setuid1-static.c: New test.
4527
4528 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4529
4530         * Makefile (tests): Add tst-exit3.
4531         * tst-exit3.c: New test.
4532
4533 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4534
4535         * Makefile (tests): Add tst-exit2.
4536         * tst-exit2.c: New file.
4537
4538 2004-11-09  Roland McGrath  <roland@redhat.com>
4539
4540         [BZ #530]
4541         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4542         here, before calling clone.
4543         * pthread_create.c (start_thread): Don't do it here.
4544
4545 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4546
4547         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4548
4549 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4550
4551         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4552         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4553         assembler warning.
4554
4555 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4556
4557         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4558         if sched_priority is not between minprio and maxprio.
4559
4560 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4561
4562         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4563         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4564
4565         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4566         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4567
4568 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4569
4570         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4571         not-cancelable I/O functions.
4572
4573 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4574
4575         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4576         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4577         make sure 2 is stored in the futex and we looked at the old value.
4578         Fix a few other problems to return the correct value.
4579
4580 2004-10-14  Richard Henderson  <rth@redhat.com>
4581
4582         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4583         make gcc4 happy.
4584
4585 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4586
4587         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4588         of pthread-functions.h and pthreaddef.h.
4589         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4590
4591         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4592         Change __data.__nwaiters from int to unsigned int.
4593
4594         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4595         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4596
4597         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4598         before return type.
4599
4600         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4601         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4602
4603 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4604
4605         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4606         test fails, remove message queue.
4607         (tf_msgsnd): Likewise.
4608
4609 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4610
4611         * tst-clock1.c: Change #ifdef to #if defined.
4612         * tst-clock2.c: Likewise.
4613         * tst-cond11.c: Likewise.
4614
4615         * sysdeps/pthread/timer_create.c (timer_create): Use
4616         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4617         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4618         THREAD_CPUTIME.
4619
4620 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4621
4622         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4623         _POSIX_THREAD_CPUTIME): Define to 0.
4624
4625 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4626
4627         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4628         and _POSIX_THREAD_CPUTIME to zero.
4629         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4630         * tst-barrier2.c: Fix testing for POSIX feature.
4631         * tst-clock1.c: Likewise.
4632         * tst-clock2.c: Likewise.
4633         * tst-cond11.c: Likewise.
4634         * tst-cond4.c: Likewise.
4635         * tst-cond6.c: Likewise.
4636         * tst-flock2.c: Likewise.
4637         * tst-mutex4.c: Likewise.
4638         * tst-mutex9.c: Likewise.
4639         * tst-rwlock12.c: Likewise.
4640         * tst-rwlock4.c: Likewise.
4641         * tst-signal1.c: Likewise.
4642         * tst-spin2.c: Likewise.
4643         * sysdeps/pthread/posix-timer.h: Likewise.
4644         * sysdeps/pthread/timer_create.c: Likewise.
4645         * sysdeps/pthread/timer_routines.c: Likewise.
4646
4647 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4648
4649         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4650         (__lll_mutex_timedlock_wait): Address futex correctly.
4651
4652         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4653         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4654         make sure 2 is stored in the futex and we looked at the old value.
4655         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4656         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4657         which might very well made the code not working at all before.
4658         [BZ #417]
4659
4660 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4661
4662         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4663         allow SIGSETXID to be sent.
4664         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4665         for SIGSETXID to be defined.
4666         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4667         SIGSETXID cannot be blocked.
4668
4669         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4670         Add __extension__ to long long types.
4671         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4672         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4673         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4674         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4675         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4676         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4677         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4678
4679 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4680
4681         * descr.h (struct pthread): Add stopped_start field.
4682         * sysdeps/pthread/createthread.c (create_thread): Set
4683         start_stopped flag in descriptor for new thread appropriately.
4684         * pthread_create.c (start_thread): Only take lock to be stopped on
4685         startup if stopped_start flag says so.
4686
4687 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4688
4689         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4690         is created detached and if yes, do not try to free the stack in case
4691         the thread creation failed.
4692         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4693         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4694         case there has been no error.  [BZ #405]
4695
4696         * pthread_create.c (start_thread): Don't wait for scheduler data
4697         etc to be set at the beginning of the function.  The cancellation
4698         infrastructure must have been set up.  And enable async
4699         cancellation before potentially going to sleep.  [BZ #401]
4700
4701 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4702
4703         * Versions: Remove exports for pthread_set*id_np functions.
4704         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4705         for now.
4706         * Makefile: Don't build pthread_set*id code for now.
4707
4708 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4709
4710         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4711         internal use.
4712         * allocatestack.c (__nptl_setxid): New function.
4713         * descr.h (struct xid_command): Define type.
4714         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4715         (sighandler_setxid): New function.
4716         (__pthread_initialize_minimal): Register sighandler_setxid for
4717         SIGCANCEL.
4718         * pt-allocrtsig.c: Update comment.
4719         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4720         Declare __nptl_setxid.
4721         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4722         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4723         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4724         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4725         and pthread_setresuid_np.
4726         * pthread_setgid_np.c: New file.
4727         * pthread_setuid_np.c: New file.
4728         * pthread_setegid_np.c: New file.
4729         * pthread_seteuid_np.c: New file.
4730         * pthread_setregid_np.c: New file.
4731         * pthread_setreuid_np.c: New file.
4732         * pthread_setresgid_np.c: New file.
4733         * pthread_setresuid_np.c: New file.
4734         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4735         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4736         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4737         and pthread_setresuid_np.
4738         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4739         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4740         pthread_setregid, and pthread_setresgid.
4741
4742 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4743
4744         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4745         ENOMEM when out of memory.
4746
4747 2004-09-10  Roland McGrath  <roland@redhat.com>
4748
4749         [BZ #379]
4750         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4751         code, since we don't try to use the broken CLONE_STOPPED any more.
4752         * pthread_create.c (start_thread): Likewise.
4753
4754 2004-09-15  Richard Henderson  <rth@redhat.com>
4755
4756         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4757
4758 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4759
4760         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4761         (__libc_unwind_longjmp): Delete macro and declare as function.
4762         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4763         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4764         nptl directory.
4765         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4766         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4767         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4768
4769 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4770
4771         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4772         for __USE_XOPEN2K.
4773         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4774         types also for __USE_XOPEN2K.
4775         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4776         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4777         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4778         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4779         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4780         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4781         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4782         [BZ #320]
4783
4784 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4785
4786         * sysdeps/pthread/pthread.h
4787         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4788         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4789         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4790         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4791         [BZ #375]
4792
4793 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4794
4795         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4796         PSEUDO to be used with . prefix.
4797
4798         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4799         Use atomic_increment instead of atomic_exchange_and_add.
4800         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4801         Likewise.
4802         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4803         Likewise.
4804         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4805         Likewise.
4806
4807         * allocatestack.c (allocate_stack): Use atomic_increment_val
4808         instead of atomic_exchange_and_add.
4809         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4810         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4811         Likewise.
4812         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4813         Likewise.
4814
4815         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4816         the initialization function might throw.
4817
4818 2005-09-05  Richard Henderson  <rth@redhat.com>
4819
4820         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4821         Move definition inside libpthread, libc, librt check.  Provide
4822         definition for rtld.
4823
4824 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4825
4826         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4827         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4828         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4829         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4830         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4831         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4832         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4833         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4834         * unwind.c: Use it.
4835
4836         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4837         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4838         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4839         Likewise.
4840         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4841         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4842         this is the last waiter, signal pthread_cond_destroy caller and
4843         avoid using the pthread_cond_t structure after unlock.
4844         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4845         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4846         Read clock type from the least significant bits of __nwaiters instead
4847         of __clock.
4848         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4849         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4850
4851 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4852
4853         [BZ #342]
4854         * Makefile (tests): Add tst-cond20 and tst-cond21.
4855         * tst-cond20.c: New test.
4856         * tst-cond21.c: New test.
4857         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4858         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4859         it unsigned int.
4860         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4861         Likewise.
4862         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4863         (pthread_cond_t): Likewise.
4864         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4865         Likewise.
4866         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4867         Likewise.
4868         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4869         Likewise.
4870         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4871         (cond_nwaiters): New.
4872         (clock_bits): New.
4873         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4874         if there are waiters not signalled yet.
4875         Wait until all already signalled waiters wake up.
4876         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4877         __nwaiters.  If pthread_cond_destroy has been called and this is the
4878         last waiter, signal pthread_cond_destroy caller and avoid using
4879         the pthread_cond_t structure after unlock.
4880         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4881         decrement it when leaving.  If pthread_cond_destroy has been called
4882         and this is the last waiter, signal pthread_cond_destroy caller.
4883         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4884         Likewise.  Read clock type from the least significant bits of
4885         __nwaiters instead of __clock.
4886         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4887         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4888         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4889         clock type just from the last COND_CLOCK_BITS bits of value.
4890         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4891         instead of __clock, just from second bit of condattr's value.
4892
4893 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4894
4895         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4896         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4897         != 64.
4898         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4899
4900 2004-08-15  Roland McGrath  <roland@frob.com>
4901
4902         * pthread_atfork.c: Update copyright terms including special exception
4903         for these trivial files, which are statically linked into executables
4904         that use dynamic linking for the significant library code.
4905
4906 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4907
4908         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4909         pthread_rwlock_rdlock.
4910         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4911         Decrease __nr_readers_queued after reacquiring lock.
4912         * sysdeps/pthread/pthread_rwlock_timedrdlock
4913         (pthread_rwlock_timedrdlock): Likewise.
4914         Reported by Bob Cook <bobcook47@hotmail.com>.
4915
4916 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4917
4918         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4919         before pthread_barrier_wait.
4920
4921 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4922
4923         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4924         Remove unnecessary exception handling data.
4925
4926 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4927
4928         [BZ #284]
4929         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4930         instead of clockid_t.
4931
4932 2004-07-21  Roland McGrath  <roland@redhat.com>
4933
4934         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4935
4936 2004-07-19  Roland McGrath  <roland@redhat.com>
4937
4938         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4939
4940 2004-07-02  Roland McGrath  <roland@redhat.com>
4941
4942         * configure: Don't exit.
4943
4944 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4945
4946         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4947         (__pthread_cond_timedwait): Check for invalid nanosecond in
4948         timeout value.
4949
4950 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4951
4952         * Makefile: Add rules to build and run tst-fini1.
4953         * tst-fini1.c: New file.
4954         * tst-fini1mod.c: New file.
4955
4956 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4957
4958         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4959         if no cancellation support is needed.
4960         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4961         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4962         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4963         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4964         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4965         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4966         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4967         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4968         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4969
4970         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4971         only if not already defined.
4972
4973 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4974
4975         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4976         constraint "m" instead of "0" for futex.
4977
4978         * shlib-versions: Add powerpc64-.*-linux.*.
4979
4980 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4981
4982         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4983         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4984         for valid tv_nsec.
4985         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4986         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4987         bits.
4988
4989 2004-06-29  Roland McGrath  <roland@redhat.com>
4990
4991         * Banner: NPTL no longer has its own version number.
4992         * Makefile (nptl-version): Variable removed.
4993         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4994         using $(version), the glibc version number.
4995
4996 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4997
4998         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4999         Fix branch offset for a PLT entry.
5000         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
5001         Likewise.
5002         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
5003         Likewise.
5004         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
5005         Likewise.
5006         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
5007         Likewise.
5008
5009 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
5010
5011         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
5012         unconditionally.
5013
5014 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
5015
5016         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5017         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
5018         instead of tv_sec.
5019         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5020         (pthread_rwlock_timedrdlock): Likewise.
5021
5022 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
5023
5024         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
5025         Set __r7 to val, not mutex.
5026
5027 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
5028
5029         * Makefile: Add rules to build tst-rwlock14.
5030         * tst-rwlock14.c: New file.
5031
5032 2004-06-24  Boris Hu  <boris.hu@intel.com>
5033
5034         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
5035         check.
5036         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5037
5038 2004-06-19  Andreas Jaeger  <aj@suse.de>
5039
5040         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
5041         assembler in last patch.
5042
5043 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
5044
5045         * sysdeps/pthread/pthread_cond_timedwait.c
5046         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
5047         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5048         (__pthread_cond_timedwait): Check for invalid nanosecond in
5049         timeout value.
5050         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5051         * tst-cond19.c: New file.
5052         * Makefile: Add rules to build and run tst-cond19.
5053
5054 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
5055
5056         * tst-context1.c (GUARD_PATTERN): Defined.
5057         (tst_context_t): Define struct containing ucontext_t & guard words.
5058         (ctx): Declare as an array of tst_context_t.
5059         (fct): Verify uc_link & guard words are still valid.
5060         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
5061
5062 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5063
5064         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5065         Add __data.__futex field, reshuffle __data.__clock.
5066         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
5067         (__pthread_cond_signal): Increment __futex at the same time as
5068         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5069         address of low 32-bits of __wakeup_seq to futex syscall.
5070         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5071         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5072         releasing internal lock to FUTEX_WAIT.
5073         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
5074         (__pthread_cond_timedwait): Likewise.
5075         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5076         (FUTEX_CMP_REQUEUE): Define.
5077         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5078         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5079         Pass __futex value from before the unlock and __futex address instead
5080         of address of low 32-bits of __wakeup_seq to futex syscall.
5081         Fallback to FUTEX_WAKE all on any errors.
5082
5083 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
5084
5085         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
5086         comment typo.
5087         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
5088         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
5089         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
5090         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
5091         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
5092
5093 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5094
5095         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
5096         Add memory clobber to inline assembly.
5097         (__lll_mutex_trylock): Likewise.
5098         (__lll_mutex_cond_trylock): Likewise.
5099
5100 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5101
5102         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
5103         Pass val argument as 6th system call argument in %r7.
5104
5105 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5106
5107         * Makefile (tests): Add tst-cond16.
5108         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
5109         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
5110         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5111         Add __data.__futex field, reshuffle __data.__clock.
5112         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
5113         (__pthread_cond_signal): Increment __futex at the same time as
5114         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5115         address of low 32-bits of __wakeup_seq to futex syscall.
5116         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
5117         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5118         releasing internal lock to FUTEX_WAIT.
5119         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
5120         (__pthread_cond_timedwait): Likewise.
5121         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
5122         (FUTEX_CMP_REQUEUE): Define.
5123         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5124         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5125         Pass __futex value from before the unlock and __futex address instead
5126         of address of low 32-bits of __wakeup_seq to futex syscall.
5127         Fallback to FUTEX_WAKE all on any errors.
5128         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
5129         Define.
5130         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5131         internally.  Return non-zero if error, zero if success.
5132         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5133         Add __data.__futex field, reshuffle __data.__clock.
5134         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
5135         Define.
5136         (lll_futex_requeue): Add val argument, return 1 unconditionally
5137         for the time being.
5138         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5139         Add __data.__futex field, reshuffle __data.__clock.
5140         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
5141         Define.
5142         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5143         internally.  Return non-zero if error, zero if success.
5144         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5145         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
5146         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
5147         Define.
5148         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5149         internally.  Return non-zero if error, zero if success.
5150         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
5151         Add __data.__futex field, reshuffle __data.__clock.
5152         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
5153         Define.
5154         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5155         internally.  Return non-zero if error, zero if success.
5156         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
5157         Add __data.__futex field, reshuffle __data.__clock.
5158         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
5159         Add __data.__futex field, reshuffle __data.__clock.
5160         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
5161         Increment __futex at the same time as __wakeup_seq or __total_seq.
5162         Pass address of __futex instead of address of low 32-bits of
5163         __wakeup_seq to futex syscall.
5164         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5165         Pass __futex value from before releasing internal lock
5166         to FUTEX_WAIT.
5167         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5168         Likewise.  Avoid unnecessary shadowing of variables.
5169         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
5170         Set __futex to 2 * __total_seq.  Pass __futex value from before the
5171         unlock and __futex address instead of address of low 32-bits of
5172         __wakeup_seq to futex_requeue macro, adjust for new return value
5173         meaning.
5174         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
5175         (__pthread_cond_signal): Increment __futex at the same time as
5176         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5177         address of low 32-bits of __wakeup_seq to futex syscall.
5178         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5179         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5180         releasing internal lock to FUTEX_WAIT.
5181         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5182         (__pthread_cond_timedwait): Likewise.
5183         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5184         (FUTEX_CMP_REQUEUE): Define.
5185         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5186         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5187         Pass __futex value from before the unlock and __futex address instead
5188         of address of low 32-bits of __wakeup_seq to futex syscall.
5189         Fallback to FUTEX_WAKE all on any errors.
5190
5191 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5192
5193         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
5194         Add nop to align the end of critical section.
5195         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
5196
5197 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5198
5199         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5200         Add __broadcast_seq field.
5201         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
5202         all waiters as woken with woken_seq and bump broadcast counter.
5203         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
5204         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
5205         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5206         Comment typo fixes.  Avoid returning -ETIMEDOUT.
5207
5208 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
5209
5210         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5211         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
5212         Reported by Kaz Kojima.
5213
5214 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
5215
5216         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
5217
5218 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5219
5220         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
5221         __broadcast_seq with bc_seq after acquiring internal lock instead of
5222         before it.
5223
5224 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
5225
5226         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
5227         compilation.
5228         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5229         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
5230         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5231         (pthread_cond_t): Add __data.__broadcast_seq field.
5232         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5233         (FRAME_SIZE): Define.
5234         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
5235         Comment typo fixes.
5236         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
5237         Define.
5238         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
5239         typo fixes.
5240         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5241         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
5242         fixes.
5243
5244 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
5245
5246         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
5247         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5248         Add __broadcast_seq field.
5249         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5250         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5251         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5252         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5253         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5254         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
5255         all waiters as woken with woken_seq and bump broadcast counter.
5256         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
5257         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
5258         __broadcast_seq field.
5259         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5260         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5261         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5262         * pthread_cond_init.c: Initialize __broadcast_seq field.
5263         * Makefile (tests): Add tst-cond17 and tst-cond18.
5264         Add .NOTPARALLEL goal.
5265         * tst-cond16.c: New file.  From Jakub.
5266         * tst-cond17.c: New file.  From Jakub.
5267         * tst-cond18.c: New file.  From Jakub.
5268
5269 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
5270
5271         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
5272         unwind info.
5273
5274         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5275         Parametrize frame size.  Correct some unwind info.
5276         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5277
5278 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5279
5280         * tst-stack3.c: Note testing functionality beyond POSIX.
5281
5282 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5283
5284         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5285         Change conditional from ifdef to if.
5286
5287 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5288
5289         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5290         SYSDEP_CANCEL_ERROR): Define.
5291         (PSEUDO): Use it.
5292
5293 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5294
5295         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5296
5297 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5298
5299         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5300
5301 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5302
5303         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5304         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5305         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5306         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5307
5308 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5309
5310         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5311         thread has all signals blocked.
5312
5313 2004-04-18  Andreas Jaeger  <aj@suse.de>
5314
5315         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5316         (SEM_VALUE_MAX): Add missing brace.
5317
5318 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5319
5320         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5321         in rt subdir.
5322         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5323         * sysdeps/pthread/tst-mqueue8x.c: New test.
5324         * tst-cancel4.c: Update comment about message queues.
5325
5326         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5327         return it_value { 0, 0 }.
5328         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5329         like SIGEV_SIGNAL.
5330         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5331         assertion for SIGEV_NONE.
5332         (thread_attr_compare): Compare all attributes, not just a partial
5333         subset.
5334
5335 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5336
5337         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5338
5339 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5340
5341         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5342         Just use a plain number.
5343         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5344         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5345         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5346         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5347         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5348         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5349         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5350
5351 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5352
5353         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5354         frame info.
5355         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5356
5357 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5358
5359         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5360         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5361         of calling sigwaitinfo.
5362
5363 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5364
5365         * allocatestack.c (allocate_stack): Set reported_guardsize
5366         unconditionally.
5367         * pthread_getattr_np.c (pthread_getattr_np): Use
5368         reported_guardsize instead of guardsize.
5369         * descr.h (struct pthread): Add reported_guardsize field.
5370
5371 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5372
5373         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5374
5375 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5376
5377         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5378
5379 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5380
5381         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5382         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5383         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5384         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5385         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5386         Define.
5387         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5388         (_POSIX_MESSAGE_PASSING): Define.
5389         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5390         (_POSIX_MESSAGE_PASSING): Define.
5391         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5392         (_POSIX_MESSAGE_PASSING): Define.
5393
5394 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5395
5396         * tst-context1.c (fct): Check whether correct stack is used.
5397
5398 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5399
5400         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5401         matching constraints for asm mem parameters.
5402
5403         * tst-clock2.c (tf): Don't define unless needed.
5404
5405 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5406
5407         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5408         $(gnulib).
5409
5410 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5411
5412         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5413         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5414         * pthreadP.h: Declare __nptl_deallocate_tsd.
5415         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5416         Adjust caller.
5417
5418         * Makefile (tests): Add tst-tsd5.
5419         * tst-tsd5.c: New file.
5420
5421 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5422
5423         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5424         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5425         is SHLIB_COMPAT check.
5426         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5427         (__pthread_attr_getaffinity_old): Likewise.
5428         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5429         (__pthread_getaffinity_old): Likewise.
5430         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5431         (__pthread_setaffinity_old): Likewise.
5432
5433 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5434
5435         * allocatestack.c (_make_stacks_executable): Call
5436         _dl_make_stack_executable first.
5437
5438 2004-03-24  Roland McGrath  <roland@redhat.com>
5439
5440         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5441         constraint instead of "0".
5442
5443 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5444
5445         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5446         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5447
5448         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5449         code to avoid warning.
5450
5451 2004-03-24  Andreas Jaeger  <aj@suse.de>
5452
5453         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5454         (__pthread_attr_setaffinity_old): Remove const.
5455
5456 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5457
5458         * sysdeps/unix/sysv/linux/smp.h: New file.
5459         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5460         * init.c: Define __is_smp.
5461         (__pthread_initialize_minimal_internal): Call is_smp_system to
5462         initialize __is_smp.
5463         * pthreadP.h: Declare __is_smp.
5464         Define MAX_ADAPTIVE_COUNT is necessary.
5465         * pthread_mutex_init.c: Add comment regarding __spins field.
5466         * pthread_mutex_lock.c: Implement adaptive mutex type.
5467         * pthread_mutex_timedlock.c: Likewise.
5468         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5469         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5470         Add __spins field.
5471         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5472         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5473         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5474         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5475         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5476         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5477         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5478         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5479         lll_mutex_cond_trylock.
5480         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5481         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5482         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5483         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5484         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5485         Define BUSY_WAIT_NOP.
5486         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5487         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5488
5489         * tst-mutex5.c: Add support for testing adaptive mutexes.
5490         * tst-mutex7.c: Likewise.
5491         * tst-mutex5a.c: New file.
5492         * tst-mutex7a.c: New file.
5493         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5494
5495         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5496         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5497         vgettimeofday call might destroy the content.
5498
5499         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5500         @pause in the loop.
5501
5502         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5503         No need to restrict type of ret.  Make it int.  Add comment.
5504
5505         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5506         Remove unnecessary setne instruction.
5507
5508 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5509
5510         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5511         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5512         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5513         If realloc fails, break out of the loop.
5514
5515 2004-03-20  Andreas Jaeger  <aj@suse.de>
5516
5517         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5518         (__pthread_setaffinity_old): Fix interface.
5519         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5520         (__pthread_getaffinity_old): Likewise.
5521
5522         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5523         (__pthread_setaffinity_new): Remove duplicate declaration.
5524
5525 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5526
5527         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5528         the return value to a safe register.
5529         (CDISABLE): Set the function argument correctly.
5530
5531 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5532
5533         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5534         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5535         Rewrite so that only one locked memory operation per round is needed.
5536         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5537         (pthread_barrier_wait): After wakeup, release lock only when the
5538         last thread stopped using the barrier object.
5539         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5540         (__pthread_cond_wait): Don't store mutex address if the current
5541         value is ~0l.  Add correct cleanup support and unwind info.
5542         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5543         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5544         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5545         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5546         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5547         Add correct cleanup support and unwind info.
5548         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5549         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5550         information for syscall wrappers.
5551
5552 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5553
5554         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5555         cpusetsize field, remove next.
5556         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5557         parameter for size of the CPU set.
5558         (pthread_setaffinity_np): Likewise.
5559         (pthread_attr_getaffinity_np): Likewise.
5560         (pthread_attr_setaffinity_np): Likewise.
5561         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5562         interface change, keep compatibility code.
5563         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5564         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5565         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5566         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5567         __pthread_getaffinity_np.
5568         * Versions: Add version for changed interfaces.
5569         * tst-attr3.c: Adjust test for interface change.
5570         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5571         increasing buffer sizes.
5572         * pthread_attr_destroy.c: Remove unused list handling.
5573         * pthread_attr_init.c: Likewise.
5574
5575 2004-03-17  Roland McGrath  <roland@redhat.com>
5576
5577         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5578         first argument to clock_getres so we ever enable kernel timers.
5579
5580 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5581
5582         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5583
5584 2004-03-12  Richard Henderson  <rth@redhat.com>
5585
5586         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5587         oldvalue from CENABLE to CDISABLE.
5588
5589 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5590
5591         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5592         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5593         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5594         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5595
5596 2004-03-11  Richard Henderson  <rth@redhat.com>
5597
5598         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5599         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5600         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5601
5602 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5603
5604         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5605         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5606         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5607
5608 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5609
5610         * forward.c (__pthread_cond_broadcast_2_0,
5611         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5612         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5613         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5614
5615 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5616
5617         * sysdeps/sh/tcb-offsets.sym: Add PID.
5618         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5619         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5620
5621 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5622
5623         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5624         include <sysdep-cancel.h>, vfork is no cancellation point.
5625         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5626         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5627         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5628
5629 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5630
5631         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5632         libc_hidden_def.
5633         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5634         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5635         Likewise.
5636         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5637         Likewise.
5638         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5639         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5640         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5641         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5642         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5643
5644         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5645         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5646         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5647         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5648         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5649         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5650
5651         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5652         a local register for saving old PID.  Negate PID in parent upon exit.
5653
5654         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5655         tcb-offsets.h.
5656         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5657         before syscall, set to the old value in the parent afterwards.
5658         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5659         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5660         tcb-offsets.h.
5661         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5662         before syscall, set to the old value in the parent afterwards.
5663         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5664         * sysdeps/s390/tcb-offsets.sym: Add PID.
5665
5666         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5667         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5668         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5669         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5670         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5671         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5672
5673 2004-03-10  Andreas Schwab  <schwab@suse.de>
5674
5675         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5676         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5677         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5678
5679 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5680
5681         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5682         * tst-cancel21.c (do_one_test): Likewise.
5683         Reported by Gordon Jin <gordon.jin@intel.com>.
5684
5685 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5686
5687         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5688         if non-zero and set to INT_MIN if zero.
5689         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5690         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5691         (SAVE_PID, RESTORE_PID): Define.
5692         (__vfork): Use it.
5693         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5694         Use relative path to avoid including NPTL i386/vfork.S.
5695         (SAVE_PID, RESTORE_PID): Define.
5696         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5697         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5698         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5699         tst-vfork2x.
5700         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5701         * tst-vfork1.c: New test.
5702         * tst-vfork2.c: New test.
5703         * tst-vfork1x.c: New test.
5704         * tst-vfork2x.c: New test.
5705
5706 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5707
5708         * sysdeps/i386/tcb-offsets.sym: Add PID.
5709         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5710         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5711         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5712
5713 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5714
5715         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5716
5717 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5718
5719         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5720         _rtld_global_ro.
5721
5722 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5723
5724         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5725         _rtld_global_ro.
5726
5727         * tst-once4.c: Remove unnecessary macro definition.
5728
5729         * tst-mutex7.c (do_test): Limit thread stack size.
5730         * tst-once2.c (do_test): Likewise.
5731         * tst-tls3.c (do_test): Likewise.
5732         * tst-tls1.c (do_test): Likewise.
5733         * tst-signal3.c (do_test): Likewise.
5734         * tst-kill6.c (do_test): Likewise.
5735         * tst-key4.c (do_test): Likewise.
5736         * tst-join4.c (do_test): Likewise.
5737         * tst-fork1.c (do_test): Likewise.
5738         * tst-context1.c (do_test): Likewise.
5739         * tst-cond2.c (do_test): Likewise.
5740         * tst-cond10.c (do_test): Likewise.
5741         * tst-clock2.c (do_test): Likewise.
5742         * tst-cancel10.c (do_test): Likewise.
5743         * tst-basic2.c (do_test): Likewise.
5744         * tst-barrier4.c (do_test): Likewise.
5745
5746 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5747
5748         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5749
5750 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5751
5752         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5753         (__pthread_cond_timedwait): Optimize wakeup test.
5754         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5755         (__pthread_cond_wait): Likewise.
5756         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5757         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5758         Likewise.
5759
5760 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5761
5762         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5763         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5764         the atomic instruction needed.
5765         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5766         (__lll_mutex_lock_wait): Likewise.
5767
5768 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5769
5770         * Makefile (tests): Add tst-cond14 and tst-cond15.
5771         * tst-cond14.c: New file.
5772         * tst-cond15.c: New file.
5773
5774 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5775
5776         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5777         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5778         needs to be implemented differently to be useful.
5779
5780 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5781
5782         * pthread_attr_setschedparam.c: Don't test priority against limits
5783         here.  Set ATTR_FLAG_SCHED_SET flag.
5784         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5785         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5786         from parent thread to child.  If attribute is used and scheduling
5787         parameters are not inherited, copy parameters from attribute or
5788         compute them.  Check priority value.
5789         * pthread_getschedparam.c: If the parameters aren't known yet get
5790         them from the kernel.
5791         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5792         ATTR_FLAG_POLICY_SET flag for thread.
5793         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5794         and ATTR_FLAG_POLICY_SET.
5795
5796         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5797
5798         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5799         fail if stack address hasn't been set.  Just return 0.
5800
5801 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5802
5803         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5804         libpthread for the files in this list.
5805         (CFLAGS-tst-unload): Removed.
5806         * tst-unload.c (do_test): Don't use complete path for
5807         LIBPHREAD_SO.
5808
5809         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5810         tst-_res1mod2.
5811
5812 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5813
5814         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5815         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5816         operation per round is needed.
5817         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5818         (__lll_mutex_lock_wait): Likewise.
5819
5820 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5821
5822         * tst-cancel9.c (cleanup): Don't print to stderr.
5823
5824 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5825
5826         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5827
5828 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5829
5830         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5831         (__syscall_error_handler2): Call CDISABLE.
5832         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5833         (__syscall_error_handler2): Call CDISABLE.
5834
5835         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5836         Release lock before the loop, don't reacquire it.
5837
5838         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5839
5840 2004-02-19  Andreas Schwab  <schwab@suse.de>
5841
5842         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5843         Fix last change.
5844
5845 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5846
5847         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5848         (pthread_barrier_wait): After wakeup, release lock only when the
5849         last thread stopped using the barrier object.
5850         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5851         (pthread_barrier_wait): Likewise.
5852         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5853         Likewise.
5854         * Makefile (tests): Add tst-barrier4.
5855         * tst-barrier4.c: New file.
5856
5857         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5858         (__pthread_cond_timedwait): Perform timeout test while holding
5859         internal lock to prevent wakeup race.
5860         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5861         * sysdeps/pthread/pthread_cond_timedwait.c
5862         (__pthread_cond_timedwait): Likewise.
5863         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5864         (__pthread_cond_timedwait): Likewise.
5865
5866 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5867
5868         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5869         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5870         * Makefile (tests): Add tst-rwlock13.
5871         * tst-rwlock13.c: New test.
5872
5873 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5874
5875         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5876         (__condvar_tw_cleanup): Little optimization.
5877         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5878
5879 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5880
5881         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5882         libpthread as "lib" parameter to SHLIB_COMPAT.
5883         (__novmx_siglongjmp): Fix typo in function name.
5884         (__novmx_longjmp): Fix typo in function name.
5885
5886 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5887
5888         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5889         __builtin_expect.
5890
5891         * sysdeps/generic/pt-longjmp.c: Moved to...
5892         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5893
5894 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5895
5896         * Makefile (libpthread-routines): Add pt-cleanup.
5897         * pt-longjmp.c: Removed.
5898         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5899         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5900         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5901         Version longjmp, siglongjmp for GLIBC_2.3.4.
5902         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5903
5904 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5905
5906         * sysdeps/pthread/pthread_cond_timedwait.c
5907         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5908         Reuse code.  Add __builtin_expects.
5909
5910         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5911         (__pthread_cond_timedwait): Get internal lock in case timeout has
5912         passed before the futex syscall.
5913         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5914
5915 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5916
5917         * allocatestack.c: Pretty printing.
5918
5919         * sysdeps/pthread/createthread.c (create_thread): Don't add
5920         CLONE_DETACHED bit if it is not necessary.
5921
5922 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5923
5924         * pthread_getattr_np.c: Include ldsodefs.h.
5925
5926 2004-01-16  Richard Henderson  <rth@redhat.com>
5927
5928         * allocatestack.c: Don't declare __libc_stack_end.
5929         * init.c (__pthread_initialize_minimal_internal): Likewise.
5930         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5931
5932 2004-01-15  Richard Henderson  <rth@redhat.com>
5933
5934         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5935         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5936         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5937         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5938         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5939         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5940         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5941         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5942
5943 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5944
5945         * init.c (pthread_functions): Make array const.
5946
5947 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5948
5949         * allocatestack.c (__make_stacks_executable): Change interface.
5950         Check parameters.  Pass parameter on to libc counterpart.
5951         * pthreadP.h: Change declaration.
5952
5953 2004-01-13  Richard Henderson  <rth@redhat.com>
5954
5955         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5956         prototype form.
5957         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5958         Likewise.
5959
5960         * sysdeps/alpha/Makefile: New file.
5961         * sysdeps/alpha/tcb-offsets.sym: New file.
5962         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5963         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5964
5965         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5966         on powerpc version.
5967
5968 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5969
5970         * Makefile (tests): Add tst-backtrace1.
5971         * tst-backtrace1.c: New test.
5972
5973 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5974
5975         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5976         register as second parameter to the REGISTER macro.
5977         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5978         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5979         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5980         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5981         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5982         of thread register as second parameter to REGISTER macro in 64 case.
5983
5984 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5985
5986         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5987         (CFLAGS-getpid.o): Defined.
5988         (CFLAGS-getpid.os): Defined.
5989
5990 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5991
5992         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5993         returned for main thread does not overlap with any other VMA.
5994         Patch by Jakub Jelinek.
5995
5996 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5997
5998         * tst-raise1.c: Include stdio.h.
5999
6000 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
6001
6002         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
6003         setting with __ASSUME_TGKILL || defined __NR_tgkill.
6004         If pid is 0, set it to selftid.
6005         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
6006         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
6007         != 0, return self->tid without doing a syscall.
6008         * descr.h (struct pthread): Move pid field after tid.
6009
6010         * Makefile (tests): Add tst-raise1.
6011         * tst-raise1.c: New file.
6012
6013 2003-12-23  Roland McGrath  <roland@redhat.com>
6014
6015         * tst-oddstacklimit.c: New file.
6016         * Makefile (tests): Add it.
6017         (tst-oddstacklimit-ENV): New variable.
6018
6019         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
6020         value up to page size for __default_stacksize.
6021
6022 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
6023
6024         * Makefile (tests): Add tst-eintr5.
6025         * tst-eintr5.c: New file.
6026
6027         * eintr.c (eintr_source): Prevent sending signal to self.
6028
6029         * tst-eintr2.c (tf1): Improve error message.
6030
6031 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
6032
6033         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
6034         * sysdeps/unix/sysv/linux/getpid.c: New file.
6035         * pthread_cancel.c: Add comment explaining use of PID field.
6036         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6037         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
6038         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
6039         temporarily to signal the field must not be relied on and updated
6040         by getpid().
6041         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
6042         temporarily negative.
6043         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6044
6045 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
6046
6047         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
6048         (eintr_source): If ARG != NULL, use pthread_kill.
6049         * tst-eintr1.c: Adjust for this change.
6050         * tst-eintr2.c: Likewise.
6051         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
6052         * tst-eintr3.c: New file.
6053         * tst-eintr4.c: New file.
6054
6055 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
6056
6057         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
6058         if CANCELSTATE_BITMASK is set.
6059         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
6060         Likewise.
6061
6062         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
6063         (tests-reverse): Add tst-cancel23.
6064         * tst-cancel22.c: New test.
6065         * tst-cancel23.c: New test.
6066
6067 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
6068
6069         * tst-eintr1.c: Better error messages.
6070
6071         * Makefile (tests): Add tst-eintr2.
6072         * tst-eintr2.c: New file.
6073
6074 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
6075
6076         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
6077         (CFLAGS-tst-cancelx21.c): Set.
6078         * tst-cancel21.c: New test.
6079         * tst-cancelx21.c: New test.
6080
6081         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
6082         comparison operand.
6083         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
6084         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
6085         * pt-longjmp.c: Include jmpbuf-unwind.h.
6086         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
6087         _JMPBUF_UNWINDS.  Adjust compared pointers.
6088         * init.c (__pthread_initialize_minimal_internal): Initialize
6089         pd->stackblock_size.
6090         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
6091         * sysdeps/alpha/jmpbuf-unwind.h: New file.
6092         * sysdeps/i386/jmpbuf-unwind.h: New file.
6093         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
6094         * sysdeps/s390/jmpbuf-unwind.h: New file.
6095         * sysdeps/sh/jmpbuf-unwind.h: New file.
6096         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
6097         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
6098         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
6099         (_JMPBUF_CFA_UNWINDS): Remove.
6100         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
6101
6102 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
6103
6104         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
6105         (CFLAGS-tst-cancelx20.c): Set.
6106         * tst-cancel20.c: New test.
6107         * tst-cancelx20.c: New test.
6108
6109 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
6110
6111         * init.c (__pthread_initialize_minimal_internal): Don't treat
6112         architectures with separate register stack special here when
6113         computing default stack size.
6114
6115 2003-12-17  Roland McGrath  <roland@redhat.com>
6116
6117         * Makefile (tst-cancelx7-ARGS): New variable.
6118         Reportd by Greg Schafer <gschafer@zip.com.au>.
6119
6120 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
6121
6122         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
6123         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
6124         (tst-stack3-ENV): Set.
6125         ($(objpfx)tst-stack3-mem): New.
6126         * tst-stack3.c: New test.
6127
6128 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
6129
6130         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
6131         Add unwind directives.  Drop unused .regstk directive.
6132         (_fini_EPILOG_BEGINS): Add unwind directives.
6133
6134 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
6135
6136         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
6137         Assume parameter is a pointer.
6138         (lll_futex_wake): Likewise.
6139         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
6140         Likewise.
6141         (lll_futex_wake): Likewise.
6142         Reported by Boris Hu.
6143         * sysdeps/unix/sysv/linux/unregister-atfork.c
6144         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
6145
6146         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
6147
6148 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
6149
6150         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
6151         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
6152         __rtld_lock_initialize for ld.so lock.
6153         Patch in part by Adam Li <adam.li@intel.com>.
6154
6155 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
6156
6157         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
6158         in $(gnulib).  Also, remove stale comment.
6159
6160 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
6161
6162         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
6163         advantage of new syscall stub and optimize accordingly.
6164
6165         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
6166         from SYS_futex, to match expectations of
6167         sysdep.h:DO_INLINE_SYSCALL.
6168         (lll_futex_clobbers): Remove.
6169         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
6170         (lll_futex_wake): Likewise.
6171         (lll_futex_requeue): Likewise.
6172         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
6173         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
6174         Jelinek).
6175         (__lll_mutex_lock): Likewise.
6176         (__lll_mutex_cond_lock): Likewise.
6177         (__lll_mutex_timed_lock): Likewise.
6178         (__lll_mutex_unlock): Likewise.
6179         (__lll_mutex_unlock_force): Likewise.
6180
6181         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
6182         comes before the include of <sysdep.h>.
6183         (THREAD_SELF_SYSINFO): New macro.
6184         (THREAD_SYSINFO): Likewise.
6185         (INIT_SYSINFO): New macro.
6186         (TLS_INIT_TP): Call INIT_SYSINFO.
6187
6188         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
6189
6190         * sysdeps/pthread/createthread.c (create_thread): Use
6191         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
6192         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
6193         THREAD_SELF_SYSINFO instead of open code.
6194         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
6195         (THREAD_SYSINFO): Likewise.
6196
6197         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
6198
6199         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
6200
6201 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
6202
6203         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
6204         instead of .init.  Patch by David Mosberger.
6205
6206 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
6207
6208         * sysdeps/pthread/configure.in: Remove broken declaration in C
6209         cleanup handling check.
6210
6211 2003-11-30  Andreas Jaeger  <aj@suse.de>
6212
6213         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
6214         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
6215         Likewise.
6216
6217 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
6218
6219         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
6220         * pthread_attr_destroy.c: Include shlib-compat.h.
6221         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
6222         is set in iattr->flags.
6223         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
6224
6225 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
6226
6227         * Makefile (distribute): Add tst-cleanup4aux.c.
6228
6229         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
6230         include.
6231
6232 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
6233
6234         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
6235         pthread_cond_signal.
6236
6237         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
6238         store mutex address if the current value is ~0l.
6239         * sysdeps/pthread/pthread_cond_timedwait.c
6240         (__pthread_cond_timedwait): Likewise.
6241         * sysdeps/pthread/pthread_cond_broadcast.c
6242         (__pthread_cond_broadcast): Don't use requeue for pshared
6243         condvars.
6244
6245         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6246         (__pthread_cond_wait): Don't store mutex address if the current
6247         value is ~0l.
6248         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6249         (__pthread_cond_timedwait): Likewise.
6250         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6251         (__pthread_cond_broadcast): Don't use requeue for pshared
6252         condvars.
6253
6254         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
6255         element with ~0l for pshared condvars, with NULL otherwise.
6256
6257         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6258         (__pthread_cond_wait): Don't store mutex address if the current
6259         value is ~0l.
6260         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6261         (__pthread_cond_timedwait): Likewise.
6262         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6263         (__pthread_cond_broadcast): Don't use requeue for pshared
6264         condvars.
6265
6266         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
6267         * tst-cond12.c: New file.
6268         * tst-cond13.c: New file.
6269
6270 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
6271
6272         * sysdeps/pthread/configure.in: Make missing forced unwind support
6273         fatal.
6274
6275 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
6276
6277         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6278
6279 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6280
6281         * Makefile: Add magic to clean up correctly.
6282
6283 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6284
6285         * unwind.c (FRAME_LEFT): Define.
6286         (unwind_stop): Handle old style cleanups here.
6287         (__pthread_unwind): Handle old style cleanups only if
6288         !HAVE_FORCED_UNWIND.
6289         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6290         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6291         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6292         ($(objpfx)tst-cleanupx4): Likewise.
6293         * tst-cleanup4.c: New test.
6294         * tst-cleanup4aux.c: New.
6295         * tst-cleanupx4.c: New test.
6296
6297 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6298
6299         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6300         lll_mutex_*lock macros to skip atomic operations on some archs.
6301
6302 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6303
6304         * sysdeps/pthread/tst-timer.c (main): Initialize
6305         sigev2.sigev_value as well.
6306
6307 2003-10-15  Roland McGrath  <roland@redhat.com>
6308
6309         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6310         is missing.
6311         * sysdeps/pthread/configure: Regenerated.
6312
6313 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6314
6315         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6316         locking macros.  No distinction between normal and mutex locking
6317         anymore.
6318         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6319         Merge bits from lowlevelmutex.S we still need.
6320         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6321         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6322         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6323         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6324         new mutex implementation.
6325         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6326         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6327         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6328         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6329         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6330         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6331         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6332         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6333         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6334         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6335         symbol for entry point to avoid cancellation.
6336
6337 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6338
6339         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6340         changes.
6341         (SAVE_OLDTYPE_0): Fix a typo.
6342
6343 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6344
6345         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6346         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6347
6348 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6349
6350         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6351         correct offset.
6352
6353 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6354
6355         * Makefile (tests): Add tst-cancel19.
6356         * tst-cancel19.c: New test.
6357
6358 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6359
6360         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6361         restoring of the old cancellation type.
6362
6363 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6364
6365         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6366
6367 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6368
6369         * sysdeps/pthread/malloc-machine.h: New file
6370
6371 2003-09-24  Roland McGrath  <roland@redhat.com>
6372
6373         * allocatestack.c (__make_stacks_executable): Don't ignore return
6374         value from _dl_make_stack_executable.
6375
6376 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6377
6378         * allocatestack.c (__make_stacks_executable): Also change
6379         permission of the currently unused stacks.
6380
6381         * allocatestack.c (change_stack_perm): Split out from
6382         __make_stacks_executable.
6383         (allocate_stack): If the required permission changed between the time
6384         we started preparing the stack and queueing it, change the permission.
6385         (__make_stacks_executable): Call change_stack_perm.
6386
6387         * Makefile: Build tst-execstack-mod locally.
6388         * tst-execstack-mod.c: New file.
6389
6390 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6391
6392         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6393
6394 2003-09-23  Roland McGrath  <roland@redhat.com>
6395
6396         * tst-execstack.c: New file.
6397         * Makefile (tests): Add it.
6398         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6399         (LDFLAGS-tst-execstack): New variable.
6400
6401         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6402         whether to use PROT_EXEC for stack mmap.
6403         (__make_stacks_executable): New function.
6404         * pthreadP.h: Declare it.
6405         * init.c (__pthread_initialize_minimal_internal): Set
6406         GL(dl_make_stack_executable_hook) to that.
6407
6408 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6409
6410         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6411         recommendation from AMD re avoidance of lock prefix.
6412
6413 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6414
6415         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6416         lll_futex_timed_wait instead of lll_futex_wait.
6417         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6418         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6419         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6420         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6421         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6422         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6423         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6424         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6425         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6426         Completely revamp the locking macros.  No distinction between
6427         normal and mutex locking anymore.
6428         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6429         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6430         __lll_lock_timedwait): Fix prototypes.
6431         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6432         __lll_lock_timedwait): Likewise.
6433         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6434         macros, add __builtin_expect.
6435         (lll_mutex_timedlock): Likewise.  Fix return value.
6436         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6437         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6438         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6439         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6440         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6441         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6442         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6443         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6444
6445 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6446
6447         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6448         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6449         operation if possible.
6450
6451         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6452         like jumping over the lock prefix.
6453
6454 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6455
6456         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6457         locking macros.  No distinction between normal and mutex locking
6458         anymore.
6459         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6460         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6461         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6462         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6463         locking.  Merge bits from lowlevelmutex.S we still need.
6464         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6465         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6466         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6467         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6468         * Makefile (routines): Remove libc-lowlevelmutex.
6469         (libpthread-rountines): Remove lowlevelmutex.
6470         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6471         for new mutex implementation.
6472         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6473         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6474         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6475         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6476         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6477         Likewise.
6478         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6479         Likewise.
6480         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6481         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6482         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6483         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6484         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6485         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6486         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6487         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6488         Likewise.
6489         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6490         Likewise.
6491         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6492         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6493         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6494         Don't use requeue.
6495         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6496         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6497
6498 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6499
6500         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6501         in parameters of asm with output parameters.
6502
6503         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6504         type of DECR parameter to int.
6505         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6506
6507 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6508
6509         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6510         guardsize for each thread.
6511
6512 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6513
6514         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6515         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6516         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6517
6518         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6519         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6520         NULL.
6521         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6522         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6523         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6524         (pthread_getaffinity_np): Add hidden_def.
6525
6526         * Makefile (tests): Add tst-attr3.
6527         * tst-attr3.c: New test.
6528
6529         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6530
6531 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6532
6533         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6534         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6535
6536 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6537
6538         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6539         * tst-align.c: Include tst-stack-align.h.
6540         (tf, do_test): Use TEST_STACK_ALIGN macro.
6541
6542 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6543
6544         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6545         variable.
6546
6547 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6548
6549         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6550         stack-related values for the initial thread.
6551
6552 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6553
6554         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6555
6556 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6557
6558         * pthread_mutex_lock.c: Minor code rearrangements.
6559
6560 2003-09-05  Roland McGrath  <roland@redhat.com>
6561
6562         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6563         Instead, include ../nptl_db/db_info.c to do its magic.
6564         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6565         (__pthread_pthread_key_2ndlevel_size): Likewise.
6566         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6567         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6568         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6569         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6570         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6571         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6572         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6573         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6574         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6575         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6576         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6577         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6578         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6579         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6580         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6581         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6582         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6583
6584 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6585
6586         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6587         of pthread_t to be compatible with LT.
6588         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6589         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6590         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6591         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6592         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6593         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6594         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6595
6596 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6597
6598         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6599
6600 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6601
6602         * unwind-forcedunwind.c: Move to...
6603         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6604         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6605         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6606         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6607         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6608         * unwind.c: Include jmpbuf-unwind.h.
6609         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6610
6611 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6612
6613         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6614         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6615         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6616         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6617         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6618         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6619         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6620         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6621         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6622         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6623         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6624         function.
6625         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6626         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6627         * Makefile (tests): Add tst-stack2.
6628         * tst-stack2.c: New test.
6629         * tst-stack1.c: Include limits.h and sys/param.h.
6630         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6631
6632         * pthread_condattr_setpshared.c: Include errno.h.
6633         (pthread_condattr_setpshared): Return EINVAL if pshared
6634         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6635
6636         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6637         defined symbol for entry point to avoid cancellation.
6638         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6639         Likewise.
6640         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6641         Likewise.
6642         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6643         Likewise.
6644         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6645         Likewise.
6646         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6647         Likewise.
6648         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6649         __close_nocancel, __read_nocancel, __write_nocancel,
6650         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6651         libpthread.so or librt.so, define to corresponding function
6652         without _nocancel suffix.
6653         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6654         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6655         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6656
6657         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6658
6659 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6660
6661         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6662         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6663
6664         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6665         in subsections has a symbol associated with it.
6666
6667         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6668         defined symbol for entry point to avoid cancellation.
6669         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6670
6671 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6672
6673         * Makefile (tests): Add tst-tls5.
6674         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6675         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6676         ($(objpfx)tst-tls5): New.
6677         ($(objpfx)tst-tls6.out): Likewise.
6678         (tests): Depend on $(objpfx)tst-tls6.out.
6679         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6680         (do_test): Check pthread_self () return value alignment.
6681         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6682         (tf): Check pthread_self () return value alignment.
6683         * tst-tls5.c: New test.
6684         * tst-tls5.h: New.
6685         * tst-tls5mod.c: New.
6686         * tst-tls5moda.c: New.
6687         * tst-tls5modb.c: New.
6688         * tst-tls5modc.c: New.
6689         * tst-tls5modd.c: New.
6690         * tst-tls5mode.c: New.
6691         * tst-tls5modf.c: New.
6692         * tst-tls6.sh: New test.
6693
6694         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6695         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6696         * init.c (pthread_functions): Initialize them.
6697         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6698         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6699         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6700         pthread_cond_timedwait@@GLIBC_2.3.2.
6701
6702 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6703
6704         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6705         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6706         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6707         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6708         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6709         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6710
6711         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6712
6713         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6714         _POSIX_THREAD_PRIORITY_SCHEDULING.
6715         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6716
6717 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6718
6719         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6720         nested function, use static inline function from libio.h.
6721         Code by Richard Henderson.
6722
6723         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6724         weak.
6725
6726 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6727
6728         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6729         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6730         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6731         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6732         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6733         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6734         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6735         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6736         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6737         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6738         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6739         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6740         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6741         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6742         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6743         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6744         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6745         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6746         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6747         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6748         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6749         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6750         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6751         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6752         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6753         * sysdeps/sparc/tls.h: New file.
6754         * sysdeps/sparc/tcb-offsets.sym: New file.
6755         * sysdeps/sparc/Makefile: New file.
6756         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6757         * init.c [__sparc__] (__NR_set_tid_address): Define.
6758
6759 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6760
6761         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6762         _IO_release_lock): Define.
6763
6764 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6765
6766         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6767         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6768
6769 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6770
6771         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6772         (__pthread_cleanup_class): Add missing return types of member
6773         functions.
6774
6775 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6776
6777         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6778         (lll_mutex_unlock_force): Add memory barrier between store and futex
6779         syscall.
6780
6781 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6782
6783         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6784         tempmsg in first loop.
6785
6786 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6787
6788         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6789         _POSIX_THREAD_PRIORITY_SCHEDULING.
6790         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6791
6792 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6793
6794         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6795         (__rtld_lock_default_lock_recursive,
6796         __rtld_lock_default_unlock_recursive): Define.
6797         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6798         __rtld_lock_unlock_recursive): Define using
6799         GL(_dl_rtld_*lock_recursive).
6800         * init.c (__pthread_initialize_minimal_internal): Initialize
6801         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6802         Lock GL(_dl_load_lock) the same number of times as
6803         GL(_dl_load_lock) using non-mt implementation was nested.
6804
6805         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6806         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6807
6808 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6809
6810         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6811         PIPE_BUF.
6812
6813 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6814
6815         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6816
6817 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6818
6819         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6820         to first syscall error check.  Move syscall error check for tkill
6821         into __ASSUME_CLONE_STOPPED #ifdef.
6822
6823 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6824
6825         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6826         is not defined, do explicit synchronization.
6827         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6828         is not defined also unlock pd->lock for non-debugging case in case
6829         it is necessary.
6830         * pthread_create.c (start_thread): Always get and release pd->lock
6831         if __ASSUME_CLONE_STOPPED is not defined.
6832         (start_thread_debug): Removed.  Adjust users.
6833         * allocatestack.c (allocate_stack): Always initialize lock if
6834         __ASSUME_CLONE_STOPPED is not defined.
6835         * Makefile (tests): Add tst-sched1.
6836         * tst-sched1.c: New file.
6837
6838         * sysdeps/pthread/createthread.c (do_clone): Only use
6839         sched_setschduler and pass correct parameters.
6840
6841 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6842
6843         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6844         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6845         PTHREAD_STACK_MIN in comments.
6846
6847 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6848
6849         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6850         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6851         argument.
6852         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6853         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6854         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6855         (__pthread_cleanup_upto): Fix prototype.
6856         (_longjmp_unwind): Adjust caller.
6857         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6858         Change second argument to const struct pointer.
6859         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6860         * tst-sem9.c (main): Likewise.
6861         * unwind.c: Include string.h for strlen prototype.
6862
6863 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6864
6865         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6866         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6867         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6868         Define HAVE_CMOV.
6869         Patch by Nicholas Miell <nmiell@attbi.com>.
6870
6871 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6872
6873         * init.c (__pthread_initialize_minimal_internal): Initialize
6874         GL(dl_init_static_tls).
6875         * pthreadP.h (__pthread_init_static_tls): New prototype.
6876         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6877         New functions.
6878         * Makefile (tests): Add tst-tls4.
6879         (modules-names): Add tst-tls4moda and tst-tls4modb.
6880         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6881         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6882         tst-tls4modb.so.
6883         * tst-tls4.c: New file.
6884         * tst-tls4moda.c: New file.
6885         * tst-tls4modb.c: New file.
6886
6887 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6888
6889         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6890         before __timer_dealloc.
6891         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6892         Don't call list_unlink.
6893
6894 2003-07-29  Roland McGrath  <roland@redhat.com>
6895
6896         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6897
6898 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6899
6900         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6901         Don't reuse struct aiocb A if it failed.
6902         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6903         not just one byte, as that does not block.
6904
6905 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6906
6907         * sysdeps/pthread/unwind-resume.c: New file.
6908         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6909         unwind-resume in csu subdir.
6910         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6911         exceptions.
6912         (librt-sysdep_routines, librt-shared-only-routines): Add
6913         rt-unwind-resume.
6914         * sysdeps/pthread/rt-unwind-resume.c: New file.
6915         * unwind-forcedunwind.c: New file.
6916         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6917         (libpthread-shared-only-routines): Likewise.
6918         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6919         * pthreadP.h (pthread_cancel_init): New prototype.
6920         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6921
6922         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6923         attr argument const struct pthread_attr *.
6924
6925         * res.c (__res_state): Return __resp.
6926         * descr.h: Include resolv.h.
6927         (struct pthread): Add res field.
6928         * pthread_create.c: Include resolv.h.
6929         (start_thread): Initialize __resp.
6930         * Makefile (tests): Add tst-_res1.
6931         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6932         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6933         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6934         libpthread.
6935         * tst-_res1.c: New file.
6936         * tst-_res1mod1.c: New file.
6937         * tst-_res1mod2.c: New file.
6938
6939 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6940
6941         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6942
6943         * Makefile: Define various *-no-z-defs variables for test DSOs
6944         which has undefined symbols.
6945
6946 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6947
6948         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6949         Retry if the stwcx fails to store once_control.
6950
6951 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6952
6953         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6954         pthread_attr_setaffinity.
6955         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6956         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6957         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6958         * pthread_attr_destroy.c: Free cpuset element if allocated.
6959         * pthread_create.c: Pass iattr as additional parameter to
6960         create_thread.
6961         * sysdeps/pthread/createthread.c: If attribute is provided and
6962         a new thread is created with affinity set or scheduling parameters,
6963         start thread with CLONE_STOPPED.
6964         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6965         pthread_attr_setaffinity.
6966         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6967         cpuset element.
6968
6969 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6970
6971         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6972
6973 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6974
6975         * sysdeps/pthread/configure.in: Require CFI directives also for
6976         ppc and s390.
6977
6978 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6979
6980         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6981         Add cfi directives.
6982
6983 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6984
6985         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6986         CLEANUP_JMP_BUF.
6987         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6988         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6989         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6990         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6991         not self pointer in __writer.  Compare with TID to determine
6992         deadlocks.
6993         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6994         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6995         Likewise.
6996         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6997         Likewise.
6998         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6999         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7000         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
7001         macros also when compiling librt.
7002
7003 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
7004
7005         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
7006         -fasynchronous-unwind-tables.
7007         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
7008         (PSEUDO): Add cfi directives.
7009         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
7010         Likewise.
7011         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
7012         Likewise.
7013
7014 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
7015
7016         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
7017         __pthread_unregister_cancel): Add prototypes and hidden_proto.
7018         * unwind.c (__pthread_unwind_next): Add hidden_def.
7019         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
7020         Likewise.
7021         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
7022         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
7023         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
7024         Likewise.
7025         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
7026         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
7027         Likewise.
7028         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
7029         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
7030         __pthread_unregister_cancel and __pthread_unwind_next.
7031
7032 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
7033
7034         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
7035         different symbol for the cancellation syscall wrapper and
7036         non-cancellation syscall wrapper.
7037         (PSEUDO_END): Define.
7038
7039 2003-07-05  Richard Henderson  <rth@redhat.com>
7040
7041         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
7042         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
7043         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7044         return actual return value from the syscall, not 0.
7045
7046 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
7047
7048         * descr.h (struct pthread): Add pid field.
7049         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
7050         (__reclaim_stacks): Likewise.
7051         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
7052         also check for PID of the signal source.
7053         (__pthread_initialize_minimal_internal): Also initialize pid field
7054         of initial thread's descriptor.
7055         * pthread_cancel.c: Use tgkill instead of tkill if possible.
7056         * sysdeps/unix/sysv/linux/fork.c: Likewise.
7057         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
7058         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
7059         * sysdeps/unix/sysv/linux/raise.c: Likewise.
7060
7061 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
7062
7063         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
7064         Fix use of parameter.
7065         (__libc_cleanup_pop): Likewise.
7066
7067 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
7068
7069         * init.c (sigcancel_handler): Change parameters to match handler
7070         for SA_SIGACTION.  Check signal number and code to recognize
7071         invalid invocations.
7072
7073 2003-07-03  Roland McGrath  <roland@redhat.com>
7074
7075         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
7076         Apply sizeof (struct pthread) bias to r13 value.
7077
7078 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
7079
7080         * sysdeps/pthread/configure.in: Require CFI directives.
7081
7082         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
7083         definition.
7084         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
7085         libpthread compilation.
7086         * unwind.c (__pthread_unwind): Add hidden_def.
7087         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
7088
7089 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
7090
7091         * libc-cancellation.c (__libc_cleanup_routine): Define.
7092         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
7093         (__pthread_cleanup_pop): Define.
7094
7095 2003-07-01  Richard Henderson  <rth@redhat.com>
7096
7097         * sysdeps/alpha/elf/pt-initfini.c: New file.
7098         * sysdeps/alpha/pthread_spin_lock.S: New file.
7099         * sysdeps/alpha/pthread_spin_trylock.S: New file.
7100         * sysdeps/alpha/pthreaddef.h: New file.
7101         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
7102         * sysdeps/alpha/tls.h: New file.
7103         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
7104         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
7105         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
7106         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
7107         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
7108         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
7109         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
7110         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
7111         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
7112         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
7113
7114 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
7115
7116         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
7117         cleanup support and unwind info.
7118
7119 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
7120
7121         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
7122         Use correct cleanup handler registration.  Add unwind info.
7123         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
7124         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
7125         * tst-once3.c: Add cleanup handler and check it is called.
7126         * tst-once4.c: Likewise.
7127         * tst-oncex3.c: New file.
7128         * tst-oncex4.c: New file.
7129         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
7130
7131 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
7132
7133         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
7134
7135 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
7136
7137         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
7138         (tf_msgsnd): Likewise.
7139
7140         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
7141         premature returns a bit more.
7142
7143 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
7144
7145         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
7146         definition to the front.
7147
7148         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
7149         the cleanup functions to make the names unique.  Fix dwarf opcode
7150         un unwind table.
7151         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
7152         functions to make the names unique.  Fix CFA offset for two blocks.
7153
7154 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
7155
7156         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
7157         missing closing braces.
7158         Patch by Christophe Saout <christophe@saout.de>.
7159
7160 2003-06-24  Roland McGrath  <roland@redhat.com>
7161
7162         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
7163
7164 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
7165
7166         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
7167         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
7168
7169         * pthreadP.h: Declare __find_thread_by_id.
7170         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
7171         * pthread_clock_gettime.c: Allow using other thread's clock.
7172         * pthread_clock_settime.c: Likewise.
7173         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
7174         * Makefile: Add rules to build and run tst-clock2.
7175         * tst-clock2.c: New file.
7176
7177 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
7178
7179         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
7180         to use exception-based cleanup handler.
7181         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7182
7183         * tst-cond8.c (ch): Announce that we are done.
7184
7185         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
7186
7187         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
7188         Also test aio_suspend with timeout value.
7189
7190 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
7191
7192         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
7193         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
7194         attribute_hidden.
7195
7196         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
7197         (__pthread_mutex_lock_internal): Likewise.
7198         (__pthread_mutex_unlock_internal): Likewise.
7199         (__pthread_mutex_unlock_usercnt): Declare.
7200         * pthread_mutex_destroy.c: Always fail if used in any way.
7201         * pthread_mutex_init.c: Update comment.
7202         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
7203         * pthread_mutex_timedlock.c: Adjust __nusers.
7204         * pthread_mutex_trylock.c: Adjust __nusers.
7205         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
7206         and public interfaces are wrapper with pass additional parameter.
7207         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
7208         parameter zero.
7209         * tst-mutex8.c: New file.
7210         * Makefile (tests): Add tst-mutex8.
7211         * sysdeps/pthread/pthread_cond_timedwait.c: Call
7212         __pthread_mutex_unlock_usercnt.
7213         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7214         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7215         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7216         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7217         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7218         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
7219         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7220         Add __nusers.
7221         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7222         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7223         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7224         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7225         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7226
7227         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
7228         * pthread_mutex_timedlock.c: Likewise.
7229         * pthread_mutex_trylock.c: Adjust __nusers.
7230         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
7231         * tst-mutex9.c: New file.
7232         * Makefile (tests): Add tst-mutex9.
7233         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
7234         * sysdeps/ia64/tls.h: Likewise.
7235         * sysdeps/powerpc/tls.h: Likewise.
7236         * sysdeps/s390/tls.h: Likewise.
7237         * sysdeps/sh/tls.h: Likewise.
7238         * sysdeps/x86_64/tls.h: Likewise.
7239         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7240         Change type of __owner.
7241         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7242         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7243         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7244         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7245         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7246
7247 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
7248
7249         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
7250         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
7251
7252         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
7253         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
7254         instead of nr to lll_futex_wake.  Only set errno and return -1
7255         if err < 0.
7256
7257         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
7258         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7259         return actual return value from the syscall, not 0.
7260
7261 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
7262
7263         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
7264         find a random value.
7265         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
7266         errno==EIDRM.
7267
7268         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
7269         compat_timer_settime.
7270         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
7271         compat_timer_gettime.
7272         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
7273         compat_timer_getoverrun.
7274         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
7275         compat_timer_delete.
7276
7277         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7278         error-checking mutex detect busy mutexes.
7279
7280 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7281
7282         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7283         Add ax to clobber list.
7284         (lll_mutex_cond_lock): Likewise.
7285         (lll_mutex_unlock): Likewise.
7286         (lll_lock): Likewise.
7287         (lll_unlock): Likewise.
7288
7289         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7290         * tst-cancel18.c: New file.
7291         * tst-cancelx18.c: New file.
7292
7293         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7294         and tcdrain.
7295
7296         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7297         * tst-cancel17.c: New file.
7298         * tst-cancelx17.c: New file.
7299
7300         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7301         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7302         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7303
7304         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7305
7306 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7307
7308         * sysdeps/pthread/createthread.c (create_thread): Set
7309         header.multiple_threads unconditionally.
7310         * allocatestack.c (allocate_stack): Likewise.
7311         * descr.h (struct pthread): Add header.multiple_threads
7312         unconditionally.
7313         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7314         Define for librt.  #error if neither libpthread, libc nor librt.
7315         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7316         Likewise.
7317         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7318         CDISABLE): Likewise.
7319         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7320         CDISABLE): Likewise.
7321         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7322         CDISABLE): Likewise.
7323         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7324         CDISABLE): Likewise.  Access header.multiple_threads outside of
7325         libc and libpthread.
7326         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7327         Likewise.
7328         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7329         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7330
7331 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7332
7333         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7334         Also test early cancellation before the thread reaches the cancellation
7335         point.
7336
7337         * Makefile: Compile forward.c with exceptions.
7338
7339         * sysdeps/unix/sysv/linux/sleep.c: New file.
7340
7341 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7342
7343         * Makefile: Add CFLAGS definition to compile function wrappers
7344         duplicated from libc with exceptions.
7345         * tst-cancel4.c: Also check cancellation handlers.
7346
7347         * Makefile: Add rules to build and run tst-cancel16 and
7348         tst-cancelx16.  Add missing CFLAGS definitions.
7349         * tst-cancel16.c: New file.
7350         * tst-cancelx16.c: New file.
7351
7352 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7353
7354         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7355         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7356         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7357         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7358
7359         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7360         (LIBC_CANCEL_RESET): Likewise.
7361         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7362         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7363         librt-cancellation.
7364         (CFLAGS-libcrt-cancellation.c): Define.
7365         * sysdeps/pthread/librt-cancellation.c: New file.
7366         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7367         macros also when compiling librt.
7368         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7369         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7370         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7371         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7372         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7373         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7374         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7375
7376         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7377         compat_timer_create.
7378
7379 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7380
7381         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7382
7383         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7384         __register_atfork.
7385         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7386         Add libc_hidden_def.
7387
7388 2003-06-13  Roland McGrath  <roland@redhat.com>
7389
7390         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7391         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7392
7393 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7394
7395         * allocatestack.c (queue_stack): Always inline.
7396         * ptreadhP.h (__do_cancel): Likewise.
7397
7398 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7399
7400         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7401         a typo.
7402
7403 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7404
7405         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7406         (__pthread_cond_signal): Remove incorrect second addition for
7407         cond_lock!=0.
7408
7409 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7410
7411         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7412         (__pthread_cond_signal): Use correct futex pointer in
7413         __lll_mutex_lock_wait call.
7414
7415         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7416         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7417
7418 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7419
7420         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7421         cancelable.
7422         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7423         Likewise.
7424
7425         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7426         hand-written CFI generation code.  Since ENTRY/END also initiated
7427         CFI frames this caused two CFI sets to be generated.
7428
7429 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7430
7431         * cleanup_routine.c: New file.
7432         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7433         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7434         cleanup handling.
7435         * Makefile (libpthread-routines): Add cleanup_routine.
7436         Add more CFLAGS variables to compile with exceptions.  Add comments
7437         why which file needs unwind tables.
7438         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7439         tests.
7440         * tst-cancelx1.c: New file.
7441         * tst-cancelx2.c: New file.
7442         * tst-cancelx3.c: New file.
7443         * tst-cancelx4.c: New file.
7444         * tst-cancelx5.c: New file.
7445         * tst-cancelx6.c: New file.
7446         * tst-cancelx7.c: New file.
7447         * tst-cancelx8.c: New file.
7448         * tst-cancelx9.c: New file.
7449         * tst-cancelx10.c: New file.
7450         * tst-cancelx11.c: New file.
7451         * tst-cancelx12.c: New file.
7452         * tst-cancelx13.c: New file.
7453         * tst-cancelx14.c: New file.
7454         * tst-cancelx15.c: New file.
7455         * tst-cleanupx0.c: New file.
7456         * tst-cleanupx0.expect: New file.
7457         * tst-cleanupx1.c: New file.
7458         * tst-cleanupx2.c: New file.
7459         * tst-cleanupx3.c: New file.
7460
7461         * tst-cleanup0.c: Make standard compliant.
7462         * tst-cleanup1.c: Likewise.
7463
7464         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7465         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7466         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7467         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7468         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7469         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7470         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7471         CLEANUP_JMP_BUF.
7472         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7473         * tst-cancel12.c: New file.
7474         * tst-cancel13.c: New file.
7475         * tst-cancel14.c: New file.
7476         * tst-cancel15.c: New file.
7477         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7478         and tst-cancel15.
7479
7480         * tst-cancel1.c: Add some comments.
7481
7482         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7483         timeout correctly.
7484
7485 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7486
7487         * Makefile (CFLAGS-pthread_cancel.c): Define.
7488
7489 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7490
7491         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7492         Change type of __writer element to int.
7493         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7494         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7495         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7496         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7497         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7498         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7499         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7500         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7501         Compare with TID to determine deadlocks.
7502         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7503         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7504         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7505         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7506         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7507         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7508         Likewise.
7509         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7510         Likewise.
7511         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7512         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7513         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7514         Likewise.
7515         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7516         Likewise.
7517         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7518         * Makefile (tests): Add tst-rwlock12.
7519         * tst-rwlock12.c: New file.
7520
7521 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7522
7523         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7524         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7525         Remove bogus hidden_proto.
7526         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7527         Likewise.
7528         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7529         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7530         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7531         ___lll_mutex_timedlock): Likewise.
7532
7533 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7534
7535         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7536         (__pthread_cond_signal): Add some code to eventually handle
7537         cond_lock!=0.
7538
7539 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7540
7541         * Makefile (tests): Add tst-exec4.
7542         (tst-exec4-ARGS): Define.
7543         * tst-exec4.c: New file.
7544
7545 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7546
7547         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7548         Also fail if tv_nsec < 0.
7549         (__lll_timedwait_tid): Likewise.
7550         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7551         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7552         Likewise.
7553         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7554         Likewise.
7555         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7556         Likewise.
7557         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7558         Likewise.
7559         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7560         Likewise.
7561         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7562         Likewise.
7563
7564         * Makefile (tests): Add tst-sem8 and tst-sem9.
7565         * tst-sem8.c: New file.
7566         * tst-sem9.c: New file.
7567         * sem_open.c: Fix creation of in_use record if the file exists but
7568         no internal record.
7569
7570         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7571         definitions.
7572
7573         * sysdeps/pthread/timer_create.c (timer_create): In case
7574         evp==NULL, assign timer ID to sival_ptr.
7575
7576         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7577         struct pthread_unwind_buf *.
7578         (struct pthread): Likewise for cleanup_jmp_buf element.
7579
7580         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7581         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7582         * unwind.c (__pthread_unwind_next): Likewise.
7583
7584 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7585
7586         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7587         (lll_futex_timed_wait): Use int for futex value parameter.
7588         (lll_futex_wake): Likewise.
7589         (lll_futex_requeue): Likewise.
7590
7591         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7592         Replace one memory operation with one register operation.
7593
7594         * tst-join4.c (do_test): Fix error message.
7595
7596         * tst-rwlock6.c (do_test): Use correct format specifier.
7597
7598         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7599         (__lll_mutex_lock_wait): Replace one memory operation with one
7600         register operation.
7601         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7602         (__lll_mutex_lock_wait): Likewise.
7603
7604         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7605         (__lll_mutex_cond_lock): Add one to value parameter of
7606         __lll_lock_wait to reflect reality in the futex syscall.
7607         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7608         (lll_mutex_cond_lock): Likewise.
7609
7610 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7611
7612         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7613         New function.
7614         (lll_mutex_cond_lock): Define.
7615
7616 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7617
7618         * Makefile (tests): Add tst-signal6.
7619         * tst-signal6.c: New file.
7620
7621         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7622         (__lll_mutex_unlock_force): New function
7623         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7624
7625         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7626         (__lll_mutex_unlock_force): New function.
7627         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7628
7629         * tst-rwlock7.c (do_test): Use correct format specifier.
7630
7631         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7632         Find break parameter in correct asm argument.
7633
7634 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7635
7636         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7637         Remove out4.
7638         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7639         error occured.
7640         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7641         Add __mutex.
7642         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7643         lll_futex_requeue, lll_mutex_unlock_force): Define.
7644
7645 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7646
7647         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7648         (pthread_cond_t): Add __mutex.
7649         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7650         lll_futex_requeue, lll_mutex_unlock_force): Define.
7651
7652 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7653
7654         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7655         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7656         Add __mutex field.
7657         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7658         Define.
7659         (lll_futex_wait, lll_futex_wake): Define.
7660         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7661         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7662         FUTEX_REQUEUE instead of FUTEX_WAIT.
7663         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7664         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7665         mutex which was used in condvar structure.  Call
7666         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7667         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7668
7669         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7670         include tcb-offsets.h.  Read wakeup value in locked region.
7671         Use the value of gbr register as THREAD_ID.
7672         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7673         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7674         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7675
7676         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7677         macros.
7678
7679 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7680
7681         * sysdeps/pthread/pthread_cond_broadcast.c
7682         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7683
7684 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7685
7686         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7687         typo in register name.
7688         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7689         correctly.  Actually use requeue.  Little optimization.
7690         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7691         mutex address early.  Handle cancellation state as 32-bit value.
7692         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7693         Remove unnecessary label.
7694
7695 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7696
7697         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7698         instead of FUTEX_WAIT.
7699         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7700         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7701         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7702         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7703         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7704         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7705         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7706         of __pthread_mutex_lock_internal.
7707         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7708         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7709         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7710         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7711         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7712         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7713         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7714         Add pthread_mutex_cond_lock.
7715         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7716         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7717         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7718         lll_mutex_cond_lock.
7719         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7720         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7721         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7722         Add __mutex field.
7723         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7724         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7725
7726         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7727         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7728
7729         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7730         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7731         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7732         macro don't define aliases.
7733
7734         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7735         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7736         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7737         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7738         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7739         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7740         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7741         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7742         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7743
7744 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7745
7746         * sem_open.c: Fix one endless loop.  Implement correct semantics
7747         wrt opening the same semaphore more then once.
7748         * sem_close.c: Adjust for sem_open change.
7749         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7750         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7751         * Makefile (tests): Add tst-sem7.
7752         * tst-sem7.c: New file.
7753
7754 2003-05-16  Roland McGrath  <roland@redhat.com>
7755
7756         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7757         uninitialized variable braino.
7758
7759 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7760
7761         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7762         test for syscall availability.
7763
7764         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7765         __no_posix_timers to -1 if the syscalls don't exist.
7766
7767         * pthread_join.c (pthread_join): Set tid field of the joined
7768         thread to -1.  This isn't necessary but helps to recognize some
7769         error conditions with almost no cost.
7770
7771         * allocatestack.c (FREE_P): Also negative values indicate an
7772         unused stack.
7773
7774         * unwind.c: Include <unistd.h>.
7775
7776 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7777
7778         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7779
7780 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7781
7782         * Makefile (crti-objs, crtn-objs): New variables.
7783         (omit-deps, extra-objs): Add crtn.
7784         ($(objpfx)libpthread.so): Depend on both crti and crtn
7785         and links to them in multidir.
7786         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7787
7788 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7789
7790         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7791         (lll_mutex_unlock): Use atomic_exchange_rel.
7792
7793 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7794
7795         * cond-perf.c (cons): Add missing locking around setting of alldone.
7796
7797 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7798
7799         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7800         related macros.
7801         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7802
7803 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7804
7805         * tst-sem6.c: New file.
7806         * Makefile (tests): Add tst-sem6.
7807
7808         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7809         Use atomic_exchange_rel instead of atomic_exchange.
7810         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7811         Likewise.
7812
7813         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7814         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7815         vsyscall is possible.
7816
7817         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7818         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7819         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7820         pthread_setaffinity_np.
7821         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7822         and pthread_setaffinity_np.
7823         * Makefile (libpthread-routines): Add pthread_getaffinity and
7824         pthread_setaffinity.
7825
7826         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7827         use it in case mmap to allocate the stack fails.
7828         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7829         ARCH_MAP_FLAGS here.
7830         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7831         ARCH_RETRY_MMAP.
7832
7833 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7834
7835         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7836         handler implementation.  It is now lockless in fork().
7837         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7838         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7839         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7840         declare the __fork_*_lists.
7841         (struct fork_handler): Include pointers to all three functions.
7842         Add next, refcntr and need_signal elements.
7843         (__fork_handlers): New declaration.
7844         (__register_atfork_malloc): Remove declaration.
7845         (HAVE_register_atfork_malloc): Remove definition.
7846         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7847         __pthread_child_handler variable.
7848         (__libc_pthread_init): Use __register_atfork instead of explicitly
7849         adding to the list.
7850         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7851         and lll_futex_wake.
7852         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7853
7854         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7855         function must never be reached.
7856
7857         * cond-perf.c: New file.
7858
7859 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7860
7861         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7862
7863 2003-05-04  Roland McGrath  <roland@redhat.com>
7864
7865         * Makefile ($(objpfx)../libc.so): New target.
7866
7867 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7868
7869         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7870         (pthread_condattr_t): Size is only an int, don't use long for
7871         alignment.
7872         (pthread_mutexattr_t): Likewise.
7873         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7874         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7875         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7876
7877 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7878
7879         * sysdeps/i386/tls.h: Define THREAD_ID.
7880         * sysdeps/ia64/tls.h: Likewise.
7881         * sysdeps/powerpc/tls.h: Likewise.
7882         * sysdeps/s390/tls.h: Likewise.
7883         * sysdeps/sh/tls.h: Likewise.
7884         * sysdeps/x86_64/tls.h: Likewise.
7885         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7886         record ownership.
7887         * pthread_mutex_timedlock.c: Likewise.
7888         * pthread_mutex_trylock.c: Likewise.
7889         * pthread_mutex_unlock.c: Likewise.
7890         * pthread_rwlock_trywrlock.c: Likewise.
7891         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7892         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7893         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7894         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7895
7896         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7897         flag.
7898
7899 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7900
7901         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7902         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7903         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7904         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7905         Make __align long long instead of long.
7906         (pthread_rwlock_t): Formatting.
7907         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7908         (pthread_rwlock_t): Formatting.
7909         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7910         (pthread_cond_t): Make __align long long instead of long.
7911         (pthread_rwlock_t): Move __flags field to the same position as in
7912         linuxthreads.
7913
7914 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7915
7916         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7917         * tst-rwlock7.c (do_test): Likewise.
7918
7919 2003-04-26  Roland McGrath  <roland@redhat.com>
7920
7921         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7922
7923 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7924
7925         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7926         sizeof (struct pthread).
7927         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7928         1 struct pthread.
7929         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7930         to 0.
7931         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7932         struct pthread.
7933         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7934         to 32-bit bytes.
7935         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7936         tcbp.
7937         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7938         unneccessarily.
7939         (NO_TLS_OFFSET): Define.
7940         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7941         add TLS_TCB_SIZE unnecessarily.
7942
7943 2003-04-22  Roland McGrath  <roland@redhat.com>
7944
7945         * Makeconfig (shared-thread-library): Reverse link order to work
7946         around linker bug.
7947
7948 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7949
7950         * semaphore.h: Fix typo in comment.
7951
7952 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7953
7954         * sysdeps/pthread/sigfillset.c: New file.
7955
7956         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7957         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7958         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7959         * sysdeps/pthread/sigaction.c: Likewise.
7960         * sysdeps/pthread/sigprocmask.c: New file.
7961         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7962         __SIGRTMIN+1.
7963         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7964         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7965         in this case.
7966
7967 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7968
7969         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7970         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7971
7972         * sysdeps/unix/sysv/linux/unregister-atfork.c
7973         (__unregister_atfork): Don't free memory not allocated dynamically.
7974
7975         * semaphore.h: Remove __THROW marker from cancellation points.
7976         * nptl/sysdeps/pthread/pthread.h: Likewise.
7977
7978 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7979
7980         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7981         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7982         __THROW.
7983
7984 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7985
7986         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7987
7988 2003-04-15  Roland McGrath  <roland@redhat.com>
7989
7990         * forward.c (__pthread_unwind): Tweak to avoid warning.
7991
7992 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7993
7994         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7995
7996 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7997
7998         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7999         overflow CFA advance instructions.
8000         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8001
8002 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
8003
8004         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
8005         * sysdeps/i386/pthread_spin_lock.c: Likewise.
8006         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
8007         defined.
8008
8009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
8010         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
8011         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
8012         DW_CFA_advance_loc for .Laddl-.Lsubl.
8013
8014 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
8015
8016         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
8017         position-independent unwind data for static libraries.
8018         Add missing unwind info.  Add comments.
8019
8020         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
8021         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8022         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8023         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8024
8025 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
8026
8027         * Makefile: Make sure all cancellation points are compiled with
8028         exception and asynchronous unwind tables.
8029
8030         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
8031         which mishandles loading of global object addresses in PIC.
8032         (THREAD_SETMEM_NC): Likewise.
8033
8034 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
8035
8036         * pthread.h: Define new data structure for cleanup buffer.  Declare
8037         new cleanup handler interfaces.
8038         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
8039         (struct pthread): Add cleanup_jmp_buf pointer.  Define
8040         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
8041         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
8042         it.  Declare old cleanup handler installation functions.
8043         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
8044         handling.
8045         * cleanup_defer.c: Likewise.
8046         * cleanup_compat.c: New file.  Old cleanup code.
8047         * cleanup_def_compat.c: New file.  Old cleanup code.
8048         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
8049         if own thread descriptor.
8050         * unwind.c: New file.
8051         * forward.c: Add __pthread_unwind.
8052         * init.c (pthread_functions): Add __pthread_unwind.
8053         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
8054         Add ptr___pthread_unwind.
8055         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
8056         and unwind function.
8057         * Makefile (libpthread-routines): Add cleanup_compat,
8058         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
8059         table generation if necessary.
8060         * version.c: Record whether unwind support is compiled in.
8061         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
8062         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
8063         handler interfaces.
8064         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
8065         complication to generate unwind information for syscall wrappers.
8066         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
8067         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
8068         __cleanup_fct_attribute.
8069
8070         * Makefile: Add rules to build and run tst-cleanup0.
8071         * tst-cleanup0.c: New file.
8072         * tst-cleanup0.expect: New file.
8073
8074         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
8075         caller.  Optimize to avoid often unecessary local variable.
8076
8077 2003-04-11  Roland McGrath  <roland@redhat.com>
8078
8079         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
8080         sets variable `multidir'; include that.
8081         (generated): Add it.
8082         ($(objpfx)$(multidir)/crti.o): New target.
8083         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
8084
8085 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
8086
8087         * tst-attr2.c (do_test): Add cast to avoid warning.
8088         * tst-mutex4.c (do_test): Likewise.
8089
8090 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
8091
8092         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
8093         in child.
8094
8095 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
8096
8097         * Makefile (tests): Add tst-detach1.
8098         * tst-detach1.c: New file.
8099
8100 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
8101
8102         * sysdeps/pthread/pthread.h: Remove duplicate
8103         pthread_cleanup_{push,pop} definitions.
8104
8105         * tst-barrier2.c: Eliminate warnings.
8106         * tst-cancel4.c: Likewise.
8107         * tst-cond4.c: Likewise.
8108         * tst-cond6.c: Likewise.
8109         * tst-detach1.c: Likewise.
8110         * tst-rwlock4.c: Likewise.
8111         * tst-rwlock6.c: Likewise.
8112         * tst-rwlock7.c: Likewise.
8113         * tst-sem3.c: Likewise.
8114         * tst-spin2.c: Likewise.
8115         * tst-umask1.c: Likewise.
8116
8117 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
8118
8119         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
8120
8121 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
8122
8123         * descr.h (struct pthread): Move cancelhandling member to the front.
8124
8125 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
8126
8127         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
8128         malloc_parent, and malloc_child statically.
8129         (__register_atfork_malloc): New function.
8130         (free_mem): Don't free any of the malloc_* variables on the list.
8131         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
8132         Define HAVE_register_atfork_malloc.
8133
8134 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
8135
8136         * sysdeps/pthread/createthread.c (create_thread): Add some more
8137         comments explaining when to set multiple_threads and when not.
8138
8139         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8140         THREAD_ATOMIC_BIT_SET if not already defined.
8141         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8142         THREAD_ATOMIC_BIT_SET:
8143         * sysdeps/x86_64/tls.h: Likewise.
8144         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
8145         THREAD_ATOMIC_CMPXCHG_VAL.
8146         (_pthread_cleanup_pop_restore): Likewise.
8147         * cancellation.c (__pthread_enable_asynccancel): Likewise.
8148         (__pthread_enable_asynccancel_2): Likewise.
8149         (__pthread_disable_asynccancel): Likewise.
8150         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8151         (__libc_disable_asynccancel): Likewise.
8152         * init.c (sigcancel_handler): Likewise.
8153         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
8154         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
8155
8156 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
8157
8158         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
8159         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8160         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
8161         * Makefile (tests): Add tst-cancel11.
8162         * tst-cancel11.c: New file.
8163
8164 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
8165
8166         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
8167         round, not the first.  Use specific_used flag instead of local
8168         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
8169         (__free_tcb): Don't call deallocate_tsd here.
8170         (start_thread): Call deallocate_tsd here.
8171         * pthread_setspecific.c: Set specific_used flag really only when
8172         needed.
8173         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
8174         * tst-tsd3.c: New file.
8175         * tst-tsd4.c: New file.
8176
8177 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8178
8179         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
8180         Use atomic_exchange_and_add instead of __lll_add.
8181         (__lll_mutex_timedlock): Likewise.
8182         Patch by Ian Wienand.
8183
8184 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
8185
8186         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8187         (SINGLE_THREAD_P): Fix typo.
8188         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
8189
8190 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8191
8192         * Makefile (tests): Add tst-align.
8193         * tst-align.c: New file.
8194         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
8195
8196         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
8197         function correctly.
8198
8199         * tst-tsd2.c: Add casts to avoid warnings.
8200
8201 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
8202
8203         * descr.h (struct pthread): Move most often used elements to the front.
8204
8205 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
8206
8207         * Makefile (libpthread-routines): Add pthread_atfork.
8208         (libpthread-static-only-routines): Add pthread_atfork.
8209
8210 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8211
8212         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
8213         of TLS_DTV_AT_TP.
8214         (INSTALL_DTV): Add parens.
8215         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
8216         Use passed descr instead of THREAD_SELF.
8217         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
8218         (__lll_mutex_timedlock_wait): Correct expected value after
8219         spurious wakeup.
8220         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
8221         Release lock before waking up the waiters.
8222         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
8223         criteria.  Reorderstruct passed to cleanup handler.  Fix
8224         handling of cancellation and failung pthread_mutex_unlock call.
8225         Use __pthread_enable_asynccancel_2 instead of
8226         __pthread_enable_asynccancel.
8227         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8228         Return result of lock re-get if it fails.
8229         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
8230         for __pthread_cleanup_push.
8231         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
8232         completely broken rwlock implementation.
8233         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8234         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8235         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8236         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
8237         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8238         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
8239         versioned_symbol macro.
8240         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
8241         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8242
8243 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
8244
8245         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
8246         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
8247         and __helper_tid.
8248         (struct timer): Remove th and bar field.
8249         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
8250         debugging code.  Create only one helper thread.
8251         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
8252         helper thread.
8253         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8254         Renamed.  Define statically.  Use thread info from siginfo.
8255         (__helper_once): New variable.
8256         (__helper_tid): New variable.
8257         (__reset_helper_control): New function.
8258         (__start_helper_thread): New function.
8259
8260         * pthread_create.c (start_thread): Don't use setjmp inside
8261         __builtin_expect to work around gcc bug.
8262
8263         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
8264         timer_delete syscall fails, but not with ENOSYS, set
8265         __no_posix_timers.
8266
8267         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
8268         (timer_settime): Fix typo.
8269         * sysdeps/unix/sysv/linux/timer_getoverr.c
8270         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
8271
8272 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
8273
8274         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
8275         offset of cleanupbuf.__prev.
8276
8277 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8278
8279         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8280         of included file.
8281
8282 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8283
8284         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8285         NULL provide default definition to syscall.
8286
8287 2003-03-25  Roland McGrath  <roland@redhat.com>
8288
8289         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8290         (timer_id2ptr): Fix typo.
8291
8292 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8293
8294         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8295         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8296         * sysdeps/ia64/pthreaddef.h: Likewise.
8297         * sysdeps/powerpc/pthreaddef.h: Likewise.
8298         * sysdeps/s390/pthreaddef.h: Likewise.
8299         * sysdeps/sh/pthreaddef.h: Likewise.
8300         * sysdeps/x86_64/pthreaddef.h: Likewise.
8301         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8302         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8303         being changed.
8304         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8305         SIGTIMER is not unblocked.
8306         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8307         RT signal taken.
8308         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8309         be send.
8310         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8311         pass pointer through as ID.
8312         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8313         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8314         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8315         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8316         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8317         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8318         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8319         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8320         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8321         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8322         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8323         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8324         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8325         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8326         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8327         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8328         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8329         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8330         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8331         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8332         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8333         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8334         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8335         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8336         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8337         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8338         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8339         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8340         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8341         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8342         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8343         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8344         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8345
8346         * pthreadP.h: Remove FRAME_LEFT definition.
8347         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8348         already left frame.  Programs which have this problem are not POSIX
8349         compliant.
8350         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8351
8352 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8353
8354         * sysdeps/pthread/tst-timer.c: Check return values of the
8355         functions we test.
8356
8357 2003-03-23  Roland McGrath  <roland@redhat.com>
8358
8359         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8360         * tst-tls3mod.c: Likewise.
8361         * tst-tls1.c: Likewise.
8362         * tst-tls2.c: Likewise.
8363
8364         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8365         undefined behavior.
8366
8367         * tst-join5.c (tf1, tf2): Add a cast.
8368
8369         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8370
8371         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8372         Don't test anything.
8373         * tst-cond4.c: Likewise.
8374         * tst-cond6.c: Likewise.
8375         * tst-flock2.c: Likewise.
8376         * tst-mutex4.c: Likewise.
8377         * tst-rwlock4.c: Likewise.
8378         * tst-signal1.c: Likewise.
8379         * tst-spin2.c: Likewise.
8380         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8381
8382         * tst-mutex4.c: Use test-skeleton.c.
8383         * tst-spin2.c: Likewise.
8384         * tst-sysconf.c: Likewise.
8385         * tst-barrier2.c: Likewise.
8386         * tst-cond4.c: Likewise.
8387         * tst-cond6.c: Likewise.
8388         * tst-rwlock4.c: Likewise.
8389         * tst-unload.c: Likewise.
8390         * tst-flock2.c (do_test): Use return instead of exit.
8391
8392 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8393
8394         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8395
8396 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8397
8398         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8399         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8400         instead of __lll_compare_and_swap.
8401         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8402         Likewise.
8403         Removed definition if __lll_compare_and_swap.
8404
8405         * cancellation.c: Adjust for new form of compare&exchange macros.
8406         * cleanup_defer.c: Likewise.
8407         * init.c: Likewise.
8408         * libc-cancellation.c: Likewise.
8409         * old_pthread_cond_broadcast.c: Likewise.
8410         * old_pthread_cond_signal.c: Likewise.
8411         * old_pthread_cond_timedwait.c: Likewise.
8412         * old_pthread_cond_wait.c: Likewise.
8413         * pthread_cancel.c: Likewise.
8414         * pthread_create.c: Likewise.
8415         * pthread_detach.c: Likewise.
8416         * pthread_join.c: Likewise.
8417         * pthread_key_delete.c: Likewise.
8418         * pthread_setcancelstate.c: Likewise.
8419         * pthread_setcanceltype.c: Likewise.
8420         * pthread_timedjoin.c: Likewise.
8421         * pthread_tryjoin.c: Likewise.
8422         * sysdeps/pthread/createthread.c: Likewise.
8423
8424 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8425
8426         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8427         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8428         definitions.  Replace uses with calls to atomic_* functions.
8429         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8430         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8431         __lll_test_and_set calls with atomic_exchange_and_add and
8432         atomic_exchange calls respectively.
8433         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8434         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8435         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8436         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8437         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8438         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8439         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8440
8441         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8442         returns the old value.
8443
8444 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8445
8446         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8447         int for variable OLDVAL and correct inline assembler contraint.
8448         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8449         type int for variable OLD.
8450
8451         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8452         only for s390-32.
8453         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8454         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8455         instead of multiple_threads field in the TCB.
8456
8457 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8458
8459         * sysdeps/i386/i686/bits/atomic.h: Removed.
8460         * sysdeps/i386/i586/bits/atomic.h: Removed.
8461         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8462         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8463         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8464         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8465         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8466         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8467         * atomic.h: Removed.  Moved to glibc.
8468
8469         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8470         support for clock selection.
8471
8472         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8473         signalling waiters.
8474
8475 2003-03-18  Roland McGrath  <roland@redhat.com>
8476
8477         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8478         Add __lll_rel_instr first.  Add memory clobber.
8479         (lll_mutex_unlock): Use __lll_test_and_set.
8480         From Paul Mackerras <paulus@samba.org>.
8481
8482         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8483         unconditionally.
8484         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8485         (SINGLE_THREAD_P):  Add `header.' prefix.
8486         From Paul Mackerras <paulus@samba.org>.
8487
8488         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8489         pthread_timedjoin_np to ...
8490         (libpthread: GLIBC_2.3.3): ... here.
8491         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8492
8493         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8494         Avoid shadowing VAL variable.
8495
8496         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8497         New macro.
8498
8499 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8500
8501         * Makefile (tests): Add tst-cond11.
8502         * tst-cond11.c: New file.
8503
8504         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8505         struct passed to cleanup handler to eliminate one more
8506         instruction.
8507         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8508
8509         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8510         (pthrad_cond_t): Replace __unused field with __clock.
8511
8512         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8513         waken all waiters in cleanup handler.
8514         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8516
8517         * pthread_condattr_getclock.c: New file.
8518         * pthread_condattr_setclock.c: New file.
8519         * sysdeps/pthread/pthread.h: Declare these new functions.
8520         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8521         * Makefile (libpthread-routines): Add the new functions.
8522         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8523         Renamed field to value.  Document use of the bits.
8524         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8525         change.
8526         * pthread_condattr_setpshared.c: Likewise.
8527         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8528         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8529         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8530         Add __clock field.
8531         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8532         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8533         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8534         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8535         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8536         Implement clock selection.
8537         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8538         * pthread-errnos.sym: Add ENOSYS.
8539         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8540         _POSIX_CLOCK_SELECTION.
8541         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8542
8543         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8544         invalid .size directive.
8545
8546 2003-03-17  Roland McGrath  <roland@redhat.com>
8547
8548         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8549         Formatting tweaks.
8550
8551 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8552
8553         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8554         Use __lll_add instead of spelling it out.  Use protected symbol names.
8555         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8556         Use __lll_add.
8557         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8558         Renamed from lll_compare_and_swap.  Use new name where necessary.
8559         (__lll_add): Defined.
8560         (__lll_dec_if_positive): Defined.
8561         (__lll_test_and_set): Defined.
8562         * sysdeps/ia64/pthread_spin_init.c: Removed.
8563         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8564         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8565         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8566         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8567         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8568         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8569         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8570         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8571         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8572         __sync_lock_release_si.
8573         Patch by Jakub Jelinek.
8574
8575         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8576         Fix timeout handling.
8577         (__lll_timedwait_tid): Likewise.
8578         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8579         Patch by Jakub Jelinek.
8580
8581         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8582
8583 2003-03-17  Roland McGrath  <roland@redhat.com>
8584
8585         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8586         * sysdeps/pthread/pthread_spin_init.c: New file.
8587         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8588         * sysdeps/powerpc/Makefile: New file.
8589         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8590         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8591         * sysdeps/powerpc/pthreaddef.h: New file.
8592         * sysdeps/powerpc/tcb-offsets.sym: New file.
8593         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8594         * sysdeps/powerpc/tls.h: New file.
8595         * sysdeps/powerpc/bits/atomic.h: New file.
8596         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8597         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8598         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8599
8600         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8601         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8602         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8603         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8604         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8605         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8606         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8607         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8608         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8609         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8610         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8611         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8612         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8613         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8614         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8615
8616         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8617         not gettimeofday.
8618         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8619         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8620         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8621         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8622         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8623
8624 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8625
8626         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8627         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8628         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8629         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8630         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8631
8632 2003-03-16  Roland McGrath  <roland@redhat.com>
8633
8634         * tst-fork4.c: Include <string.h>.
8635         * tst-signal2.c: Likewise.
8636         * tst-mutex5.c (do_test): exit -> return.
8637         * tst-mutex2.c: Include <stdlib.h>.
8638
8639 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8640
8641         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8642         (__lll_mutex_timedlock_wait): Correct expected value after
8643         spurious wakeup.  Otherwise we would never wait again.
8644
8645         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8646         zone versus inline asm stupidity.  Use correct instructions.
8647
8648         * tst-rwlock6.c: Add some more status output.
8649
8650 2003-03-15  Roland McGrath  <roland@redhat.com>
8651
8652         * sysdeps/pthread/configure.in: New file.
8653         * sysdeps/pthread/configure: New file (generated).
8654
8655 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8656
8657         * allocatestack.c (allocate_stack): Store the exact stack size of
8658         user allocated stacks.
8659
8660 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8661
8662         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8663         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8664         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8665         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8666         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8667         Use `header.' prefix.
8668         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8669
8670 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8671
8672         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8673         __builtin_frame_address, use stack pointer.
8674
8675         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8676         instead of __builtin_frame_pointer.
8677
8678 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8679
8680         * tst-basic1.c (do_test): Add cast to avoid warning.
8681         * tst-basic2.c (do_test): Likewise.
8682
8683         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8684         amount of stack correction.
8685
8686         * tst-fork4.c: Use test-skeleton.c.
8687
8688 2003-03-14  Roland McGrath  <roland@redhat.com>
8689
8690         * init.c: Fix typo "#eli" for "#else".
8691
8692 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8693
8694         * allocatestack.c (__stack_user): Use hidden_data_def.
8695         * pthread_create.c (__pthread_keys): Likewise.
8696
8697         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8698
8699 2003-03-14  Roland McGrath  <roland@redhat.com>
8700
8701         * tst-fork4.c: New file.
8702         * Makefile (tests): Add it.
8703
8704         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8705         we always define the padding space.
8706         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8707         stopped supporting its own extensions fully.
8708         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8709         struct also called `header', so `header.multiple_threads' is the field
8710         name to use on all machines.
8711         * allocatestack.c (allocate_stack): Use `header.' prefix.
8712         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8713         * pthread_create.c (__pthread_create_2_1): Likewise.
8714         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8715         (THREAD_SELF): Likewise.
8716         * sysdeps/x86_64/tls.h: Likewise.
8717         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8718         (SINGLE_THREAD_P): Likewise.
8719         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8720         (SINGLE_THREAD_P): Likewise.
8721         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8722         (SINGLE_THREAD_P): Likewise.
8723
8724         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8725         value directly.
8726
8727 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8728
8729         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8730         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8731
8732         * pthread_create.c (start_thread): setjmp is expected to return 0.
8733
8734         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8735         (THREAD_GETMEM_NC): Likewise.
8736
8737 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8738
8739         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8740         and the size of the stack which must be allocated is a multiple,
8741         allocate one more page.
8742         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8743         MULTI_PAGE_ALIASING.
8744
8745 2003-03-13  Roland McGrath  <roland@redhat.com>
8746
8747         * pthread_create.c (start_thread): Set EXITING_BIT after the
8748         event-reporting (and destructors), not before.
8749
8750 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8751
8752         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8753         lll_futex_wake): Declare register variables as long int instead of
8754         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8755         Make syscall arguments clobbered by the syscall.
8756         (lll_futex_wait): Define using lll_futex_timed_wait.
8757
8758         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8759         to void *.
8760
8761         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8762         PPID if [! NDEBUG].
8763
8764         * allocatestack.c (nptl_ncreated): Only declare if
8765         COLORING_INCREMENT != 0.
8766
8767         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8768         (__libc_enable_asynccancel_2): Remove prototype.
8769
8770         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8771         ctid to match kernel.
8772
8773 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8774
8775         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8776         libc_multiple_threads.
8777         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8778         __libc_multiple_threads to...
8779         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8780
8781         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8782         versioning.
8783         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8784         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8785
8786         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8787         (__pthread_once_internal): Define.
8788
8789         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8790         macros instead of .symver directly.
8791         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8792         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8793
8794         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8795         * sysdeps/x86_64/tcb-offsets.sym: New file.
8796         * sysdeps/x86_64/Makefile: New file.
8797
8798         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8799         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8800         to access own pthread_t in TCB.
8801         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8802         Likewise.
8803         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8804         Likewise.
8805         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8806
8807 2003-03-12  Roland McGrath  <roland@redhat.com>
8808
8809         * pthread-errnos.sym: New file.
8810         * Makefile (gen-as-const-headers): New variable, list that file.
8811         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8812         header <pthread-errnos.h> instead of defining errno values here.
8813         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8814         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8815         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8816         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8817         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8818         Likewise.
8819         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8820         Likewise.
8821         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8822         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8823         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8824         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8825         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8826         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8827         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8828         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8829         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8830         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8831         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8832         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8833         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8834         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8835         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8836         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8837         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8838         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8839         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8840         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8841         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8842         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8843         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8844         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8845         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8846         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8847         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8848
8849         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8850         CLONE_CHILD_SETTID worked.
8851
8852 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8853
8854         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8855         file.
8856         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8857         file.
8858
8859         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8860         (pthread_cond_t): Add padding.
8861
8862         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8863         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8864         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8865
8866         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8867         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8868         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8869         (__pthread_rwlock_timedrdlock): Likewise.
8870         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8871         (__pthread_rwlock_wrlock): Likewise.
8872         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8873         (__pthread_rwlock_rdlock): Likewise.
8874
8875         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8876
8877         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8878         result of lock re-get if it fails.
8879
8880 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8881
8882         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8883         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8884         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8885         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8886         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8887         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8888         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8889         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8890         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8891         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8892
8893         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8894         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8895
8896         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8897         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8898         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8899         (create_thread): Likewise.
8900         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8901         * init.c (__pthread_initialize_minimal_internal): Initialize
8902         __libc_multiple_threads_ptr if necessary.
8903         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8904         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8905         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8906         __libc_multiple_threads.
8907         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8908         necessary.
8909
8910         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8911         (THREAD_SETMEM_NC): Likewise.
8912
8913         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8914         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8915         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8916         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8917
8918         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8919         Eliminate one entire instruction.
8920
8921         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8922         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8923         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8924         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8925         instead of __pthread_enable_asynccancel.
8926         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8927         (__pthread_cond_wait): Likewise.
8928         * sysdeps/pthread/pthread_cond_timedwait.c
8929         (__pthread_cond_timedwait): Likewise.
8930         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8931
8932         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8933         (__condvar_cleanup): Wake up all waiters in case we got signaled
8934         after being woken up but before disabling asynchronous
8935         cancellation.
8936         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8937         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8938         (__condvar_cleanup): Likewise.
8939
8940         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8941         Make it an error if architecture has no #if case.  Add x86-64.
8942
8943         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8944         pt-initfini.s generation.
8945
8946         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8947         (TLS_INIT_TP): Fix typo.
8948
8949 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8950
8951         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8952         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8953
8954         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8955         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8956         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8957         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8958         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8959         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8960         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8961         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8962
8963 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8964
8965         * sysdeps/pthread/pthread_cond_timedwait.c
8966         (__pthread_cond_timedwait): Return the result of the final
8967         locking.  If it succeeds, the regular function return value.
8968
8969         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8970         Return result of the final locking.
8971         * version.c (__nptl_main): Work around problems with the strange
8972         INTERNAL_SYSCALL macro on ppc32.
8973         * init.c (__pthread_initialize_minimal_internal): Unblock
8974         SIGCANCEL in case the parent blocked it.
8975         Reported by Paul Mackerras <paulus@samba.org>.
8976
8977         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8978         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8979         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8980
8981 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8982
8983         * sysdeps/pthread/pthread_cond_timedwait.c
8984         (__pthread_cond_timedwait): Unlock and fail if
8985         __pthread_mutex_unlock_internal failed.
8986
8987         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8988         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8989         Use ARCH_CLONE.
8990         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8991         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8992         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8993         ALLOCATE_STACK): New macros.
8994         (TLS_TPADJ): New macro.
8995         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8996         (allocate_stack): Handle TLS_DTV_AT_TP and
8997         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8998         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8999         Don't set PD->self.
9000         * init.c [__ia64__] (__NR_set_tid_address): Define.
9001
9002         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
9003         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
9004         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
9005         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
9006         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
9007         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
9008         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
9009         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
9010         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
9011         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
9012         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
9013         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
9014         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
9015         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
9016         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
9017         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
9018         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
9019         * sysdeps/ia64/bits/atomic.h: New file.
9020         * sysdeps/ia64/Makefile: New file.
9021         * sysdeps/ia64/pthread_spin_init.c: New file.
9022         * sysdeps/ia64/pthread_spin_lock.c: New file.
9023         * sysdeps/ia64/pthread_spin_trylock.c: New file.
9024         * sysdeps/ia64/pthread_spin_unlock.c: New file.
9025         * sysdeps/ia64/pthreaddef.h: New file.
9026         * sysdeps/ia64/tcb-offsets.sym: New file.
9027         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
9028         * sysdeps/ia64/tls.h: New file.
9029
9030         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
9031         to syscall instead of no arguments.
9032
9033 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
9034
9035         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
9036         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
9037         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
9038         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
9039
9040         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
9041         unused code.
9042
9043         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
9044
9045         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
9046         lowlevelbarrier.sym.
9047         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
9048         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
9049         Include lowlevelbarrier.h and don't define offsets locally.
9050         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
9051
9052         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
9053         (__lll_mutex_lock_wait): Reverse order of first two parameters.
9054         (__lll_mutex_timedlock_wait): Likewise.
9055         (lll_mutex_lock): Adjust asm for that.
9056         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
9057         (lll_lock): Adjust asm for operand order change.
9058         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
9059         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
9060
9061         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
9062         Reverse order of parameters.
9063         (__lll_timedwait_tid): Remove regparms attribute.
9064         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
9065         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
9066
9067         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9068         (__lll_timedwait_tid): Remove one unnecessary instruction.
9069
9070         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
9071         __lll_mutex_timedlock_wait only for NOT_IN_libc.
9072         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
9073         lowlevelmutex.S.
9074
9075         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
9076         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
9077         for NOT_IN_libc.
9078         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
9079         lowlevellock.S.
9080
9081         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
9082         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
9083         for libc.so.
9084         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
9085         define LOCK here (if UP is not defined).  The actual code is in
9086         lowlevelmutex.S.
9087
9088         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
9089         LOCK is already defined.  Don't define lll_unlock_wake_cb and
9090         __lll_timedwait_tid for libc.so.
9091         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
9092         define LOCK here (if UP is not defined).  The actual code is in
9093         lowlevellock.S.
9094
9095         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
9096         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
9097         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
9098         instead of lowlevelsem.h.
9099         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
9100         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
9101         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
9102
9103         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
9104         lowlevelrwlock.sym.
9105         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
9106         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
9107         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
9108
9109         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
9110         register loading.
9111         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
9112         last changed.  D'oh.
9113
9114         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
9115
9116         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
9117         of __libc_locking_needed.
9118         (lll_trylock): Initialize %eax to zero.
9119
9120         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
9121         pthread_cond_t definition.
9122
9123 2003-03-10  Roland McGrath  <roland@redhat.com>
9124
9125         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
9126         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
9127         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
9128         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
9129         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
9130
9131         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
9132         Instead of setting PD->multiple_threads, set globals
9133         __pthread_multiple_threads and __libc_multiple_threads.
9134         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9135         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
9136         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
9137
9138         * descr.h (struct pthread): Conditionalize first member on
9139         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
9140         containing an anonymous tcbhead_t.  Move `list' member out.
9141         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
9142         * allocatestack.c: Remove use of `header.data.' prefix.
9143         * pthread_create.c: Likewise.
9144         * init.c (__pthread_initialize_minimal_internal): Likewise.
9145         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9146         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
9147         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
9148         * sysdeps/x86_64/tls.h: Likewise.
9149         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
9150         (SINGLE_THREAD_P): Likewise.
9151         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
9152         (SINGLE_THREAD_P): Likewise.
9153         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
9154         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
9155
9156 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
9157
9158         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
9159
9160         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
9161         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9162
9163         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
9164         leftovers from the ia32 code.
9165
9166         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
9167         memory load.
9168         (clear_once_control): Don't load %esi.
9169
9170         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
9171         handling.
9172
9173         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9174
9175         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
9176         * sysdeps/unix/sysv/linux/createthread.c: ...here.
9177
9178         * Makefile (tests): Add tst-cond10.
9179         * tst-cond10.c: New file.
9180
9181 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
9182
9183         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
9184         * tst-signal3.c (do_test): Likewise.
9185         * tst-sem5.c (do_test): Likewise.
9186         * tst-kill6.c (do_test): Likewise.
9187         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
9188
9189         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
9190         of inc/dec.
9191         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9192         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
9193         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
9194         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
9195         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9196         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9197         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9198         Likewise.
9199         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9200         Likewise.
9201         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9202         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9203         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9204         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9205         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9206         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9207         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9208         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9209
9210         * allocatestack.c (allocate_stack): If mprotect() fails free the
9211         TLS memory.
9212
9213 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
9214
9215         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
9216
9217         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
9218         lll_wake_tid.  This was used only to work around kernel limits in
9219         the early days.
9220         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
9221         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
9222         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9223         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
9224
9225         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
9226         (__pthread_initialize_minimal_internal): Change initialization of
9227         __static_tls_align_m1 appropriately.
9228         * pthreadP.h (__static_tls_align_m1): Renamed from
9229         __static_tls_align.
9230         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
9231         instead of __static_tls_align-1.
9232
9233 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
9234
9235         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
9236
9237         * pthread_create.c: Define __pthread_keys using nocommon
9238         attribute, not by placing it explicitly in bss.
9239         Remove DEFINE_DEALLOC definition.  Not needed anymore.
9240
9241         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
9242         Use it in mmap call to allocate stacks.
9243
9244         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
9245
9246         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
9247         result of the thread function.
9248
9249 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
9250
9251         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
9252         version is just fine.
9253
9254         * sysdeps/unix/sysv/linux/libc_pthread_init.c
9255         (__pthread_child_handler): Renamed from pthread_child_handler,
9256         exported, and marked hidden.  Change all users.
9257         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
9258         free __pthread_child_handler from child list.
9259
9260 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9261
9262         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
9263
9264         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9265         Fix handling of cancellation and failing pthread_mutex_unlock call.
9266         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9267         (__pthread_cond_wait): Likewise.
9268
9269         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
9270         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
9271         lll_futex_timed_wait call.
9272         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
9273         (pthread_rwlock_timedwrlock): Likewise.
9274
9275         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
9276         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
9277         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9278
9279         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9280         check of lll_futex_wake return value.
9281
9282 2003-03-03  Roland McGrath  <roland@redhat.com>
9283
9284         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9285
9286         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9287         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9288         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9289
9290 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9291
9292         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9293         error for CPU clocks.
9294
9295         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9296         _POSIX_MONOTONIC_CLOCK.
9297         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9298
9299         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9300         recent kernels.
9301
9302 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9303
9304         * descr.h (struct pthread): Move cleanup field to the front.
9305
9306 2003-03-01  Roland McGrath  <roland@redhat.com>
9307
9308         * sem_open.c (sem_open): Braino fix.
9309
9310 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9311
9312         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9313         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9314         __pthread_cleanup_pop functionality.
9315         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9316
9317         * descr.h (struct pthread): Move tid field to the front now that
9318         it is often used.
9319
9320         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9321         (__lll_mutex_timedlock_wait): Remove.
9322         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9323         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9324         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9325         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9326         (lll_unlock_wake_cb): Don't save and restore %esi.
9327         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9328         %esi.
9329         (__lll_timedwait_tid): Add alignment.
9330         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9331         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9332         %esi.
9333         (__lll_timedwait_tid): Removed.
9334         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9335         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9336         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9337         (pthread_barrier_wait): Don't save, load, and restore %esi for
9338         last thread.
9339         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9340         (__pthread_cond_signal): Don't save, load, and restore %esi.
9341         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9342         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9343         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9344         Don't save, load, and restore %esi.
9345
9346 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9347
9348         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9349         Release lock before waking up the waiters.
9350
9351         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9352
9353         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9354         (reader_thread): Likewise.
9355
9356         * sysdeps/pthread/pthread_rwlock_unlock.c
9357         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9358         to wake up readers if there are none.
9359
9360         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9361         Release internal lock before wake threads.
9362
9363 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9364
9365         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9366         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9367         predefined.
9368         * tst-rwlock9.c: Likewise.
9369         * tst-rwlock10.c: New file.
9370         * tst-rwlock11.c: New file.
9371
9372         * Makefile (tests): Add tst-dlsym1.
9373         * tst-dlsym1.c: New file.
9374
9375         * init.c (__pthread_initialize_minimal_internal): Set
9376         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9377         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9378
9379 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9380
9381         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9382
9383         * tst-cond2.c: Fix sychronization with child.
9384
9385         * tst-rwlock8.c (reader_thread): Remove unused variable.
9386
9387         * Makefile: Add rules to build and run tst-tls3.
9388         * tst-tls3.c: New file.
9389         * tst-tls3mod.c: New file.
9390
9391         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9392         * tst-rwlock8.c: New file.
9393         * tst-rwlock9.c: New file.
9394         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9395         complete broken rwlock implementation.
9396         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9397         Likewise.
9398         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9399         Likewise.
9400         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9401         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9402         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9403         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9404         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9405         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9406         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9407
9408 2003-02-23  Roland McGrath  <roland@redhat.com>
9409
9410         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9411
9412 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9413
9414         * Makefile (tests): Add tst-context1.
9415         * tst-context1.c: New file.
9416
9417         * Makefile (tests): Add tst-tls1 and tst-tls2.
9418         * tst-tls1.c: New file.
9419         * tst-tls2.c: New file.
9420
9421         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9422         for failed cmpxchg.
9423
9424         * pthread_create.c (start_thread): Set EXITING_BIT early.
9425
9426         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9427         (THREAD_GETMEM_NC): Likewise.
9428
9429 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9430
9431         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9432         off 3 more bytes by using offset-less instructions when possible.
9433
9434         * Makefile: Add dependency for $(objpfx)version.d.
9435
9436         * eintr.c (eintr_source): Add unnecessary return but the compiler
9437         insists.
9438
9439         * tst-kill3.c: Include <unistd.h>.
9440
9441 2003-02-21  Roland McGrath  <roland@redhat.com>
9442
9443         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9444
9445 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9446
9447         * Makefile (tests): Add tst-eintr1.
9448         (distribute): Add eintr.c.
9449         * tst-eintr1.c: New file.
9450         * eintr.c: New file.
9451
9452         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9453
9454         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9455         Disallow sending SIGCANCEL.
9456
9457         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9458         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9459         * tst-kill1.c: New file.
9460         * tst-kill2.c: New file.
9461         * tst-kill3.c: New file.
9462         * tst-kill5.c: New file.
9463         * tst-kill6.c: New file.
9464         * tst-basic7.c: Renamed to...
9465         * tst-kill4.c: ...this.
9466
9467 2003-02-21  Roland McGrath  <roland@redhat.com>
9468
9469         * Makefile (install-lib-ldscripts): New variable.
9470
9471 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9472
9473         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9474         * pthread_cancel.c: Use INVALID_TD_P.
9475         * pthread_detach.c: Likewise.
9476         * pthread_getschedparam.c: Likewise.
9477         * pthread_setschedparam.c: Likewise.
9478         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9479         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9480         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9481         * pthread_timedjoin.c: Likewise.
9482
9483         * tst-basic7.c: Include <signal.h>.
9484
9485         * pthread_join.c (pthread_join): Limited checking for invalid
9486         descriptors.
9487         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9488
9489 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9490
9491         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9492         beginning of the loop.  Clear the entire first block of TSD.
9493         * Makefile (tests): Add tst-key4.
9494         * tst-key4.c: New file.
9495
9496 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9497
9498         * Makefile (tests): Add tst-basic7.
9499         * tst-basic7.c: New file.
9500
9501         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9502         Add some more __builtin_expect.
9503
9504         * pthreadP.h: Define dummy version of DEBUGGING_P.
9505
9506 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9507
9508         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9509         _POSIX_THREAD_PRIORITY_SCHEDULING.
9510         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9511         _XOPEN_REALTIME_THREADS.
9512         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9513
9514         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9515         kernel returns EINVAL for PID <= 0, work around it.
9516
9517         * Makefile (tests): Add tst-signal5.
9518         * tst-signal5.c: New file.
9519
9520         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9521         and LOGIN_NAME_MAX.
9522
9523         * tst-cancel1.c (tf): Block all signals.
9524
9525         * Makefile (tests): Add tst-basic6.
9526         * tst-basic6.c: New file.
9527
9528         * tst-basic1.c: Add test for process ID.
9529
9530         * Makefile (tests): Add tst-cancel10.
9531         * tst-cancel10.c: New file.
9532
9533         * Makefile (tests): Add tst-signal4.
9534         * tst-signal4.c: New file.
9535
9536         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9537         __sigismember instead of sigismember.  Add __builtin_expect.
9538
9539 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9540
9541         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9542         pthread_setcancelstate, and pthread_rwlock_setpshared.
9543
9544         * tst-cancel7.c (do_test): Make sure the pid file exists before
9545         canceling the thread.
9546
9547         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9548         pthread_rwlock_timedrdlock tests.
9549         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9550         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9551         Check for invalid tv_nsec field.
9552         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9553         Likewise.
9554
9555         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9556         recursive mutex of overflow.
9557
9558         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9559
9560         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9561         going into an endless loop.
9562         * Makefile (tests): Add tst-cancel9.
9563         * tst-cancel9.c: New file.
9564
9565         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9566
9567 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9568
9569         * tst-mutex5.c (do_test): Add more timedlock tests.
9570
9571         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9572         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9573
9574         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9575         use INLINE_SYSCALL.  Error number is returned, not -1.
9576
9577         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9578         and __deallocate_stack with internal_function.
9579         * pthread_create.c: Adjust definitions appropriately.
9580         * allocatestack.c: Likewise.
9581
9582         * pthread_join.c: Add one more __builtin_expect.
9583         * pthread_timedjoin.c: Likewise.
9584
9585         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9586         not data of sequence number does not match.
9587         Add one __builtin_expect.
9588
9589         * Makefile (tests): Add tst-clock1.
9590         * tst-clock1.c: New file.
9591
9592         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9593         negative arguments.
9594         * Makefile (tests): Add tst-basic5.
9595         * tst-basic5.c: New file.
9596
9597 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9598
9599         * Makefile (tests): Add tst-basic4.
9600         * tst-basic4.c: New file.
9601
9602         * pthreadP.h: Add declaraction for __nptl_nthreads.
9603         * pthread_create.c: Define __nptl_nthreads
9604         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9605         after thread is done.  If then zero, call exit(0).
9606         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9607         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9608         * init.c (pthread_functions): Initialize ptr_nthreads.
9609         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9610         (__reclaim_stacks): Decrement __nptl_nthreads.
9611         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9612         Define.
9613         * Makefile (tests): Add tst-basic3.
9614         * tst-basic3.c: New file.
9615
9616         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9617         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9618         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9619         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9620         if asynchronous canceling is enabled.
9621         * pthread_join.c (pthread_join): When recognizing circular joins,
9622         take into account the other thread might be already canceled.
9623         * Makefile (tests): Add tst-join5.
9624         * tst-join5.c: New file.
9625
9626         * Makefile (tests): Add tst-join4.
9627         * tst-join4.c: New file.
9628
9629 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9630
9631         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9632
9633 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9634
9635         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9636         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9637         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9638         warning.
9639         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9640         to avoid warning.
9641         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9642         error if lll_futex_wake failed.
9643
9644 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9645
9646         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9647         handling of cancellation and failung pthread_mutex_unlock call.
9648         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9649         * Makefile (tests): Add tst-cond8 and tst-cond9.
9650         * tst-cond8.c: New file.
9651         * tst-cond9.c: New file.
9652
9653         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9654
9655         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9656         non-standard initializers with __USE_GNU.
9657
9658         * Makefile (tests): Add tst-cleanup3.
9659         * tst-cleanup3.c: New file.
9660
9661 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9662
9663         * Makefile (tests): Add tst-attr1 and tst-attr2.
9664         * tst-attr1.c: New file.
9665         * tst-attr2.c: New file.
9666
9667         * Makefile: Add rules to build and run tst-atfork2 test.
9668         * tst-atfork2.c: New file.
9669         * tst-atfork2mod.c: New file.
9670
9671         * sysdeps/unix/sysv/linux/unregister-atfork.c
9672         (__unregister_atfork): Free the memory allocated for the handlers
9673         after removing them from the lists.
9674
9675         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9676         cleanup function.
9677
9678         * tst-atfork1.c (do_test): Wait for the child we forked.
9679         Report error in child.
9680
9681         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9682
9683         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9684
9685 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9686
9687         * Makefile (tests): Add tst-cancel8.
9688         * tst-cancel8.c: New file.
9689
9690         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9691         clearing of control variable.
9692         * Makefile (tests): Add tst-once3 and tst-once4.
9693         * tst-once3.c: New file.
9694         * tst-once4.c: New file.
9695
9696 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9697
9698         * sysdeps/sh/Makefile: New file.
9699         * sysdeps/sh/bits/atomic.h: New file.
9700         * sysdeps/sh/pthread_spin_init.c: New file.
9701         * sysdeps/sh/pthread_spin_lock.c: New file.
9702         * sysdeps/sh/pthread_spin_trylock.S: New file.
9703         * sysdeps/sh/pthread_spin_unlock.S: New file.
9704         * sysdeps/sh/pthreaddef.h: New file.
9705         * sysdeps/sh/tcb-offsets.sym: New file.
9706         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9707         * sysdeps/sh/tls.h: New file.
9708         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9709         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9710         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9711         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9712         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9713         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9714         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9715         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9716         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9717         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9718         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9719         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9720         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9721         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9722         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9723         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9724         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9725         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9726         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9727         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9728         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9729         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9730         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9731         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9732         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9733         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9734         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9735         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9736         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9737         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9738
9739 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9740
9741         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9742         according to POSIX.
9743
9744         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9745
9746 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9747
9748         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9749         (TLS_GET_FS): New #define.
9750         (TLS_SET_FS): New #define.
9751         Correct value of __NR_set_thread_area.
9752
9753         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9754
9755 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9756
9757         * Makefile (tests): Add tst-popen1.
9758         * tst-popen1.c: New file.
9759
9760         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9761         but inactive generalization.
9762         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9763         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9764         Minor optimization, remove one instruction.
9765         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9766
9767 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9768
9769         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9770
9771 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9772
9773         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9774         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9775         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9776         * sysdeps/pthread/pthread_cond_signal.c: New file.
9777         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9778         * sysdeps/pthread/pthread_cond_wait.c: New file.
9779         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9780         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9781         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9782         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9783         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9784         * sysdeps/s390/Makefile: New file.
9785         * sysdeps/s390/bits/atomic.h: New file.
9786         * sysdeps/s390/pthread_spin_init.c: New file.
9787         * sysdeps/s390/pthread_spin_lock.c: New file.
9788         * sysdeps/s390/pthread_spin_trylock.c: New file.
9789         * sysdeps/s390/pthread_spin_unlock.c: New file.
9790         * sysdeps/s390/pthreaddef.h: New file.
9791         * sysdeps/s390/tcb-offsets.sym: New file.
9792         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9793         * sysdeps/s390/tls.h: New file.
9794         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9795         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9796         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9797         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9798         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9799         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9800         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9801         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9802         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9803         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9804         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9805         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9806         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9807         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9808         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9809         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9810         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9811         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9812         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9813         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9814         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9815         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9816         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9817
9818 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9819
9820         * atomic.h: Add a couple more default implementations.
9821         (atomic_compare_and_exchange_acq): Use
9822         __arch_compare_and_exchange_32_acq in return value definition.  It
9823         always exists.
9824         (atomic_bit_set): Renamed from atomic_set_bit.
9825         Add missing atomic_ prefixes.
9826
9827         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9828         thread library is available, use correct value to mark initialized
9829         once variable.
9830
9831 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9832
9833         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9834         __sysconf to determine pagesize.
9835
9836         * pthread_create.c: Include <atomic.h>.
9837         * allocatestack.c (allocate_stack): Implement coloring of the
9838         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9839         size minus one.  Adjust users.
9840         * sysdeps/i386/i686/Makefile: New file.
9841
9842 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9843
9844         * allocatestack.c: Improve comment throughout the file.
9845
9846         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9847         (__lll_lock_wait): Add branch prediction.
9848         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9849         (__lll_lock_wait): Likewise.
9850         (lll_unlock_wake_cb): Removed.
9851
9852 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9853
9854         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9855         _POSIX_THREAD_PRIORITY_SCHEDULING.
9856
9857 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9858
9859         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9860         Fix return type of ptr___pthread_getspecific.
9861
9862 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9863
9864         * Makefile (tests): Add tst-umask1.
9865         (tst-umask1-ARGS): Define.
9866         * tst-umask1.c: New file.
9867
9868 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9869
9870         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9871         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9872         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9873         pthread_rwlock_unlock.
9874         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9875         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9876         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9877         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9878         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9879         New file.
9880         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9881         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9882         New file.
9883         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9884         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9885         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9886         New file.
9887         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9888         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9889         New file.
9890         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9891         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9892         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9893         New file.
9894         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9895         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9896         New file.
9897         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9898
9899         * Makefile (libpthread-routines): Remove lowlevelcond and
9900         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9901         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9902         and pthread_cond_broadcast.
9903         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9904         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9905         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9906         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9907         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9908         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9909         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9910         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9911         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9912         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9913         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9914         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9915         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9916         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9917         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9918         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9919         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9920         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9921         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9922         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9923         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9924         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9925         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9926         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9927         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9928         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9929         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9930         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9931         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9932         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9933         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9934
9935         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9936         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9937         of the code is moved to ...
9938         * sysdeps/pthread/createthread.c: ...here.  New file.
9939
9940 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9941
9942         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9943         (__new_sem_post): Clear %eax before returning.
9944         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9945
9946         * Makefile (tests): Add tst-cleanup2.
9947         * tst-cleanup2.c: New file.
9948
9949         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9950         Interpret first parameter correctly.
9951
9952 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9953
9954         * Makefile (headers): Add bits/semaphore.h.
9955
9956 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9957
9958         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9959         if not SHARED.
9960
9961 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9962
9963         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9964         must be used and mapping failed.
9965         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9966
9967         * Makefile (CFLAGS-pthread_self.os): Define this, not
9968         CFLAGS-pthread_self.c.
9969
9970 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9971
9972         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9973         lll_unlock_wake_cb.
9974
9975         * Makefile (libpthread-routines): Add version.  Add rules to build
9976         version.os and banner.h.
9977         * version.c: New file.
9978
9979 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9980
9981         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9982         the alias unconditional.
9983         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9984
9985 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9986
9987         * Makefile (CFLAGS-pthread_self.c): New definition.
9988
9989 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9990
9991         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9992         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9993         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9994         * init.c (__pthread_initialize_minimal_internal): Likewise.
9995
9996 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9997
9998         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9999
10000         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
10001         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
10002         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
10003         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
10004         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
10005         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
10006
10007 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
10008
10009         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
10010         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
10011         * tst-cancel-wrappers.sh: Remove all exceptions.
10012
10013 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
10014
10015         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
10016         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
10017
10018         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
10019         Use __libc_pthread_functions array if SHARED.
10020
10021         * pthreadP.h: Move pthread_cond_2_0_t definition to...
10022         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
10023
10024         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
10025         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
10026         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
10027         __libc_ptf_call instead of __libc_maybe_call.
10028         (PTF): New #define.
10029         (__libc_cleanup_region_start): Wrap function name with PTF call.
10030         (__libc_cleanup_region_end): Likewise.
10031         (__libc_cleanup_end): Likewise.
10032
10033         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
10034         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
10035         * pthread_key_create.c: Add __pthread_key_create_internal alias.
10036         * pthreadP.h: Add prototypes.
10037
10038         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
10039         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
10040         __pthread_rwlock_unlock aliases.
10041         * pthreadP.h: Add prototypes for new aliases.
10042
10043         * pthreadP.h (struct pthead_functions): Moved to...
10044         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
10045         * init.c (pthread_functions): Add initializers for new elements.
10046
10047         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
10048         __pthread_cleanup_pop_restore aliases.
10049         * pthreadP.h: Add prototypes.
10050
10051         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
10052         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
10053         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
10054         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
10055         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
10056         * pthreadP.h: Adjust prototypes and callers.
10057
10058 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
10059
10060         * Makefile (tests): Add tst-cancel7.
10061         (tst-cancel7-ARGS): New variable.
10062         * tst-cancel7.c: New file.
10063
10064         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
10065         around gcc defficiencies.
10066         * old_pthread_cond_signal.c: Likewise.
10067         * old_pthread_cond_timedwait.c: Likewise.
10068         * old_pthread_cond_wait.c: Likewise.
10069
10070         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
10071
10072 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
10073
10074         * Makefile (tests): Add tst-cond7.
10075         * tst-cond7.c: New file.
10076
10077         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
10078         (condvar_cleanup): Get condvar address from the right place.
10079
10080         * atomic.h: Correct definitions of atomic_full_barrier,
10081         atomic_read_barrier, atomic_write_barrier.
10082
10083         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
10084         race-free.
10085         * old_pthread_cond_signal.c: Likewise.
10086         * old_pthread_cond_timedwait.c: Likewise.
10087         * old_pthread_cond_wait.c: Likewise.
10088
10089 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
10090
10091         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
10092
10093 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
10094
10095         * pthreadP.h (pthread_cond_2_0_t): New type.
10096         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
10097         Use new type for the 2.0 condvar function prototypes.
10098         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
10099         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
10100         parameter.
10101         * old_pthread_cond_destroy.c: Likewise.
10102         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
10103         * old_pthread_cond_signal.c: Likewise.
10104         * old_pthread_cond_timedwait.c: Likewise.
10105         * old_pthread_cond_wait.c: Likewise.
10106
10107         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
10108         (__pthread_cond_wait): Don't save cancellation mode and seq value
10109         in same location.
10110
10111         * herrno.c (__h_errno_location): Don't define as weak.
10112
10113 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10114
10115         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
10116         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
10117         and pthread_cond_wait.
10118         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
10119         Renamed to...
10120         (__pthread_cond_broadcast_2_0): ... this.
10121         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
10122         Renamed to...
10123         (__pthread_cond_destroy_2_0): ... this.
10124         * old_pthread_cond_init.c (__old_pthread_cond_init):
10125         Renamed to...
10126         (__pthread_cond_init_2_0): ... this.
10127         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
10128         Renamed to...
10129         (__pthread_cond_signal_2_0): ... this.
10130         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
10131         Renamed to...
10132         (__pthread_cond_wait_2_0): ... this.
10133         * pthread_cond_destroy.c: Include shlib-compat.h.
10134         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
10135         * pthread_cond_init.c: Include shlib-compat.h.
10136         (pthread_cond_init): Change strong_alias into versioned_symbol.
10137         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
10138         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
10139         fields.
10140         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
10141         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
10142         __pthread_cond_wait_2_0): New prototypes.
10143         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
10144         __old_pthread_cond_init, __old_pthread_cond_signal,
10145         __old_pthread_cond_wait): Removed.
10146         * init.c: Include shlib-compat.h.
10147         (pthread_functions): Guard ptr___pthread_attr_init_2_0
10148         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
10149         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
10150         ptr___pthread_cond_*_2_0 fields.
10151         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
10152         pthread_cond_*@GLIBC_2.0 compatibility symbols.
10153
10154         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
10155         LIBC_SIGACTION was not yet defined.
10156         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
10157         [!defined LIBC_SIGACTION] (__sigaction): New function and
10158         libc_hidden_weak.
10159         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
10160         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
10161
10162 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10163
10164         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
10165
10166 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
10167
10168         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
10169         New, larger type definition.
10170         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
10171         implementation.
10172         * Versions [libpthread]: Add definitions for new pthread_cond_*
10173         interfaces for version GLIBC_2.3.2.
10174         * pthread_cond_init.c: Update initialization for new type definition.
10175         * Makefile (libpthread-routines): Remove pthread_cond_wait,
10176         pthread_cond_timedwait, pthread_cond_signal, and
10177         pthread_cond_broadcast.  Add old_pthread_cond_init,
10178         old_pthread_cond_destroy, old_pthread_cond_wait,
10179         old_pthread_cond_timedwait, old_pthread_cond_signal, and
10180         old_pthread_cond_broadcast.
10181         * old_pthread_cond_broadcast.c: New file.
10182         * old_pthread_cond_destroy.c: New file.
10183         * old_pthread_cond_init.c: New file.
10184         * old_pthread_cond_signal.c: New file.
10185         * old_pthread_cond_timedwait.c: New file.
10186         * old_pthread_cond_wait.c: New file.
10187         * pthreadP.h: Add prototypes for the compatibility interfaces.
10188
10189         * pthread_cond_destroy.c: Don't include <errno.h>.
10190
10191 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
10192
10193         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
10194         unnecessary zero offset when addressing MUTEX.
10195
10196 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10197
10198         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
10199         __register_atfork.
10200         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
10201         for __register_atfork.
10202
10203 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10204
10205         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
10206         instead of ASSEMBLER test macro.
10207
10208         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
10209         __libc_current_sigrtmax): Add libc_hidden_def.
10210
10211         * sysdeps/pthread/list.h: Remove assert.h include.
10212
10213 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10214
10215         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
10216         __pthread_initialize_minimal_internal not
10217         __pthread_initialize_minimal.
10218
10219 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
10220
10221         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
10222         __pthread_initialize_minimal as hidden.
10223
10224         * init.c (__pthread_initialize_minimal_internal): Don't mark as
10225         constructor.
10226
10227 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10228
10229         * Makefile ($(inst_libdir)/libpthread.so): Depend on
10230         $(common-objpfx)format.lds, include that into the output script.
10231         Fix comment.
10232         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
10233
10234 2002-12-28  Andreas Jaeger  <aj@suse.de>
10235
10236         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
10237         nsec resolution changes.
10238         (xstat64_conv): Likewise.
10239         (xstat32_conv): Likewise.
10240         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
10241         struct kernel_stat.
10242         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
10243         structs stat and stat64.
10244         * time/time.h (__timespec_defined): Define for __USE_MISC.
10245         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
10246
10247 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
10248
10249         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
10250         argument.
10251         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
10252         (pthread_exit): Use strong_alias to avoid warnings.
10253         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
10254         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
10255         ptr___pthread_attr_init_2_*.
10256         * init.c (pthread_functions): Adjust.
10257
10258 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
10259
10260         * forward.c: Make all functions available by default again.  It
10261         caused too much trouble.
10262
10263         * pt-siglongjmp.c: Removed.
10264
10265 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
10266
10267         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
10268         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
10269         * sysdeps/i386/Makefile: New file.
10270         * sysdeps/i386/tcb-offsets.sym: New file.
10271         * sysdeps/pthread/tcb-offsets.h: New file.
10272         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10273         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
10274
10275         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
10276         __register_atfork...
10277         (GLIBC_2.3.2): ...here.
10278
10279 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10280
10281         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10282         pthread_attr_setstackaddr with __attribute_deprecated__.
10283
10284 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10285
10286         * pt-system.c (system): Remove cancellation handling.
10287         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10288         cancellation routines.
10289
10290 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10291
10292         * descr.h: Include <dl-sysdep.h>.
10293         (struct pthread): Move header.data.list to the back of the struct.
10294         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10295         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10296         (SYSINFO_OFFSEET): Likewise.
10297
10298 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10299
10300         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10301         Define.
10302         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10303         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10304         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10305         (USE_DL_SYSINFO): Undef.
10306
10307 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10308
10309         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10310         $(common-objpfx)libc.so.
10311         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10312         it is bigger than pipe buffer size even on arches with bigger
10313         page size.
10314         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10315
10316 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10317
10318         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10319         correct errno access for case that USE___THREAD is not defined.
10320
10321 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10322
10323         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10324         Patch by Marijn Ros <marijn@mad.scientist.com>.
10325
10326 2002-12-22  Roland McGrath  <roland@redhat.com>
10327
10328         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10329
10330 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10331
10332         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10333
10334 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10335
10336         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10337         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10338         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10339
10340         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10341         of int $0x80.
10342         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10343         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10344         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10345         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10346         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10347         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10348         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10349         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10350
10351         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10352         sysenter.
10353         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10354
10355         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10356
10357         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10358         in new TCB.
10359         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10360         that sysinfo is properly initialized.
10361         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10362         to 1 only for ld.so.
10363
10364         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10365         RTLD_CORRECT_DYNAMIC_WEAK.
10366
10367 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10368
10369         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10370         Use return 0 as 6th argument to FORWARD4.
10371         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10372
10373 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10374
10375         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10376         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10377         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10378         (INIT_SYSINFO): New #define.
10379         (TLS_TP_INIT): Use INIT_SYSINFO.
10380         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10381         At test to make sure SYSINFO_OFFSET value is correct.
10382         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10383
10384 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10385
10386         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10387         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10388         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10389         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10390         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10391         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10392         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10393
10394 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10395
10396         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10397         macro instead of using int $0x80 directly.
10398
10399         * sysdeps/pthread/bits/stdio-lock.h: New file.
10400         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10401         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10402         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10403         * Makefile (routines): Add libc-lowlevelmutex.
10404
10405         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10406         __i686.get_pc_thunk.dx.
10407
10408 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10409
10410         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10411         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10412         ($(objpfx)tst-cancel-wrappers.out): New rule.
10413         * tst-cancel-wrappers.sh: New test.
10414         * tst-locale1.c: Include signal.h.
10415         (uselocale): Test static linking of __libc_current_sigrt*.
10416
10417 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10418
10419         * Makefile (tests): Add tst-cancel6.
10420         * tst-cancel6.c: New file
10421
10422 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10423
10424         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10425         Define meaningfully for assembler as well.
10426         * pthreadP.h (struct pthread_functions): Remove
10427         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10428         and ptr_pthread_attr_init_2_1 fields.
10429         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10430         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10431         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10432         (FORWARD3): Define using FORWARD4.
10433         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10434         versions.
10435         * pt-system.c: Remove duplicate stdlib.h include.
10436
10437 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10438
10439         * sem_init.c: Define sem_init@GLIBC_2.0.
10440         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10441         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10442
10443         * flockfile.c: Moved to...
10444         * sysdeps/pthread/flockfile.c: ...here.  New file.
10445         * funlockfile.c: Moved to...
10446         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10447         * ftrylockfile.c: Moved to...
10448         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10449
10450 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10451
10452         * libc-cancellation.c: Guard both function with
10453         #if !defined NOT_IN_libc.
10454         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10455         automatically provided pthread wrappers.
10456         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10457         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10458         nor in libpthread.
10459         * pt-open.c: Removed.
10460         * pt-fcntl.c: Removed.
10461         * pt-fsync.c: Removed.
10462         * pt-lseek.c: Removed.
10463         * pt-msgrcv.c: Removed.
10464         * pt-msgsnd.c: Removed.
10465         * pt-msync.c: Removed.
10466         * pt-nanosleep.c: Removed.
10467         * pt-open64.c: Removed.
10468         * pt-pause.c: Removed.
10469         * pt-pread.c: Removed.
10470         * pt-pread64.c: Removed.
10471         * pt-pwrite.c: Removed.
10472         * pt-pwrite64.c: Removed.
10473         * pt-read.c: Removed.
10474         * pt-recv.c: Removed.
10475         * pt-recvfrom.c: Removed.
10476         * pt-recvmsg.c: Removed.
10477         * pt-send.c: Removed.
10478         * pt-sendto.c: Removed.
10479         * pt-sigtimedwait.c: Removed.
10480         * pt-sigwait.c: Removed.
10481         * pt-wait.c: Removed.
10482         * pt-waitpid.c: Removed.
10483         * pt-write.c: Removed.
10484         * pt-accept.c: Removed.
10485         * pt-close.c: Removed.
10486         * pt-connect.c: Removed.
10487         * pt-lseek64.c: Removed.
10488         * pt-sendmsg.c: Removed.
10489         * pt-tcdrain.c: Removed.
10490
10491 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10492
10493         * init.c (__pthread_initialize_minimal_internal): Renamed from
10494         __pthread_initialize_minimal.  Make old name an alias.  This
10495         converts a normal relocation into a relative relocation.
10496
10497         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10498
10499         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10500         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10501         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10502         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10503         pt-sigwaitinfo, pt-waitid, and pt-writev.
10504         * pt-creat.c: Removed.
10505         * pt-poll.c: Removed.
10506         * pt-pselect.c: Removed.
10507         * pt-readv.c: Removed.
10508         * pt-select.c: Removed.
10509         * pt-sigpause.c: Removed.
10510         * pt-sigsuspend.c: Removed.
10511         * pt-sigwaitinfo.c: Removed.
10512         * pt-waitid.c: Removed.
10513         * pt-writev.c: Removed.
10514
10515         * init.c (pthread_functions): New variable.
10516         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10517         (or NULL) to __libc_pthread_init.
10518         * forward.c: Rewrite to use __libc:pthread_functions array to get
10519         function addresses.
10520         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10521         prototype.
10522         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10523         Take new parameter.  Copy content of variable pointed to by it
10524         to __libc_pthread_init.
10525
10526         * pthreadP.h (struct pthread_functions): New type.
10527         (__libc_pthread_init): Declare.
10528
10529         * pthread_attr_destroy.c: Add namespace protected alias.
10530         * pthread_attr_getdetachstate.c: Likewise.
10531         * pthread_attr_getinheritsched.c: Likewise.
10532         * pthread_attr_getschedparam.c: Likewise.
10533         * pthread_attr_getschedpolicy.c: Likewise.
10534         * pthread_attr_getscope.c: Likewise.
10535         * pthread_attr_setdetachstate.c: Likewise.
10536         * pthread_attr_setinheritsched.c: Likewise.
10537         * pthread_attr_setschedparam.c: Likewise.
10538         * pthread_attr_setschedpolicy.c: Likewise.
10539         * pthread_attr_setscope.c: Likewise.
10540         * pthread_cond_broadcast.c: Likewise.
10541         * pthread_cond_destroy.c: Likewise.
10542         * pthread_cond_init.c: Likewise.
10543         * pthread_cond_signal.c: Likewise.
10544         * pthread_cond_wait.c: Likewise.
10545         * pthread_condattr_destroy.c: Likewise.
10546         * pthread_condattr_init.c: Likewise.
10547         * pthread_equal.c: Likewise.
10548         * pthread_exit.c: Likewise.
10549         * pthread_getschedparam.c: Likewise.
10550         * pthread_self.c: Likewise.
10551         * pthread_setcancelstate.c: Likewise.
10552         * pthread_setschedparam.c: Likewise.
10553         * pthread_mutex_destroy.c: Likewise.
10554         * pthread_mutex_init.c: Likewise.
10555         * pthreadP.h: Add prototypes for the aliases.
10556
10557         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10558         multiple_threads member in correct TCB to 1.
10559
10560         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10561         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10562         member of thread decriptor, otherwise return unconditionally 1.
10563
10564 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10565
10566         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10567         regular Linux version.  Remove file.
10568         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10569         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10570         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10571         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10572         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10573         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10574         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10575         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10576         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10577         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10578         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10579         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10580         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10581         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10582         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10583         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10584         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10585         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10586         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10587         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10588         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10589         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10590         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10591         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10592         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10593         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10594         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10595         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10596         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10597         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10598
10599 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10600
10601         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10602         * sysdeps/unix/sysv/linux/open.c: Removed.
10603         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10604         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10605         * sysdeps/unix/sysv/linux/msync.c: Removed.
10606         * sysdeps/unix/sysv/linux/read.c: Removed.
10607         * sysdeps/unix/sysv/linux/close.c: Removed.
10608         * sysdeps/unix/sysv/linux/creat.c: Removed.
10609         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10610         * sysdeps/unix/sysv/linux/pause.c: Removed.
10611         * sysdeps/unix/sysv/linux/select.c: Removed.
10612         * sysdeps/unix/sysv/linux/write.c: Removed.
10613
10614 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10615
10616         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10617         element in TCB to see whether locking is needed.
10618
10619         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10620         MULTIPLE_THREADS_OFFSET value is correct.
10621
10622         * sysdeps/unix/sysv/linux/close.c: New file.
10623         * sysdeps/unix/sysv/linux/connect.S: New file.
10624         * sysdeps/unix/sysv/linux/creat.c: New file.
10625         * sysdeps/unix/sysv/linux/fsync.c: New file.
10626         * sysdeps/unix/sysv/linux/llseek.c: New file.
10627         * sysdeps/unix/sysv/linux/lseek.c: New file.
10628         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10629         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10630         * sysdeps/unix/sysv/linux/msync.c: New file.
10631         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10632         * sysdeps/unix/sysv/linux/open.c: New file.
10633         * sysdeps/unix/sysv/linux/open64.c: New file.
10634         * sysdeps/unix/sysv/linux/pause.c: New file.
10635         * sysdeps/unix/sysv/linux/poll.c: New file.
10636         * sysdeps/unix/sysv/linux/pread.c: New file.
10637         * sysdeps/unix/sysv/linux/pread64.c: New file.
10638         * sysdeps/unix/sysv/linux/pselect.c: New file.
10639         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10640         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10641         * sysdeps/unix/sysv/linux/readv.c: New file.
10642         * sysdeps/unix/sysv/linux/recv.S: New file.
10643         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10644         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10645         * sysdeps/unix/sysv/linux/select.c: New file.
10646         * sysdeps/unix/sysv/linux/send.S: New file.
10647         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10648         * sysdeps/unix/sysv/linux/sendto.S: New file.
10649         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10650         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10651         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10652         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10653         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10654         * sysdeps/unix/sysv/linux/system.c: New file.
10655         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10656         * sysdeps/unix/sysv/linux/wait.c: New file.
10657         * sysdeps/unix/sysv/linux/waitid.c: New file.
10658         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10659         * sysdeps/unix/sysv/linux/writev.c: New file.
10660         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10661
10662         * pt-readv.c: Fix comment.
10663
10664 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10665
10666         * tst-cleanup1.c: Include stdlib.h.
10667
10668         * tst-cancel5.c: New test.
10669         * Makefile (tests): Add tst-cancel5.
10670         (tst-cancel5): Link against libc.so libpthread.so in that order.
10671
10672 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10673
10674         * forward.c (test_loaded): Prevent recursive calls.
10675
10676         * Makefile (routines): Add libc-cancellation.
10677         * libc-cancellation.c: New file.
10678         * descr.h (struct pthread): Add multiple_threads field.
10679         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10680         new thread descriptor to 1.
10681         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10682         Initialize multiple_thread field after successful thread creation.
10683         * cancellation.c (__do_cancel): Move to pthreadP.h.
10684         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10685         (__pthread_disable_asynccancel): Add internal_function attribute.
10686         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10687         * pthread_setcancelstate.c: Likewise.
10688         * pthread_setcanceltype.c: Likewise.
10689         * pthread_exit.c: Likewise.
10690         * pthreadP.h (CANCELLATION_P): Likewise.
10691         (__do_cancel): Define as static inline.
10692         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10693         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10694         declarations.
10695         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10696         fields.  Define MULTIPLE_THREADS_OFFSET.
10697         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10698         declaration.
10699         * sysdeps/unix/sysv/linux/accept.S: New file.
10700         * sysdeps/unix/sysv/linux/read.c: New file.
10701         * sysdeps/unix/sysv/linux/write.c: New file.
10702         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10703         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10704         initialization of __libc_locking_needed.
10705         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10706         __libc_locking_needed, use multiple_threads field in TCB.
10707         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10708
10709 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10710
10711         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10712         version.
10713         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10714
10715         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10716         access to __libc_locking_needed for PIC.
10717
10718 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10719
10720         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10721         declare for libc.so.
10722         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10723         expression.
10724         (__libc_lock_lock): Put into statement expression.
10725         (__libc_lock_unlock): Remove trailing semicolon.
10726         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10727
10728 2002-12-12  Roland McGrath  <roland@redhat.com>
10729
10730         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10731         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10732
10733 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10734
10735         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10736         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10737         Initialize __libc_locking_needed.
10738         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10739         instead of __register_pthread_fork_handler.
10740         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10741         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10742         fork-gen with libc_pthread_init.
10743         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10744         of __register_pthread_fork_handler.
10745         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10746         of __register_pthread_fork_handler.
10747         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10748         __libc_locking_needed to determine whether lock prefix can be avoided.
10749         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10750
10751 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10752
10753         * Makefile (tests): Add tst-cleanup1.
10754         * tst-cleanup1.c: New file.
10755         * cancellation.c (__cleanup_thread): Removed.
10756         (__do_cancel): Remove call to __cleanup_thread.
10757         * pthreadP.h: Remove __cleanup_thread prorotype.
10758
10759         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10760         Remember function and argument even if cancellation handler
10761         function is not available.
10762         (__libc_cleanup_region_end): Execute registered function directly if
10763         pthread functions are not available.
10764         (__libc_cleanup_end): Likewise.
10765
10766         * init.c (__pthread_initialize_minimal): Fix initialization in
10767         static lib by preventing gcc from being too clever.
10768
10769 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10770
10771         * init.c (__pthread_initialize_minimal): Remove unneccesary
10772         sigaddset call.
10773
10774         * Makefile (tests): We can run tst-locale2 now.
10775
10776 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10777
10778         * Versions: Remove duplicated sigwait entry.
10779
10780 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10781
10782         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10783         inside libpthread.
10784
10785         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10786
10787         * pthreadP.h: Declare __pthread_enable_asynccancel and
10788         __pthread_disable_asynccancel.
10789         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10790         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10791         * cancellation.c (__pthread_enable_asynccancel): New function.
10792         (__pthread_disable_asynccancel): New function.
10793         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10794         * pt-close.c: Likewise.
10795         * pt-connect.c: Likewise.
10796         * pt-creat.c: Likewise.
10797         * pt-fcntl.c: Likewise.
10798         * pt-fsync.c: Likewise.
10799         * pt-lseek.c: Likewise.
10800         * pt-lseek64.c: Likewise.
10801         * pt-msgrcv.c: Likewise.
10802         * pt-msgsnd.c: Likewise.
10803         * pt-msync.c: Likewise.
10804         * pt-nanosleep.c: Likewise.
10805         * pt-open.c: Likewise.
10806         * pt-open64.c: Likewise.
10807         * pt-pause.c: Likewise.
10808         * pt-poll.c: Likewise.
10809         * pt-pread.c: Likewise.
10810         * pt-pread64.c: Likewise.
10811         * pt-pselect.c: Likewise.
10812         * pt-pwrite.c: Likewise.
10813         * pt-pwrite64.c: Likewise.
10814         * pt-read.c: Likewise.
10815         * pt-readv.c: Likewise.
10816         * pt-recv.c: Likewise.
10817         * pt-recvfrom.c: Likewise.
10818         * pt-recvmsg.c: Likewise.
10819         * pt-select.c: Likewise.
10820         * pt-send.c: Likewise.
10821         * pt-sendmsg.c: Likewise.
10822         * pt-sendto.c: Likewise.
10823         * pt-sigpause.c: Likewise.
10824         * pt-sigsuspend.c: Likewise.
10825         * pt-sigtimedwait.c: Likewise.
10826         * pt-sigwait.c: Likewise.
10827         * pt-sigwaitinfo.c: Likewise.
10828         * pt-system.c: Likewise.
10829         * pt-tcdrain.c: Likewise.
10830         * pt-wait.c: Likewise.
10831         * pt-waitid.c: Likewise.
10832         * pt-waitpid.c: Likewise.
10833         * pt-write.c: Likewise.
10834         * pt-writev.c: Likewise.
10835         * pthread_join.c: Likewise.
10836         * pthread_timedjoin.c: Likewise.
10837
10838         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10839         (__xpg_sigpause): New function.
10840         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10841
10842 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10843
10844         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10845
10846         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10847         _GI_pthread_cleanup_pop to pthreadP.h.
10848
10849         * ftrylockfile.c: Use _IO_lock_trylock instead of
10850         pthread_mutex_trylock.
10851
10852         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10853         (CANCEL_RESET): Likewise.
10854         (__pthread_setcanceltype_): Declare.
10855         (__pthread_mutex_lock_internal): Declare.
10856         (__pthread_mutex_unlock_internal): Declare.
10857         (__pthread_once_internal): Declare.
10858         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10859         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10860
10861         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10862         and pthread_mutex_unlock.
10863         * pthread_cond_wait.c: Likewise.
10864         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10865         * pthread_mutex_unlock.c: Likewise.
10866
10867         * pthread_setcanceltype.c: Add additional alias
10868         __pthread_setcanceltype.
10869
10870         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10871         * sem_open.c (sem_open): Likewise.
10872         Use __libc_open, __libc_write, and __libc_close instead of
10873         open, write, and close respectively.
10874
10875         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10876         Rewrite as statement expression since it must return a value.
10877
10878         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10879         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10880         __pthread_kill.
10881
10882         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10883         alias __pthread_once_internal.
10884
10885         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10886
10887 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10888
10889         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10890         * tst-stdio1.c: New file.
10891         * tst-stdio2.c: New file.
10892
10893         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10894
10895         * Makefile (tests): Comment out tst-locale2 for now.
10896         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10897
10898         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10899         -D_IO_MTSAFE_IO.
10900         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10901         Use _IO_lock_init instead of explicit assignment.
10902
10903         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10904         Define __libc_lock_* and __libc_lock_recursive macros with
10905         lowlevellock macros, not pthread mutexes.
10906
10907         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10908         of pthread_mutex_lock.
10909         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10910         instead of pthread_mutex_unlock.
10911
10912 2002-12-06  Roland McGrath  <roland@redhat.com>
10913
10914         * allocatestack.c (__stack_user): Use uninitialized defn.
10915         * init.c (__pthread_initialize_minimal): Initialize it here.
10916
10917 2002-12-05  Roland McGrath  <roland@redhat.com>
10918
10919         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10920         string.
10921         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10922
10923         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10924         missing & here too.
10925
10926 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10927
10928         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10929         lowlevellock.
10930         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10931         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10932         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10933         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10934         for __libc_lock_* macros.
10935         * Makefile (routines): Add libc-lowlevellock.
10936
10937 2002-10-09  Roland McGrath  <roland@redhat.com>
10938
10939         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10940         Under [__PIC__], call the function via the pointer fetched for
10941         comparison rather than a call by name that uses the PLT.
10942         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10943         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10944         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10945         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10946         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10947
10948 2002-12-04  Roland McGrath  <roland@redhat.com>
10949
10950         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10951
10952         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10953         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10954
10955         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10956
10957 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10958
10959         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10960         a completely opaque, non-integer type.
10961         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10962
10963 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10964
10965         * sysdeps/i386/tls.h: Include stdlib.h.
10966         * sysdeps/x86_64/tls.h: Likewise.
10967
10968 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10969
10970         * Makefile (tests): Add tst-locale2.
10971         (tests-static): Likewise.
10972         * tst-locale2.c: New file.
10973
10974         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10975         volatile and add memory clobbers to lock operations.
10976
10977 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10978
10979         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10980         * sysdeps/i386/i486/bits/atomic.h: New file.
10981         * sysdeps/i386/i586/bits/atomic.h: New file.
10982         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10983         include i486 version.
10984         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10985         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10986         Patch by Marijn Ros <marijn@mad.scientist.com>.
10987
10988         * allocatestack.c (get_cached_stack): Don't crash if we first
10989         found a stack with a larger size then needed.
10990         Reported by Hui Huang <hui.huang@sun.com>.
10991
10992         * Makefile (tests): Add tst-sysconf.
10993         * tst-sysconf.c: New file.
10994
10995         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10996         PTHREAD_THREADS_MAX.
10997
10998 2002-12-02  Roland McGrath  <roland@redhat.com>
10999
11000         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
11001         Declare using hidden_proto instead of attribute_hidden, so there are
11002         non-.hidden static symbols for gdb to find.
11003         (__pthread_keys): Likewise.
11004         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
11005         * allocatestack.c (__stack_user): Likewise.
11006         * pthread_create.c (__pthread_keys): Likewise.
11007         (__nptl_threads_events, __nptl_last_event): Make these static instead
11008         of hidden.
11009         * pthread_key_create.c (__pthread_pthread_keys_max,
11010         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
11011
11012 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
11013
11014         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
11015         statically.
11016         * tst-locale1.c: New file.
11017
11018         * pthread_cond_timedwait.c: Include <stdlib.h>.
11019
11020         * Makefile (tests): Add tst-fork2 and tst-fork3.
11021         * tst-fork2.c: New file.
11022         * tst-fork3.c: New file.
11023
11024 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
11025
11026         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
11027
11028         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
11029         require it to 200112L.
11030
11031         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
11032         instruction only if HAVE_CMOV is defined.
11033         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
11034
11035         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
11036
11037         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
11038
11039         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
11040
11041         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
11042
11043 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
11044
11045         * sysdeps/x86_64/bits/atomic.h: New file.
11046
11047         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
11048         16-bit operations.
11049
11050         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
11051         possible since gettid cannot fail.
11052
11053         * sysdeps/x86_64/pthreaddef.h: New file.
11054
11055         * sysdeps/i386/pthreaddef.h (gettid): Removed.
11056
11057         * sysdeps/x86_64/pthread_spin_init.c: New file.
11058         * sysdeps/x86_64/pthread_spin_lock.c: New file.
11059         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
11060         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
11061
11062         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
11063         Add missing lock prefix.  Minute optimization.
11064
11065         * tst-spin2.c (main): Also check successful trylock call.
11066
11067         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
11068         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
11069
11070         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
11071         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
11072
11073         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
11074         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
11075         value in case of an error.  Add support for INTERNAL_SYSCALL.
11076
11077         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
11078         value in case of an error.
11079
11080         * sysdeps/x86_64/tls.h: New file.
11081
11082 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
11083
11084         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
11085         takes the array member name and the index as parameters.
11086         (THREAD_SETMEM_NC): Likewise.
11087         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
11088         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
11089         interfaces.
11090
11091         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
11092         to decide which code to use.
11093         (THREAD_SETMEM_NC): Likewise.
11094
11095         * allocatestack.c (queue_stack): Don't remove stack from list here.
11096         Do it in the caller.  Correct condition to prematurely terminate
11097         loop to free stacks.
11098         (__deallocate_stack): Remove stack from list here.
11099
11100 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
11101
11102         * Makefile (tests): Add tst-stack1.
11103         * tst-stack1.c: New file.
11104
11105         * allocatestack.c (allocate_stack): Initialize the TCB on a user
11106         provided stack.
11107
11108         * pthread_attr_getstack.c: Return bottom of the thread area.
11109
11110 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
11111
11112         * Makefile (libpthread-routines): Add pt-allocrtsig and
11113         pthread_kill_other_threads.
11114         * pt-allocrtsig.c: New file.
11115         * pthread_kill_other_threads.c: New file.
11116         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
11117         all three functions.
11118         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
11119         allocrtsig.
11120         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
11121         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
11122         and __libc_allocate_rtsig_private.
11123         * Versions (libpthread): Export pthread_kill_other_threads_np,
11124         __libc_current_sigrtmin, and __libc_current_sigrtmax.
11125
11126 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
11127
11128         * allocatestack.c (allocate_stack): stackaddr in attribute points to
11129         the end of the stack.  Adjust computations.
11130         When mprotect call fails dequeue stack and free it.
11131         * pthread_attr_setstack.c: Store top of the stack in stackaddr
11132         attribute.
11133         * pthread_getattr_np.c: Likewise.
11134
11135         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
11136         surprises.
11137
11138 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
11139
11140         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
11141         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11142
11143 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
11144
11145         * pthread_getspecific.c: Optimize access to first 2nd-level array.
11146         * pthread_setspecific.c: Likewise.
11147
11148 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
11149
11150         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
11151         definitions.  Get them from the official place.
11152         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
11153
11154         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
11155         Use new CLONE_ flags in clone() calls.
11156
11157         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
11158         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
11159
11160         * Versions: Add pthread_* functions for libc.
11161         * forward.c: New file.
11162
11163         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
11164         errno-loc.
11165         * herrno.c: New file.
11166         * res.c: New file.
11167
11168         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
11169         sem_trywait, and sem_timedwait.  Add herrno and res.
11170         * sem_init.c: Don't initialize lock and waiters members.
11171         * sem_open.c: Likewise.
11172         * sem_post.c: Removed.
11173         * sem_wait.c: Removed.
11174         * sem_trywait.c: Removed.
11175         * sem_timedwait.c: Removed.
11176         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
11177         Includes full implementations of sem_post, sem_wait, sem_trywait,
11178         and sem_timedwait.
11179         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
11180         for new implementation.
11181         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
11182         and waiters fields.
11183
11184         * tst-sem3.c: Improve error message.
11185         * tst-signal3.c: Likewise.
11186
11187         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
11188         to tell the kernel about the termination futex and to initialize tid
11189         member.  Don't initialize main_thread.
11190         * descr.h (struct pthread): Remove main_thread member.
11191         * cancelllation.c (__do_cancel): Remove code handling main thread.
11192         The main thread is not special anymore.
11193
11194         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
11195         size of the stacks to stack_cache_actsize.
11196
11197         * pt-readv.c: Add missing "defined".
11198         * pt-sigwait.c: Likewise.
11199         * pt-writev.c: Likewise.
11200
11201 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
11202
11203         * Versions: Export __connect from libpthread.
11204         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11205
11206         * Makefile (libpthread-routines): Add pt-raise.
11207         * sysdeps/unix/sysv/linux/raise.c: New file.
11208         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
11209         * sysdeps/generic/pt-raise.c: New file.
11210
11211         * pthread_cond_init.c: Initialize all data elements of the condvar
11212         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11213
11214         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
11215         * pthread_create.c: Likewise.
11216
11217         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
11218         * tst-key1.c: New file.
11219         * tst-key2.c: New file.
11220         * tst-key3.c: New file.
11221
11222         * Versions: Export pthread_detach for version GLIBC_2.0.
11223         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
11224
11225 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
11226
11227         * pthread_key_create.c: Terminate search after an unused key was found.
11228         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11229
11230         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
11231         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11232
11233 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
11234
11235         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
11236         dynamic lookup for errno in PIC.
11237
11238         * allocatestack.c (get_cached_stack): Rearrange code slightly to
11239         release the stack lock as soon as possible.
11240         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
11241         the static TLS block.
11242         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
11243
11244         * cancellation.c: Renamed from cancelation.c.
11245         * Makefile: Adjust accordingly.
11246         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
11247         * cleanup_defer.c: Use CANCELLATION_P.
11248         * pthread_testcancel.c: Likewise.
11249         * descr.h: Fix spelling in comments.
11250         * init.c: Likewise.
11251         * pthread_getattr_np.c: Likewise.
11252         * pthread_getschedparam.c: Likewise.
11253         * pthread_setschedparam.c: Likewise.
11254         * Versions: Likewise.
11255
11256         * pt-pselect.c: New file.
11257         * Makefile (libpthread-routines): Add pt-pselect.
11258         * Versions: Add pselect.
11259
11260         * tst-cancel4.c: New file.
11261         * Makefile (tests): Add tst-cancel4.
11262
11263 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
11264
11265         * pthread_mutex_lock.c: Always record lock ownership.
11266         * pthread_mutex_timedlock.c: Likewise.
11267         * pthread_mutex_trylock.c: Likewise.
11268
11269         * pt-readv.c: New file.
11270         * pt-writev.c: New file.
11271         * pt-creat.c: New file.
11272         * pt-msgrcv.c: New file.
11273         * pt-msgsnd.c: New file.
11274         * pt-poll.c: New file.
11275         * pt-select.c: New file.
11276         * pt-sigpause.c: New file.
11277         * pt-sigsuspend.c: New file.
11278         * pt-sigwait.c: New file.
11279         * pt-sigwaitinfo.c: New file.
11280         * pt-waitid.c: New file.
11281         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11282         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11283         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11284         * Versions: Add all the new functions.
11285
11286         * tst-exit1.c: New file.
11287         * Makefile (tests): Add tst-exit1.
11288
11289         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11290
11291 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11292
11293         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11294
11295         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11296         call.  pthread_join is an official cancellation point.
11297         * pthread_timedjoin.c: Likewise.
11298
11299         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11300         and the condvar's mutex are retrieved.
11301         * pthread_cond_timedwait.c: Likewise.
11302         Reported by dice@saros.East.Sun.COM.
11303
11304 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11305
11306         * pthreadP.h: Cut out all type definitions and move them...
11307         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11308         * pthreadP.h: Include <internaltypes.h>.
11309
11310         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11311         performance tweaks.
11312
11313         * sem_trywait.c: Shuffle #includes around to get right order.
11314         * sem_timedwait.c: Likewise.
11315         * sem_post.c: Likewise.
11316         * sem_wait.c: Likewise.
11317
11318         * nptl 0.3 released.
11319
11320         * Makefile (tests): Add tst-signal3.
11321         * tst-signal3.c: New file.
11322
11323 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11324
11325         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11326         the asms modify the sem object.
11327         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11328
11329         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11330         the actual members.
11331         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11332         * semaphoreP.h: Include pthreadP.h.
11333         * sem_getvalue.c: Adjust to sem_t change.
11334         * sem_init.c: Likewise.
11335         * sem_open.c: Likewise.
11336         * sem_post.c: Likewise.
11337         * sem_timedwait.c: Likewise.
11338         * sem_trywait.c: Likewise.
11339         * sem_wait.c: Likewise.
11340
11341 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11342
11343         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11344         * tst-basic2.c: New file.
11345         * tst-exec1.c: New file.
11346         * tst-exec2.c: New file.
11347         * tst-exec3.c: New file.
11348
11349         * tst-fork1.c: Remove extra */.
11350
11351         * nptl 0.2 released.  The API for IA-32 is complete.