Merge branch 'master' of ssh://sourceware.org/git/glibc
[platform/upstream/glibc.git] / nptl / ChangeLog
1 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
2
3         * sysdeps/unix/sysv/linux/i386/Makefile: New file.
4
5 2010-05-01  Alan Modra  <amodra@gmail.com>
6
7         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8         (PSEUDO): Use correct cr save.  Don't use wrong parm save area
9         to save temps.  Correct cfi for possible later frame manipulation.
10         (DOCARGS_1, UNDOCARGS_1): Use the correct parm save area.
11         (DOCARGS_2, UNDOCARGS_2, DOCARGS_3, UNDOCARGS_3): Likewise.
12         (DOCARGS_4, UNDOCARGS_4, DOCARGS_5, UNDOCARGS_5): Likewise.
13         (DOCARGS_6, UNDOCARGS_6): Likewise.
14         (CENABLE, CDISABLE): Add nops for non-shared calls.
15
16 2010-07-06  Andreas Schwab  <schwab@redhat.com>
17
18         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
19         Fix type mismatch.
20
21 2010-07-03  Ulrich Drepper  <drepper@redhat.com>
22
23         * tst-abstime.c (do_test): Some more cleanups
24
25 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
26
27         * tst-abstime.c: Correct testing and add test for sem_timedwait.
28
29 2010-07-01  Andreas Schwab  <schwab@redhat.com>
30             Ulrich Drepper  <drepper@redhat.com>
31
32         * Makefile (tests): Add tst-abstime.
33         * tst-abstime.c: New file.
34         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
35         (__lll_timedlock_wait): Check for timestamp before the Epoch.
36         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
37         (__lll_timedlock_wait): Likewise.
38         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
39         (__lll_robust_timedlock_wait): Likewise.
40         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
41         (__pthread_cond_timedwait): Likewise.
42         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
43         (pthread_rwlock_timedrdlock): Likewise.
44         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
45         (pthread_rwlock_timedwrlock): Likewise.
46         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
47         Likewise.
48
49 2010-07-01  Ulrich Drepper  <drepper@redhat.com>
50
51         * Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
52
53 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
54
55         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
56         location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
57
58 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
59
60         [BZ #11390]
61         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
62         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
63         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
64         pthread_setname.
65         * Makefile (libpthread-routines): Add pthread_getname and
66         pthread_setname.
67         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
68
69 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
70
71         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
72         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
73         * sysdeps/pthread/Makefile: Remove csu section and rt section's
74         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
75
76 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
77
78         * pthread_cond_timedwait.c: Add check for
79         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
80         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
81         INTERNAL_SYSCALL.
82
83 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
84
85         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
86         and the call fails wake eventually waiting setxid threads.  Don't free
87         stack here if we try starting a thread.
88         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
89         if the clone call failed.
90
91 2010-03-08  Andreas Schwab  <schwab@redhat.com>
92
93         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
94         * allocatestack.c (get_cached_stack): Set setxid_futex.
95         (allocate_stack): Likewise.
96
97 2010-03-05  Andreas Schwab  <schwab@redhat.com>
98             Ulrich Drepper  <drepper@redhat.com>
99
100         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
101         it is creating a thread or it is just being created.
102         * pthread_create.c (start_thread): Wake setxid thread if it is
103         waiting.
104         (__pthread_create_2_1): Initialize setxid_futex.
105         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
106         is waiting.
107
108 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
109
110         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
111         Fix unwind info.
112         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
113
114 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
115
116         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
117         Fix pthread_cond_timedwait with requeue-PI.
118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
119         Fix pthread_cond_wait with requeue-PI.
120
121 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
122
123         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
124         and pthread_mutexattr_setrobust for GLIBC_2.12.
125         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
126         * pthread_mutexattr_getrobust.c: Define alias
127         pthread_mutexattr_getrobust.
128         * pthread_mutexattr_setrobust.c: Define alias
129         pthread_mutexattr_setrobust.
130
131 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
132
133         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
134
135 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
136
137         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
138
139 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
140
141         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
142         call __gmon_start__.
143         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
144
145 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
146
147         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
148         using memset.
149
150 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
151
152         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
153         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
154         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
155         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
156         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
157         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
158         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
159         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
160
161 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
162
163         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
164         Don't update nwaiters after invalid timeout is recognized.
165
166 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
167
168         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
169         __gmon_start__.
170
171 2009-11-27  Andreas Schwab  <schwab@redhat.com>
172
173         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
174         THREAD_SELF->cancelhandling after returning from futex call.
175
176 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
177
178         * tst-sem13.c: New file.
179         * Makefile (tests): Add tst-sem13.
180
181 2009-11-22  Roland McGrath  <roland@redhat.com>
182
183         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
184         instead of recapitulating its contents.
185
186 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
187
188         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
189         optimizations and cleanups.
190
191 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
192
193         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
194         Remove redundant code. Fix cfi offsets.
195         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
196         Fix cfi offsets.
197
198 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
199
200         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
201         reduce size of unwind info.
202
203         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
204         cfi directives.
205         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
206         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
207
208 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
209
210         [BZ #4457]
211         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
212         LIBGCC_S_SO.
213         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
214
215 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
216
217         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
218
219         [BZ #3270]
220         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
221         steps to avoid races with creation and terminations.
222         * nptl-init.c (sighandler_setxid): Adjust.
223         Patch by Daniel Jacobowitz.
224
225 2009-09-07  Andreas Schwab  <schwab@redhat.com>
226
227         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
228
229 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
230             Joseph Myers  <joseph@codesourcery.com>
231
232         [BZ #7094]
233         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
234         Initialize the sigev_notify field for newly created timer to make sure
235         the timer gets deleted from the active timer's list upon timer_delete.
236
237 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
238
239         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
240         Correct a logic error.
241
242 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
243
244         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
245         of the field in local variables.
246         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
247         variable and don't unconditionally clear it.
248
249 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
250
251         * pthread_create.c (start_thread): Hint to the kernel that memory for
252         the stack can be reused.  We do not mark all the memory.  The part
253         still in use and some reserve are kept.
254
255 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
256
257         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
258
259 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
260
261         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
262         directives.
263
264 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
265
266         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
267         directives.
268         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
269
270 2009-08-10  Andreas Schwab  <schwab@redhat.com>
271
272         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
273         (__pthread_cond_signal): Don't clobber register used for syscall
274         number.
275
276 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
277
278         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
279         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
280
281         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
282         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
283         register.
284
285 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
286
287         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
288         enabled by the special *_asynccancel functions.
289         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
290         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
291
292         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
293
294 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
295
296         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
297         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
298         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
299         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
300         since we can assume the special __*_{en,dis}able_asynccancel
301         functions.
302         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
303         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
304         and PTHREAD_CANCELED.
305
306 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
307
308         * descr.h: Better definition of *_BITMASK macros for cancellation.
309
310 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
311
312         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
313
314         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
315         dynamic linker might have to save.
316         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
317         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
318         printing.
319
320         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
321
322 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
323
324         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
325         New function.
326         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
327         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
328         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
329         requeue_pi for robust mutexes.
330         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
331         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
332         Don't only skip __pthread_mutex_cond_lock.  Call instead
333         __pthread_mutex_cond_lock_adjust.
334         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
335
336         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
337         optimization of PI mutex handling.
338
339 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
340
341         [BZ #10418]
342         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
343         instead of of _acq variants of cmpxchg.
344
345 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
346
347         * sysdeps/x86_64/configure.in: New file.
348
349         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
350         path when not using absolute timeout futex.
351
352 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
353
354         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
355         optimizations of last changes.
356         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
357
358 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
359
360         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
361         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
362         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
363         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
364         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
365         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
366         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
367         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
368
369         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
370         (__pthread_cond_timedwait): Make more robust.
371
372 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
373
374         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
375         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
376         directly use absolute timeout.
377
378         * tst-sem5.c (do_test): Add test for premature timeout.
379         * Makefile: Linu tst-sem5 with librt.
380
381         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
382         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
383         directly use absolute timeout.
384         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
385         (pthread_rwlock_timedrdlock): Likewise.
386
387         * tst-cond11.c (run_test): Add test to check that the timeout is
388         long enough.
389
390         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
391         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
392         directly use absolute timeout.
393
394         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
395         (__pthread_cond_wait): Convert to using exception handler instead of
396         registered unwind buffer.
397         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
398         (__pthread_cond_timedwait): Likewise.
399
400 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
401
402         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
403         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
404         use absolute timeout.
405
406         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
407         handling of uncontested semaphore.
408
409         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
410         (__condvar_cleanup): Rewrite to use cfi directives instead of
411         hand-coded unwind tables.
412         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
413         Likewise.
414         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
415         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
416         Likewise.
417
418 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
419
420         * Makefile (libpthread-routines): Add pthread_sigqueue.
421         * Versions: Add pthread_sigqueue for GLIBC_2.11.
422         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
423         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
424
425 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
426
427         [BZ #10262]
428         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
429         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
430         cannot be assumed.
431         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
432
433 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
434
435         * libc-cancellation.c: Move __libc_cleanup_routine to...
436         * libc-cleanup.c: ...here.  New file.
437         * Makefile (routines): Add libc-cleanup.
438
439         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
440         test.
441         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
442         * sysdeps/pthread/librt-cancellation.c: Likewise.
443
444         [BZ #9924]
445         * nptl-init.c: Renamed from init.c.
446         * Makefile: Change all occurences of init.c to nptl-init.c.
447
448 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
449
450         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
451         to test when deciding on the delay.
452         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
453         * pthread_cancel.c: Close race between deciding on sending a signal
454         and setting the CANCELING_BIT bit.
455
456         * cancellation.c (__pthread_disable_asynccancel): Don't return if
457         thread is canceled.
458         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
459
460 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
461
462         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
463         is available.
464         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
465         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
466         * sysdeps/i386/tls.h: Likewise.
467         (tcbhead_t): Add __private_tm member.
468
469 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
470
471         * sem_open.c (sem_open): Rewrite initialization of initsem to
472         avoid warnings.
473
474         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
475         Avoid warning by using may_alias attribute on ptrhack.
476
477 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
478
479         [BZ #10090]
480         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
481         Check policy and priority for validity.
482         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
483
484 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
485
486         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
487         (__pthread_cond_timedwait): Change to use cfi directives instead of
488         hand-coded unwind sections.
489
490 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
491
492         * init.c (nptl_freeres): Compile only for SHARED.
493
494 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
495
496         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
497         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
498         FUTEX_BITSET_MATCH_ANY.
499
500 2009-02-27  Roland McGrath  <roland@redhat.com>
501
502         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
503         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
504
505 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
506
507         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
508         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
509         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
510         200112L to 200809L.
511
512 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
513
514         * sysdeps/pthread/pthread.h: The robust mutex functions are in
515         POSIX 2008.
516
517 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
518
519         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
520         Unify name of include protector macro.
521
522 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
523
524         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
525         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
526
527 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
528
529         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
530         pointer variables.
531
532         * allocatestack.c (__free_stacks): Renamed from free_stacks.
533         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
534         * init.c (nptl_freeres): New function.
535         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
536         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
537         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
538         variable.
539         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
540         load DSO.  Assign last.
541         (__unwind_freeres): New function.
542
543         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
544         for better debugging.  No need to use stack_list_add here.
545
546 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
547
548         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
549         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
550         instead of computing relative timeout.
551         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
552         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
553
554 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
555
556         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
557
558 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
559
560         * sysdeps/pthread/list.h (list_add): Initialize new element first.
561         (list_add_tail): Removed.
562
563 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
564
565         * (in_flight_stack): New variable.
566         (stack_list_del): New function.  Use instead of list_del.
567         (stack_list_add): New function.  Use instead of list_add when adding to
568         stack_cache and stack_used lists.
569         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
570         when the fork call interrupted another thread.
571
572 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
573
574         * init.c (__pthread_initialize_minimal_internal): Optimize test
575         FUTEX_CLOCK_REALTIME a bit.
576
577 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
578
579         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
580         only passing five parameters to FUTEX_WAIT_BITSET call.
581
582         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
583         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
584         instead of computing relative timeout.
585
586 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
587
588         * init.c (__pthread_initialize_minimal_internal): Check for
589         FUTEX_CLOCK_REALTIME flag.
590         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
591         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
592         relative timeout.
593
594         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
595         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
596         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
597         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
598         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
599         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
600
601 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
602
603         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
604         loop body instead of ; to avoid gcc warnings.
605         (pthread_cleanup_pop_restore_np): Likewise.
606         Patch by Caolán McNamara <caolanm@redhat.com>.
607
608 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
609
610         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
611         fast path here, for robust/PI/PP mutexes call
612         __pthread_mutex_lock_full.  Don't use switch, instead use a series
613         of ifs according to their probability.
614         (__pthread_mutex_lock_full): New function.
615         * pthread_mutex_unlock.c: Include assert.h.
616         (__pthread_mutex_unlock_usercnt): Handle only the
617         fast path here, for robust/PI/PP mutexes call
618         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
619         of ifs according to their probability.
620         (__pthread_mutex_unlock_full): New function.
621         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
622         (__pthread_mutex_lock_full): Define.
623
624 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
625
626         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
627         implementation.  Add necessary padding and.
628         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
629         words.
630
631 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
632
633         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
634         and FUTEX_WAKE_BITSET.
635
636 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
637
638         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
639         and FUTEX_WAKE_BITSET.
640         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
641         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
642         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
643         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
644
645 2008-11-25  Roland McGrath  <roland@redhat.com>
646
647         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
648         Subdirectories moved to ports repository as
649         sysdeps/.../nptl subdirectories.
650
651 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
652
653         [BZ #7008]
654         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
655         of old value.
656         * pthread_cond_init.c (__pthread_cond_init): Fix
657         cond->__data.__nwaiters initialization.
658         * Makefile (tests): Add tst-cond23.
659         * tst-cond23.c: New test.
660
661 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
662
663         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
664         arguments.
665         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
666         arguments.
667
668 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
669
670         [BZ #6955]
671         * pthread_mutex_lock.c: Add support for private PI mutexes.
672         * pthread_mutex_timedlock.c: Likewise.
673         * pthread_mutex_trylock.c: Likewise.
674         * pthread_mutex_unlock.c: Likewise.
675         Patch mostly by Ben Jackson <ben@ben.com>.
676
677 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
678
679         [BZ #6843]
680         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
681         Increase stack size for helper thread.
682
683 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
684
685         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
686         assembly with a clobber list for access registers a0 and a1.
687
688 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
689
690         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
691         to force runp->refcntr to be read from memory.
692
693 2008-09-08  Richard Guenther  <rguenther@suse.de>
694
695         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
696         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
697         lll_timedlock, lll_robust_timedlock, lll_unlock,
698         lll_robust_unlock): Promote private to int.
699
700 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
701
702         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
703         ARCH_RETRY_MMAP definitions.
704         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
705         Define MAP_STACK when not defined.
706         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
707         handling of ARCH_RETRY_MMAP.
708
709 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
710
711         * tst-align2.c (f): Print message that f is reached.
712
713 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
714
715         [BZ #6740]
716         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
717         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
718
719 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
720
721         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
722         SOCK_CLOEXEC if possible.
723
724 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
725
726         * Makefile (tests): Add tst-rwlock2a.
727         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
728         * tst-rwlock2a.c: New file.
729
730 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
731
732         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
733
734 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
735
736         * sysdeps/pthread/pthread.h: Fix typo in comment.
737
738 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
739
740         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
741         of CPU set to the kernel.
742
743 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
744
745         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
746         cfi directives.
747         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
748         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
749         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
750         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
751         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
752         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
753
754 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
755
756         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
757         cfi directives.
758         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
759         Likewise.
760         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
761         Likewise.
762         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
763         Likewise.
764
765 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
766
767         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
768
769 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
770
771         David S. Miller  <davem@davemloft.net>
772
773         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
774
775 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
776
777         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
778         __pshared correctly.
779         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
780         Likewise.
781         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
782         Likewise.
783         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
784         Likewise.
785         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
786         Likewise.
787         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
788
789 2008-04-14  David S. Miller  <davem@davemloft.net>
790
791         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
792         (__old_sem_wait): Fix argument to lll_futex_wait().
793
794 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
795
796         * pthread_create.c: Require pthread_mutex_trylock and
797         pthread_key_delete for libgcc.
798
799 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
800
801         [BZ #6020]
802         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
803         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
804         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
805
806 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
807
808         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
809         <linux/limits.h> has defined it.
810         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
811         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
812         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
813         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
814
815 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
816
817         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
818         of ASSEMBLER.
819         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
820         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
821
822 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
823
824         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
825         HAVE_DL_DISCOVER_OSVERSION.
826         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
827         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
828
829 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
830
831         [BZ #5778]
832         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
833         _POSIX_CHOWN_RESTRICTED value to zero.
834
835 2008-01-31  Roland McGrath  <roland@redhat.com>
836
837         * Makefile (omit-deps): Variable removed.
838
839 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
840
841         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
842         unnecessary addr32 prefix.
843
844 2008-01-29  Roland McGrath  <roland@redhat.com>
845
846         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
847
848 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
849
850         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
851
852 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
853
854         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
855         a scratch register.
856         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
857         (__lll_lock_wait_private): Fix typo.
858         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
859         (pthread_barrier_wait): Likewise.  Adjust XADD use.
860         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
861         Adjust XADD use.
862         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
863         (pthread_rwlock_timedrdlock): Return correct return value.
864         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
865         (pthread_rwlock_timedwrlock): Likewise.
866
867 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
868
869         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
870         thread returns the program exits with an error code.
871
872 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
873
874         * pthread-errnos.sym: Add EOVERFLOW.
875         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
876         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
877         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
878         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
879
880 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
881
882         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
883         parameter.  Passed it as permission to mmap.
884         * allocatestack.c (allocate_stack): Pass prot as second parameter
885         to ARCH_RETRY_MMAP.
886
887 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
888
889         * tst-basic7.c: Allocate memory for the stack.
890
891         [BZ #5465]
892         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
893         (__pthread_cond_timedwait): Don't use VDSO.
894         Patch by Michal Januszewski.
895
896 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
897
898         [BZ #5455]
899         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
900         Allow label before pthread_cleanup_pop.
901         (pthread_cleanup_pop_restore_np): Likewise.
902
903 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
904
905         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
906         Store 2 before returning ETIMEDOUT.
907
908 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
909
910         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
911         Store 2 before returning ETIMEDOUT.
912         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
913         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
914         (__lll_lock_wait_private): Optimize.
915         (__lll_lock_wait): Likewise.
916
917 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
918
919         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
920         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
921         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
922
923 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
924
925         [BZ #5240]
926         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
927         If we time out, try one last time to lock the futex to avoid
928         losing a wakeup signal.
929         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
930         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
931
932         [BZ #5245]
933         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
934         if necessary.
935
936 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
937
938         [BZ #5245]
939         * allocatestack.c (allocate_stack): Change ENOMEM error in case
940         mmap failed to EAGAIN.
941         * Makefile (tests): Add tst-basic7.
942         * tst-basic7.c: New file.
943
944 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
945
946         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
947         Use __linkin_atfork.
948
949 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
950
951         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
952         missing line continuations.
953         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
954         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
955
956 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
957
958         [BZ #5220]
959         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
960         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
961         (struct timer): Add next element.
962         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
963         enqueue timer structure into __active_timer_sigev_thread list.
964         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
965         remove timer struct from __active_timer_sigev_thread.
966         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
967         Before using timer structure make sure it is still on the
968         __active_timer_sigev_thread list.  Keep lock until done.
969         Define __active_timer_sigev_thread and
970         __active_timer_sigev_thread_lock.
971
972 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
973
974         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
975         Redefine thread_atfork for use of ATFORK_MEM.
976         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
977         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
978         function.
979         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
980         Use atomic operation when removing first element of list.
981
982 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
983
984         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
985         routine instead of an alias to __new_sem_post.
986
987 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
988
989         * init.c (__pthread_initialize_minimal): Initialize word to appease
990         valgrind.
991
992 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
993
994         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
995         libc.so just clear NAME.
996         (__libc_rwlock_fini): Nop inside of libc.so.
997         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
998         all zeros.
999
1000 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
1001
1002         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1003         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
1004         unlocking failed.
1005         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
1006
1007 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
1008
1009         [BZ #4938]
1010         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
1011         reclaimed stack if necessary.
1012         * Makefile (tests): Add tst-tsd6.
1013         * tst-tsd6.c: New file.
1014
1015 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1016
1017         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
1018         Add private argument.
1019
1020 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
1021
1022         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1023         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
1024
1025 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
1026
1027         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
1028         (__lll_robust_timedlock): Pass private as last argument to
1029         __lll_robust_timedlock_wait.
1030         (__lll_unlock): Fix a pasto.
1031
1032 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1033
1034         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
1035         sparc_old_sem): New structs.
1036         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
1037         (__sem_wait_cleanup): New function.
1038         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
1039         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1040         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1041         lll_futex_wait.
1042         (__old_sem_wait): New function.
1043         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
1044         nptl/sysdeps/unix/sysv/linux/sparc version.
1045         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
1046         Likewise.
1047         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
1048         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
1049         (__new_sem_trywait): Use sparc_old_sem structure.
1050         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
1051         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
1052         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1053         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1054         lll_futex_timed_wait.
1055         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
1056         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
1057         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1058         lll_futex_wake.
1059         (__old_sem_post): New function.
1060         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
1061         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
1062         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
1063         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
1064         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
1065         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
1066
1067 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1068
1069         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1070         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1071         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1072         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1073         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
1074         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1075         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1076         Use FUTEX_WAKE_OP.
1077         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1078         kernel-features.h and tcb-offsets.h.
1079         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1080         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1081         process private.
1082         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1083         tcb-offsets.h.
1084         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
1085         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1086         process private.
1087         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
1088         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1089         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1090         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1091         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1092         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1093         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1094
1095 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
1096
1097         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
1098         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1099         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
1100         lll_futex_timed_wait.
1101
1102         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
1103         __lll_robust_unlock): Rewrite as macros instead of inline functions.
1104         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
1105         __lll_robust_unlock, __lll_wait_tid): Likewise.
1106
1107 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1108
1109         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1110         Fix a pasto.
1111         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1112         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1113         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1114         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1115         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1116         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1117         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
1119         kernel-features.h.
1120         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1121         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1122         process private.  Switch DW_CFA_advance_loc1 and some
1123         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1124         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1125         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
1126         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1127         process private.  Switch DW_CFA_advance_loc{1,2} and some
1128         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1129         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
1130         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1131         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1132         Likewise.
1133         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1134         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1135         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1136         Likewise.
1137         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1138         (__pthread_cond_broadcast): Compare %r8 instead of
1139         dep_mutex-cond_*(%rdi) with $-1.
1140         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1141         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1142         of oring.
1143
1144 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1145
1146         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1147
1148 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1149
1150         * allocatestack.c: Include kernel-features.h.
1151         * pthread_create.c: Likewise.
1152         * pthread_mutex_init.c: Likewise.
1153         * init.c: Likewise.
1154         * pthread_cond_timedwait.c: Likewise.
1155         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1156         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1157         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1158         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1159         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1160         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1161         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1162         Likewise.
1163         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1164         Likewise.
1165         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1166         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1167         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1168         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1169
1170 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1171
1172         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1173         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1174         byte elements.  One of them is the new __shared element.
1175         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1176         adjust names of other padding elements.
1177         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1178         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1179         byte elements.  One of them is the new __shared element.
1180         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1181         adjust names of other padding elements.
1182         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1183         Renamed __pad1 element to __shared, adjust names of other padding
1184         elements.
1185         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1186         (pthread_rwlock_t): Likewise.
1187         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1188         typo.
1189
1190 2007-08-09  Anton Blanchard  <anton@samba.org>
1191
1192         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1193
1194 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1195
1196         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1197         <kernel-features.h>.
1198         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1199
1200 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1201
1202         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1203         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1204         dealing with robust mutexes.
1205         * pthread_mutex_timedlock.c: Likewise.
1206         * pthread_mutex_trylock.c: Likewise.
1207         * pthread_mutex_unlock.c: Likewise.
1208         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1209
1210 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1211
1212         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1213         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1214         (PTHREAD_MUTEX_PSHARED): Define.
1215         * pthread_mutex_init.c (__pthread_mutex_init): Set
1216         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1217         mutexes.
1218         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1219         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1220         as second argument to lll_lock.
1221         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1222         instead of its __data.__lock field.
1223         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1224         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1225         to lll_robust_lock.
1226         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1227         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1228         instead of mutex->__data.__kind directly, pass
1229         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1230         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1231         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1232         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1233         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1234         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1235         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1236         of mutex->__data.__kind directly.
1237         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1238         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1239         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1240         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1241         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1242         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1243         and lll_futex_wake.
1244         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1245         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1246         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1247         directly.
1248         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1249         Take mutex as argument instead of its __data.__lock field, pass
1250         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1251         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1252         __data.__lock field.
1253         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1254         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1255         to lll_robust_cond_lock.
1256         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1257         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1258         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1259         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1260         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1261         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1262         lll_futex_wait.
1263         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1264         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1265         lll_futex_wake.
1266         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1267         pshared variable, pass it to lll_lock, lll_unlock,
1268         lll_futex_timedwait and lll_futex_wake.
1269         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1270         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1271         and lll_futex_wake.
1272         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1273         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1274         macro.
1275         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1276         lll_futex_wake_unlock): Likewise.
1277         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1278         Likewise.
1279         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1280         lll_futex_wake_unlock): Likewise.
1281         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1282         Likewise.
1283         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1284         lll_futex_wake_unlock): Likewise.
1285         (lll_futex_wake): Fix a typo.
1286         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1287         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1288         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1289         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1290         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1291         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1292         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1293         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1295         (__pthread_cond_timedwait): Likewise.
1296         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1297         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1298
1299 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1300
1301         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1302         Don't use CGOTSETUP and CGOTRESTORE macros.
1303         (CGOTSETUP, CGOTRESTORE): Remove.
1304         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1305         @local symbol.
1306
1307 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1308
1309         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1310         definitions for private futexes.
1311         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1312         kernel-features.h and lowlevellock.h.  Use private futexes if
1313         they are available.
1314         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1315         (__lll_mutex_lock_wait): Rename to
1316         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1317         (__lll_mutex_timedlock_wait): Rename to ...
1318         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1319         Don't compile in for libc.so.
1320         (__lll_mutex_unlock_wake): Rename to ...
1321         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1322         (__lll_timedwait_tid): Use __NR_gettimeofday.
1323         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1324         the header from assembler.  Renamed all lll_mutex_* resp.
1325         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1326         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1327         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1328         Define.
1329         (__lll_lock_wait_private): Add prototype.
1330         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1331         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1332         __lll_unlock_wake): Likewise.
1333         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1334         if private is constant LLL_PRIVATE.
1335         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1336         lll_timedlock, lll_robust_timedlock): Add private argument.
1337         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1338         if private is constant LLL_PRIVATE.
1339         (lll_robust_unlock, lll_robust_dead): Add private argument.
1340         (lll_lock_t): Remove.
1341         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1342         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1343         lll_cond_wake, lll_cond_broadcast): Remove.
1344         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1345         kernel-features.h and lowlevellock.h.
1346         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1347         (LOAD_FUTEX_WAIT): Define.
1348         (__lll_robust_mutex_lock_wait): Rename to ...
1349         (__lll_robust_lock_wait): ... this.  Add private argument.
1350         Use LOAD_FUTEX_WAIT macro.
1351         (__lll_robust_mutex_timedlock_wait): Rename to ...
1352         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1353         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1354         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1355         lowlevellock.h.
1356         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1357         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1358         __lll_mutex_{lock,unlock}_*.
1359         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1360         lowlevellock.h and pthread-errnos.h.
1361         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1362         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1363         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1364         __lll_mutex_{lock,unlock}_*.
1365         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1366         lowlevellock.h and pthread-errnos.h.
1367         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1368         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1369         __lll_mutex_{lock,unlock}_*.
1370         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1371         lowlevellock.h.
1372         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1373         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1374         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1375         (__condvar_tw_cleanup): Likewise.
1376         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1377         lowlevellock.h.
1378         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1379         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1380         __lll_mutex_{lock,unlock}_*.
1381         ( __condvar_w_cleanup): Likewise.
1382         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1383         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1384         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1385         lowlevellock.h.
1386         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1387         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1388         __lll_mutex_{lock,unlock}_*.
1389         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1390         lowlevellock.h.
1391         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1392         FUTEX_PRIVATE_FLAG): Remove.
1393         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1394         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1395         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1396         lowlevellock.h.
1397         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1398         FUTEX_PRIVATE_FLAG): Remove.
1399         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1400         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1401         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1402         lowlevellock.h.
1403         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1404         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1405         __lll_mutex_{lock,unlock}_*.
1406         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1407         lowlevellock.h.
1408         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1409         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1410         __lll_mutex_{lock,unlock}_*.
1411         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1412         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1413         (__new_sem_post): Use standard initial exec code sequences.
1414         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1415         lowlevellock.h.
1416         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1417         FUTEX_PRIVATE_FLAG): Remove.
1418         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1419         exec code sequences.
1420         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1421         (__new_sem_trywait): Use standard initial exec code sequences.
1422         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1423         (__new_sem_wait): Use standard initial exec code sequences.
1424
1425 2007-07-31  Anton Blanchard  <anton@samba.org>
1426
1427         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1428         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1429         atomic_full_barrier.
1430
1431 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1432
1433         * allocatestack.c (stack_cache_lock): Change type to int.
1434         (get_cached_stack, allocate_stack, __deallocate_stack,
1435         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1436         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1437         as second argument to lll_lock and lll_unlock macros on
1438         stack_cache_lock.
1439         * pthread_create.c (__find_in_stack_list): Likewise.
1440         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1441         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1442         as second argument.
1443         * descr.h (struct pthread): Change lock and setxid_futex field
1444         type to int.
1445         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1446         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1447         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1448         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1449         Likewise.
1450         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1451         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1452         * pthreadP.h (__attr_list_lock): Change type to int.
1453         * pthread_attr_init.c (__attr_list_lock): Likewise.
1454         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1455         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1456         lll_{,un}lock.
1457         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1458         also for lll_futex_{wake,wait}.
1459         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1460         a pointer to const.
1461         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1462         LLL_SHARED as second argument to lll_{,un}lock.
1463         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1464         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1465         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1466         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1467         Likewise.
1468         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1469         as second argument to lll_{,un}lock macros on pd->lock.
1470         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1471         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1472         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1473         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1474         Likewise.
1475         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1476         Likewise.
1477         * pthread_once.c (once_lock): Change type to int.
1478         (__pthread_once): Pass LLL_PRIVATE as second argument to
1479         lll_{,un}lock macros on once_lock.
1480         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1481         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1482         rwlock->__data.__shared as second argument to them and similarly
1483         for lll_futex_w*.
1484         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1485         Likewise.
1486         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1487         Likewise.
1488         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1489         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1490         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1491         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1492         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1493         to lll_{,un}lock macros on __sem_mappings_lock.
1494         * sem_open.c (check_add_mapping): Likewise.
1495         (__sem_mappings_lock): Change type to int.
1496         * semaphoreP.h (__sem_mappings_lock): Likewise.
1497         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1498         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1499         instead of lll_*mutex_*, pass LLL_SHARED as last
1500         argument.
1501         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1502         pass LLL_SHARED as last argument.
1503         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1504         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1505         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1506         pass LLL_SHARED as last argument.
1507         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1508         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1509         LLL_SHARED as last argument.
1510         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1511         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1512         Similarly.
1513         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1514         __libc_lock_lock_recursive, __libc_lock_unlock,
1515         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1516         argument to lll_{,un}lock.
1517         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1518         _IO_lock_unlock): Likewise.
1519         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1520         compound literal.
1521         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1522         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1523         __fork_lock.
1524         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1525         free_mem): Likewise.
1526         (__fork_lock): Change type to int.
1527         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1528         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1529         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1530         lll_futex_wake.
1531         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1532         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1533         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1534         New function.
1535         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1536         pass it through to lll_futex_*wait, only compile in when
1537         IS_IN_libpthread.
1538         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1539         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1540         argument and pass it through to lll_futex_*wait.
1541         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1542         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1543         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1544         inline functions to __lll_* resp. __lll_robust_*.
1545         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1546         (lll_mutex_dead): Add private argument.
1547         (__lll_lock_wait_private): New prototype.
1548         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1549         __lll_robust_lock_timedwait): Add private argument to prototypes.
1550         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1551         call __lll_lock_wait_private, otherwise pass private to
1552         __lll_lock_wait.
1553         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1554         __lll_robust_timedlock): Add private argument, pass it to
1555         __lll_*wait functions.
1556         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1557         call __lll_unlock_wake_private, otherwise pass private to
1558         __lll_unlock_wake.
1559         (__lll_robust_unlock): Add private argument, pass it to
1560         __lll_robust_unlock_wake.
1561         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1562         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1563         argument, pass it through to __lll_* inline function.
1564         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1565         (lll_lock_t): Remove.
1566         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1567         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1568         lll_cond_wake, lll_cond_broadcast): Remove.
1569         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1570         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1571         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1572         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1573         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1574         the header from assembler.  Renamed all lll_mutex_* resp.
1575         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1576         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1577         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1578         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1579         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1580         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1581         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1582         Remove prototype.
1583         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1584         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1585         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1586         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1587         MULTIPLE_THREADS_OFFSET as another asm operand.
1588         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1589         MULTIPLE_THREADS_OFFSET as last asm operand, call
1590         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1591         otherwise pass private as another argument to __lll_lock_wait.
1592         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1593         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1594         private as another argument to __lll_*lock_wait call.
1595         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1596         MULTIPLE_THREADS_OFFSET as another asm operand, call
1597         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1598         otherwise pass private as another argument to __lll_unlock_wake.
1599         (lll_robust_unlock): Add private argument, pass private as another
1600         argument to __lll_unlock_wake.
1601         (lll_robust_dead): Add private argument, use __lll_private_flag
1602         macro.
1603         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1604         LLL_MUTEX_LOCK_INITIALIZER.
1605         (lll_lock_t): Remove.
1606         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1607         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1608         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1609         lll_cond_wake, lll_cond_broadcast): Remove.
1610         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1611         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1612         2007-05-2{3,9} changes.
1613         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1614         kernel-features.h and lowlevellock.h.
1615         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1616         (LOAD_FUTEX_WAIT): Rewritten.
1617         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1618         define.
1619         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1620         (__lll_mutex_lock_wait): Rename to ...
1621         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1622         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1623         (__lll_mutex_timedlock_wait): Rename to ...
1624         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1625         contains private argument.  Don't compile in for libc.so.
1626         (__lll_mutex_unlock_wake): Rename to ...
1627         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1628         Don't compile in for libc.so.
1629         (__lll_timedwait_tid): Use __NR_gettimeofday.
1630         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1631         kernel-features.h and lowlevellock.h.
1632         (LOAD_FUTEX_WAIT): Define.
1633         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1634         define.
1635         (__lll_robust_mutex_lock_wait): Rename to ...
1636         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1637         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1638         macro.
1639         (__lll_robust_mutex_timedlock_wait): Rename to ...
1640         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1641         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1642         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1643         lowlevellock.h.
1644         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1645         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1646         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1647         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1648         to __lll_lock_wait in %edx.
1649         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1650         Include lowlevellock.h and pthread-errnos.h.
1651         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1652         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1653         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1654         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1655         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1656         __lll_unlock_wake.
1657         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1658         Include lowlevellock.h and pthread-errnos.h.
1659         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1660         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1661         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1662         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1663         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1664         __lll_unlock_wake.
1665         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1666         Include lowlevellock.h.
1667         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1668         Don't define.
1669         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1670         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1671         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1672         __lll_unlock_wake.  Use __NR_gettimeofday.
1673         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1674         Include lowlevellock.h.
1675         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1676         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1677         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1678         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1679         and __lll_unlock_wake.
1680         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1681         Include lowlevellock.h.
1682         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1683         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1684         MUTEX(%ebx) address in %edx rather than %ecx to
1685         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1686         and __lll_unlock_wake.  Move return value from %ecx to %edx
1687         register.
1688         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1689         Include lowlevellock.h.
1690         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1691         Don't define.
1692         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1693         MUTEX(%ebp) address in %edx rather than %ecx to
1694         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1695         and __lll_unlock_wake.  Move return value from %ecx to %edx
1696         register.  Use __NR_gettimeofday.
1697         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1698         Include lowlevellock.h.
1699         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1700         Don't define.
1701         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1702         MUTEX(%ebp) address in %edx rather than %ecx to
1703         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1704         and __lll_unlock_wake.  Move return value from %ecx to %edx
1705         register.  Use __NR_gettimeofday.
1706         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1707         Include lowlevellock.h.
1708         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1709         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1710         MUTEX(%edi) address in %edx rather than %ecx to
1711         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1712         and __lll_unlock_wake.
1713         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1714         Include lowlevellock.h.
1715         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1716         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1717         MUTEX(%ebx) address in %edx rather than %ecx to
1718         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1719         and __lll_unlock_wake.  Move return value from %ecx to %edx
1720         register.
1721         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1722         lowlevellock.h.
1723         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1724         define.
1725         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1726         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1727         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1728         lowlevellock.h.
1729         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1730         (sem_timedwait): Use __NR_gettimeofday.
1731         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1732         lowlevellock.h.
1733         (LOCK): Don't define.
1734         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1735         lowlevellock.h.
1736         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1737         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1738         are waiters.
1739         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1740         2007-05-2{3,9} changes.
1741         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1742         kernel-features.h and lowlevellock.h.
1743         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1744         (LOAD_FUTEX_WAIT): Rewritten.
1745         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1746         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1747         (__lll_mutex_lock_wait): Rename to ...
1748         (__lll_lock_wait): ... this.  %esi is now private argument.
1749         Don't compile in for libc.so.
1750         (__lll_mutex_timedlock_wait): Rename to ...
1751         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1752         Don't compile in for libc.so.
1753         (__lll_mutex_unlock_wake): Rename to ...
1754         (__lll_unlock_wake): ... this.  %esi contains private argument.
1755         Don't compile in for libc.so.
1756         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1757         kernel-features.h and lowlevellock.h.
1758         (LOAD_FUTEX_WAIT): Define.
1759         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1760         (__lll_robust_mutex_lock_wait): Rename to ...
1761         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1762         Use LOAD_FUTEX_WAIT macro.
1763         (__lll_robust_mutex_timedlock_wait): Rename to ...
1764         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1765         private, use LOAD_FUTEX_WAIT macro.
1766         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1767         lowlevellock.h.
1768         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1769         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1770         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1771         __lll_lock_wait and __lll_unlock_wake.
1772         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1773         Include lowlevellock.h and pthread-errnos.h.
1774         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1775         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1776         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1777         pass LLL_SHARED in %esi to both __lll_lock_wait and
1778         __lll_unlock_wake.
1779         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1780         Include lowlevellock.h and pthread-errnos.h.
1781         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1782         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1783         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1784         pass LLL_SHARED in %esi to both __lll_lock_wait and
1785         __lll_unlock_wake.
1786         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1787         Include lowlevellock.h.
1788         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1789         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1790         pass LLL_SHARED in %esi to both __lll_lock_wait and
1791         __lll_unlock_wake.
1792         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1793         Include lowlevellock.h.
1794         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1795         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1796         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1797         and __lll_unlock_wake.
1798         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1799         Include lowlevellock.h.
1800         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1801         Don't define.
1802         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1803         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1804         and __lll_unlock_wake.
1805         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1806         Include lowlevellock.h.
1807         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1808         Don't define.
1809         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1810         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1811         and __lll_unlock_wake.
1812         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1813         Include lowlevellock.h.
1814         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1815         Don't define.
1816         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1817         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1818         and __lll_unlock_wake.
1819         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1820         Include lowlevellock.h.
1821         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1822         Don't define.
1823         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1824         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1825         and __lll_unlock_wake.
1826         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1827         Include lowlevellock.h.
1828         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1829         Don't define.
1830         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1831         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1832         and __lll_unlock_wake.
1833         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1834         lowlevellock.h.
1835         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1836         define.
1837         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1838         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1839         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1840         lowlevellock.h.
1841         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1842         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1843         lowlevellock.h.
1844         (LOCK): Don't define.
1845         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1846         lowlevellock.h.
1847         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1848         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1849         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1850         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1851         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1852         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1853         (__lll_lock_wait_private): New function.
1854         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1855         it to lll_futex_*wait.  Don't compile in for libc.so.
1856         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1857         Remove.
1858         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1859         (struct sparc_pthread_barrier): Remove.
1860         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1861         struct sparc_pthread_barrier.  Pass
1862         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1863         and lll_futex_wait macros.
1864         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1865         Remove.
1866         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1867         Include sparc pthread_barrier_wait.c instead of generic one.
1868
1869 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1870
1871         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1872
1873         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1874         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1875         %ecx.
1876         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1877         (pthread_rwlock_timedwrlock): Likewise.
1878         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1879         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1880
1881 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1882
1883         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1884
1885 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1886
1887         * tst-locale2.c (useless): Add return statement.
1888
1889 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1890
1891         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1892         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1893         * pthread_create.c (start_thread): Likewise.
1894         * init.c (sighandler_setxid): Likewise.
1895         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1896         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1897         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1898         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1899         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1900         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1901         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1902         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1903         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1904         Likewise.
1905         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1906         Likewise.
1907         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1908         Likewise.
1909         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1910         __rtld_notify): Likewise.
1911         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1912         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1913         __pthread_once): Likewise.
1914         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1915         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1916         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1917         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1918         (lll_futex_wait): Add private argument, define as wrapper around
1919         lll_futex_timed_wait.
1920         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1921         use __lll_private_flag macro.
1922         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1923         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1924         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1925         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1926         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1927         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1928         (lll_futex_wait): Add private argument, define as wrapper around
1929         lll_futex_timed_wait.
1930         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1931         use __lll_private_flag macro.
1932         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1933         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1934         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1935         Define.
1936         (lll_futex_timed_wait, lll_futex_wake): Use it.
1937         (lll_private_futex_wait, lll_private_futex_timed_wait,
1938         lll_private_futex_wake): Removed.
1939         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1940         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1941         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1942         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1943         (lll_futex_wait): Add private argument, define as wrapper around
1944         lll_futex_timed_wait.
1945         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1946         use __lll_private_flag macro.
1947         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1948         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1949         to lll_futex_*.
1950         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1951         (lll_private_futex_wait, lll_private_futex_timed_wait,
1952         lll_private_futex_wake): Removed.
1953         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1954         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1955         (lll_private_futex_wait, lll_private_futex_timed_wait,
1956         lll_private_futex_wake): Removed.
1957         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1958         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1959         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1960         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1961         (lll_futex_wait): Add private argument, define as wrapper around
1962         lll_futex_timed_wait.
1963         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1964         use __lll_private_flag macro.
1965         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1966         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1967         to lll_futex_*.
1968         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1969         Define.
1970         (lll_futex_timed_wait, lll_futex_wake): Use it.
1971         (lll_private_futex_wait, lll_private_futex_timed_wait,
1972         lll_private_futex_wake): Removed.
1973
1974 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1975
1976         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1977         of the structure for sparc32.
1978
1979 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1980
1981         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1982
1983 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1984
1985         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1986         code used when private futexes are assumed.
1987         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1988         Likewise.
1989
1990 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1991
1992         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1993         (__lll_private_flag): Define.
1994         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1995         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1996         __lll_private_flag.
1997         (lll_private_futex_wait, lll_private_futex_timedwait,
1998         lll_private_futex_wake): Define as wrapper around non-_private
1999         macros.
2000         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2001         (__lll_private_flag): Define.
2002         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
2003         (lll_private_futex_wait, lll_private_futex_timedwait,
2004         lll_private_futex_wake): Define as wrapper around non-_private
2005         macros.
2006
2007 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
2008
2009         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
2010         parameter to lll_futex_wait call.
2011         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
2012
2013         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2014         Replace lll_futex_wait with lll_private_futex_wait.
2015         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
2016         Add LLL_SHARED parameter to lll_futex_wake().
2017
2018         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
2019         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
2020         lll_private_futex_wake.
2021         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
2022         bit from private parm before syscall.
2023         (lll_futex_timed_wait): Likewise.
2024         (lll_futex_wake): Likewise.
2025         (lll_futex_wake_unlock): Likewise.
2026         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
2027         (lll_robust_mutex_unlock): Likewise.
2028         (lll_mutex_unlock_force): Likewise.
2029         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
2030
2031 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2032
2033         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2034         compilation when unconditionally using private futexes.
2035         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2036         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2037         Likewise.
2038         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2039         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2040
2041 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
2042
2043         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
2044         Define.
2045
2046 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2047
2048         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
2049         kernel-features.h.
2050
2051 2007-05-16  Roland McGrath  <roland@redhat.com>
2052
2053         * init.c (__nptl_initial_report_events): New variable.
2054         (__pthread_initialize_minimal_internal): Initialize pd->report_events
2055         to that.
2056
2057 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
2058
2059         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
2060         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2061
2062 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
2063
2064         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
2065         implementation.
2066
2067 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
2068
2069         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
2070         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
2071         * pthread_mutex_timedlock.c: Likewise.
2072         * pthread_mutex_trylock.c: Likewise.
2073         * pthread_mutex_unlock.c: Likewise.
2074
2075 2007-06-17  Andreas Schwab  <schwab@suse.de>
2076
2077         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
2078         sections.
2079
2080 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
2081
2082         * allocatestack.c (allocate_stack): Make code compile if
2083         __ASSUME_PRIVATE_FUTEX is set.
2084
2085 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2086
2087         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
2088         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
2089         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
2090         (__pthread_rwlock_wrlock): Likewise.
2091         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2092         (pthread_rwlock_timedrdlock): Likewise.
2093         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2094         (pthread_rwlock_timedwrlock): Likewise.
2095         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
2096         (__pthread_rwlock_unlock): Likewise.
2097
2098 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2099
2100         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
2101         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
2102         Split __flags into __flags, __shared, __pad1 and __pad2.
2103         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
2104         futexes if they are available.
2105         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
2106         in libc-lowlevellock.S allow using private futexes.
2107         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2108         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
2109         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
2110         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
2111         lll_private_futex_timed_wait and lll_private_futex_wake.
2112         (lll_robust_mutex_unlock): Fix typo.
2113         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
2114         field in futex command setup.
2115         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
2116         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
2117         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2118         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
2119         if they are available.  Remove clear_once_control.
2120         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
2121         futexes if they are available.
2122         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2123         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2124         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2125         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2126         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
2127         Wake only when there are waiters.
2128         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
2129         support.  Indicate that there are waiters.  Remove unnecessary
2130         extra cancellation test.
2131         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
2132         left-over duplication of __sem_wait_cleanup.
2133
2134 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2135
2136         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2137         parameter to lll_futex_wait, lll_futex_timed_wait, and
2138         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2139         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2140         lll_private_futex_wake.
2141         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2142         * allocatestack.c: Adjust use of lll_futex_* macros.
2143         * init.c: Likewise.
2144         * lowlevellock.h: Likewise.
2145         * pthread_barrier_wait.c: Likewise.
2146         * pthread_cond_broadcast.c: Likewise.
2147         * pthread_cond_destroy.c: Likewise.
2148         * pthread_cond_signal.c: Likewise.
2149         * pthread_cond_timedwait.c: Likewise.
2150         * pthread_cond_wait.c: Likewise.
2151         * pthread_create.c: Likewise.
2152         * pthread_mutex_lock.c: Likewise.
2153         * pthread_mutex_setprioceiling.c: Likewise.
2154         * pthread_mutex_timedlock.c: Likewise.
2155         * pthread_mutex_unlock.c: Likewise.
2156         * pthread_rwlock_timedrdlock.c: Likewise.
2157         * pthread_rwlock_timedwrlock.c: Likewise.
2158         * pthread_rwlock_unlock.c: Likewise.
2159         * sysdeps/alpha/tls.h: Likewise.
2160         * sysdeps/i386/tls.h: Likewise.
2161         * sysdeps/ia64/tls.h: Likewise.
2162         * sysdeps/powerpc/tls.h: Likewise.
2163         * sysdeps/pthread/aio_misc.h: Likewise.
2164         * sysdeps/pthread/gai_misc.h: Likewise.
2165         * sysdeps/s390/tls.h: Likewise.
2166         * sysdeps/sh/tls.h: Likewise.
2167         * sysdeps/sparc/tls.h: Likewise.
2168         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2169         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2170         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2171         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2172         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2173         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2174         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2175         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2176         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2177         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2178         Likewise.
2179         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2180         * sysdeps/x86_64/tls.h: Likewise.
2181
2182 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2183
2184         * pthread_getattr_np.c: No need to install a cancellation handler,
2185         this is no cancellation point.
2186         * pthread_getschedparam.c: Likewise.
2187         * pthread_setschedparam.c: Likewise.
2188         * pthread_setschedprio.c: Likewise.
2189         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2190         lll_unlock_wake_cb.
2191         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2192         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2193         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2194         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2195         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2196         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2197         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2198         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2199         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2200         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2201         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2202         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2203
2204         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2205         whether there are more than one thread makes no sense here since
2206         we only call the slow path if the locks are taken.
2207         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2208
2209         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2210         COND_NWAITERS_SHIFT.
2211         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2212         COND_CLOCK_BITS.
2213         * pthread_cond_init.c: Likewise.
2214         * pthread_cond_timedwait.c: Likewise.
2215         * pthread_cond_wait.c: Likewise.
2216         * pthread_condattr_getclock.c: Likewise.
2217         * pthread_condattr_setclock.c: Likewise.
2218         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2219         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2221         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2222         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2223
2224 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2225
2226         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2227         unistd.h.
2228
2229         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2230         insn suffix.
2231         (THREAD_GSCOPE_GET_FLAG): Remove.
2232         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2233         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2234         changes.
2235         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2236         (THREAD_GSCOPE_GET_FLAG): Remove.
2237         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2238         instead of THREAD_GSCOPE_GET_FLAG.
2239         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2240         it.
2241         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2242         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2243         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2244         THREAD_GSCOPE_WAIT): Define.
2245         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2246         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2247         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2248         THREAD_GSCOPE_WAIT): Define.
2249         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2250         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2251         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2252         THREAD_GSCOPE_WAIT): Define.
2253         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2254         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2255         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2256         THREAD_GSCOPE_WAIT): Define.
2257
2258 2007-05-24  Richard Henderson  <rth@redhat.com>
2259
2260         * descr.h (struct pthread): Add header.gscope_flag.
2261         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2262         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2263         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2264         THREAD_GSCOPE_WAIT): Define.
2265
2266 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2267
2268         * init.c: Make it compile with older kernel headers.
2269
2270         * tst-initializers1.c: Show through exit code which test failed.
2271
2272         * pthread_rwlock_init.c: Also initialize __shared field.
2273         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2274         element in rwlock structure into four byte elements.  One of them is
2275         the new __shared element.
2276         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2277         Likewise.
2278         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2279         __shared, adjust names of other padding elements.
2280         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2281         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2282         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2283         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2284         FUTEX_PRIVATE_FLAG.
2285         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2286         futex to use private operations if possible.
2287         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2288         Likewise.
2289         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2290         Likewise.
2291         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2292         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2293         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2294         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2295         Likewise.
2296         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2297         Likewise.
2298         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2299         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2300
2301 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2302
2303         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2304         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2305         * pthread_rwlock_timedrdlock.c: Likewise.
2306         * pthread_rwlock_tryrdlock.c: Likewise.
2307
2308         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2309         optimization.
2310
2311         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2312         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2313         duplication of __sem_wait_cleanup.
2314
2315         * allocatestack.c: Revert last change.
2316         * init.c: Likewise.
2317         * sysdeps/i386/tls.h: Likewise.
2318         * sysdeps/x86_64/tls.h: Likewise.
2319         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2320         header structure.
2321         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2322
2323         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2324         Add private field.
2325         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2326         * pthread_barrier_init.c: Set private flag if pshared and private
2327         futexes are supported.
2328         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2329         private field in futex command setup.
2330         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2331
2332 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2333
2334         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2335         support.
2336         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2337         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2338         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2339         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2340         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2341
2342         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2343         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2344         fields in the structure.
2345         (__old_sem_init): New function.
2346         * sem_open.c: Initialize all fields of the structure.
2347         * sem_getvalue.c: Adjust for renamed element.
2348         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2349         (gen-as-const-headers): Add structsem.sym.
2350         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2351         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2352         struct new_sem.  Add struct old_sem.
2353         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2354         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2355         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2356         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2357         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2358         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2359         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2360         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2361         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2362         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2363         * tst-sem10.c: New file.
2364         * tst-sem11.c: New file.
2365         * tst-sem12.c: New file.
2366         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2367         of struct sem.
2368
2369 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2370             Jakub Jelinek  <jakub@redhat.com>
2371
2372         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2373         Move __pthread_enable_asynccancel right before futex syscall.
2374         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2375         Likewise.
2376
2377 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2378
2379         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2380         THREAD_COPY_PRIVATE_FUTEX): Define.
2381         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2382         THREAD_COPY_PRIVATE_FUTEX): Define.
2383         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2384         * init.c (__pthread_initialize_minimal_internal): Use
2385         THREAD_SET_PRIVATE_FUTEX.
2386
2387         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2388         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2389         THREAD_GSCOPE_FLAG_WAIT): Define.
2390         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2391         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2392         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2393         PTR_DEMANGLE.
2394         (THREAD_GSCOPE_GET_FLAG): Define.
2395         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2396         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2397         instead of ->header.gscope_flag directly.
2398
2399 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2400
2401         * init.c (__pthread_initialize_minimal_internal): Check whether
2402         private futexes are available.
2403         * allocatestack.c (allocate_stack): Copy private_futex field from
2404         current thread into the new stack.
2405         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2406         futexes if they are available.
2407         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2408         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2409         in libc-lowlevellock.S allow using private futexes.
2410         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2411         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2412         FUTEX_PRIVATE_FLAG.
2413         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2414         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2415         if they are available.
2416         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2417         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2418         * sysdeps/i386/tcb-offsets.sym: Likewise.
2419         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2420         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2421
2422 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2423
2424         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2425         Remove ptr_wait_lookup_done again.
2426         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2427         (__pthread_initialize_minimal_internal): Initialize
2428         _dl_wait_lookup_done pointer in _rtld_global directly.
2429         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2430         Remove code to code _dl_wait_lookup_done.
2431         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2432         encrypted for now.
2433
2434 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2435
2436         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2437         pthread_mutex_init failed with ENOTSUP.
2438
2439 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2440
2441         * allocatestack.c (__wait_lookup_done): New function.
2442         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2443         Add ptr_wait_lookup_done.
2444         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2445         * pthreadP.h: Declare __wait_lookup_done.
2446         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2447         Define macros to implement reference handling of global scope.
2448         * sysdeps/x86_64/tls.h: Likewise.
2449         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2450         Initialize GL(dl_wait_lookup_done).
2451
2452 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2453
2454         [BZ #4512]
2455         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2456         is detected.
2457         * pthread_mutex_timedlock.c: Likewise.
2458         * pthread_mutex_trylock.c: Likewise.
2459         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2460
2461         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2462         * tst-robust9.c: New file.
2463         * tst-robustpi9.c: New file.
2464
2465         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2466         unnecessary extra cancellation test.
2467
2468 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2469
2470         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2471         extra cancellation test.
2472         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2473
2474 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2475
2476         * descr.h (struct pthread): Rearrange members to fill hole in
2477         64-bit layout.
2478
2479         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2480         (__pthread_setaffinity_new): If syscall was successful and
2481         RESET_VGETCPU_CACHE is defined, use it before returning.
2482         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2483
2484 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2485
2486         [BZ #4455]
2487         * tst-align2.c: Include stackinfo.h.
2488         * tst-getpid1.c: Likewise.
2489
2490 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2491
2492         [BZ #4455]
2493         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2494         * tst-getpid1.c (do_test): Likewise.
2495
2496         [BZ #4456]
2497         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2498         (allocate_stack): Likewise.
2499
2500 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2501
2502         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2503         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2504         (__lll_robust_timedlock_wait): Likewise.
2505         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2506
2507 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2508
2509         [BZ #4465]
2510         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2511         * tst-cancel4.c (tf_fdatasync): New test.
2512
2513 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2514
2515         [BZ #4392]
2516         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2517         check mutexes like normal mutexes.
2518
2519         [BZ #4306]
2520         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2521         Initialize the whole sigevent structure to appease valgrind.
2522
2523 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2524
2525         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2526         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2527
2528 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2529
2530         * tst-locale1.c: Avoid warnings.
2531         * tst-locale2.c: Likewise.
2532
2533 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2534
2535         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2536         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2537
2538 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2539
2540         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2541         __extern_always_inline where appropriate.
2542         * sysdeps/pthread/pthread.h: Likewise.
2543
2544 2007-03-13  Richard Henderson  <rth@redhat.com>
2545
2546         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2547         separate cfi regions for the two subsections.
2548
2549 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2550
2551         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2552         new thread, don't just decrement it.
2553         Patch by Suzuki K P <suzuki@in.ibm.com>.
2554
2555 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2556
2557         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2558         PTHFCT_CALL definition.
2559
2560 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2561
2562         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2563         available, don't use it.
2564
2565 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2566
2567         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2568         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2569         call into the kernel to delay.
2570
2571 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2572
2573         * tst-initializers1.c: We want to test the initializers as seen
2574         outside of libc, so undefined _LIBC.
2575
2576         * pthread_join.c (cleanup): Avoid warning.
2577
2578 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2579
2580         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2581         (__lll_timedwait_tid): Add unwind info.
2582
2583         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2584         function table, mangle the pointers.
2585         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2586         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2587         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2588         demangle pointers before use.
2589         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2590         demangle pointer.
2591         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2592         * sysdeps/pthread/setxid.h: Likewise.
2593
2594 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2595
2596         * tst-rwlock7.c: Show some more information in case of correct
2597         behavior.
2598
2599 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2600
2601         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2602         (lll_futex_timed_wait): Undo part of last change, don't negate
2603         return value.
2604
2605 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2606
2607         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2608         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2609
2610 2006-12-28  David S. Miller  <davem@davemloft.net>
2611
2612         * shlib-versions: Fix sparc64 linux target specification.
2613
2614 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2615
2616         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2617         Adjust include path for pthread_barrier_wait.c move.
2618
2619 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2620
2621         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2622         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2623
2624 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2625
2626         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2627         6 argument cancellable syscalls.
2628         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2629         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2630         6 argument cancellable syscalls.
2631         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2632
2633 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2634
2635         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2636         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2637
2638 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2639
2640         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2641         __sync_lock_release instead of __sync_lock_release_si.
2642
2643 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2644
2645         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2646         Define.
2647         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2648         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2649         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2650         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2651         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2652         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2653         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2654         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2655         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2656         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2657         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2658
2659 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2660
2661         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2662         * pthread_barrier_wait.c: ...here.
2663         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2664         * pthread_cond_broadcast.c: ...here.
2665         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2666         * pthread_cond_signal.c: ...here.
2667         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2668         * pthread_cond_timedwait.c: ...here.
2669         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2670         * pthread_cond_wait.c: ...here.
2671         * sysdeps/pthread/pthread_once.c: Move to...
2672         * pthread_once.c: ...here.
2673         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2674         * pthread_rwlock_rdlock.c: ...here.
2675         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2676         * pthread_rwlock_timedrdlock.c: ...here.
2677         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2678         * pthread_rwlock_timedwrlock.c: ...here.
2679         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2680         * pthread_rwlock_unlock.c: ...here.
2681         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2682         * pthread_rwlock_wrlock.c: ...here.
2683         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2684         * pthread_spin_destroy.c: ...here.
2685         * sysdeps/pthread/pthread_spin_init.c: Move to...
2686         * pthread_spin_init.c: ...here.
2687         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2688         * pthread_spin_unlock.c: ...here.
2689         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2690         * pthread_getcpuclockid.c: ...here.
2691
2692         * init.c: USE_TLS support is now always enabled.
2693         * tst-tls5.h: Likewise.
2694         * sysdeps/alpha/tls.h: Likewise.
2695         * sysdeps/i386/tls.h: Likewise.
2696         * sysdeps/ia64/tls.h: Likewise.
2697         * sysdeps/powerpc/tls.h: Likewise.
2698         * sysdeps/s390/tls.h: Likewise.
2699         * sysdeps/sh/tls.h: Likewise.
2700         * sysdeps/sparc/tls.h: Likewise.
2701         * sysdeps/x86_64/tls.h: Likewise.
2702
2703 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2704
2705         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2706         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2707         failed.
2708
2709         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2710         Define to THREAD_SELF->header.multiple_threads.
2711         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2712         Likewise.
2713         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2714         Likewise.
2715         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2716         (SINGLE_THREAD_P): Likewise.
2717         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2718         (SINGLE_THREAD_P): Likewise.
2719         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2720         (SINGLE_THREAD_P): Likewise.
2721         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2722         (SINGLE_THREAD_P): Likewise.
2723         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2724         Likewise.
2725         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2726         (SINGLE_THREAD_P): Likewise.
2727         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2728         (SINGLE_THREAD_P): Likewise.
2729         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2730         Likewise.
2731
2732 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2733
2734         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2735         by default rather than 2_3_3.
2736
2737 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2738
2739         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2740         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2741         atomic_* instead of catomic_* macros.
2742
2743 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2744
2745         [BZ #3285]
2746         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2747         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2748         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2749         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2750         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2751         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2752         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2753         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2754         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2755         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2756         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2757         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2758         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2759
2760 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2761
2762         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2763         cancelable syscalls with six parameters.
2764
2765         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2766         operations instead of atomic_*.
2767
2768 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2769
2770         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2771
2772 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2773
2774         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2775         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2776         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2777         New file.
2778         * pthread_attr_setstack.c: Allow overwriting the version number of the
2779         new symbol.
2780         * pthread_attr_setstacksize.c: Likewise.
2781         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2782         it.
2783         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2784         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2785
2786 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2787
2788         [BZ #3251]
2789         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2790         Patch by Petr Baudis.
2791
2792 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2793
2794         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2795
2796         * tst-cancel2.c (tf): Loop as long as something was written.
2797
2798 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2799
2800         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2801         mutexes wake all mutexes.
2802         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2803         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2804         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2805
2806 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2807
2808         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2809         to guarantee the thread is always canceled.
2810
2811 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2812
2813         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2814         Include stdlib.h.
2815         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2816         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2817         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2818         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2819         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2820
2821 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2822
2823         [BZ #3123]
2824         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2825         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2826         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2827         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2828         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2829         * Makefile (tests): Add tst-cond22.
2830         * tst-cond22.c: New file.
2831
2832 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2833
2834         [BZ #3124]
2835         * descr.h (struct pthread): Add parent_cancelhandling.
2836         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2837         cancelhandling value to child.
2838         * pthread_create.c (start_thread): If parent thread was canceled
2839         reset the SIGCANCEL mask.
2840         * Makefile (tests): Add tst-cancel25.
2841         * tst-cancel25.c: New file.
2842
2843 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2844             Ulrich Drepper  <drepper@redhat.com>
2845
2846         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2847         counterp if it is already zero.
2848         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2849
2850 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2851             Roland McGrath  <roland@redhat.com>
2852
2853         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2854         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2855         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2856         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2857         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2858         lll_robust_mutex_timedlock, lll_mutex_unlock,
2859         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2860         Add _L_*_ symbols around the subsection.
2861         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2862         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2863
2864 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2865             Roland McGrath  <roland@redhat.com>
2866
2867         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2868         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2869         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2870         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2871         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2872         lll_robust_mutex_timedlock, lll_mutex_unlock,
2873         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2874         Add _L_*_ symbols around the subsection.
2875         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2876         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2877
2878 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2879
2880         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2881         change because it can disturb too much existing code.  If real hard
2882         reader preference is needed we'll introduce another type.
2883         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2884         (pthread_rwlock_timedwrlock): Likewise.
2885         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2886         Likewise.
2887
2888 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2889
2890         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2891         reader preference.
2892         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2893         (pthread_rwlock_timedwrlock): Likewise.
2894         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2895         Likewise.
2896
2897 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2898
2899         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2900         Only define ifdef SHARED.
2901
2902 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2903
2904         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2905         (free_stacks): ...here.
2906         (__free_stack_cache): New function.
2907         * pthreadP.h: Declare __free_stack_cache.
2908         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2909         ptr_freeres.
2910         * init.c (pthread_functions): Initialize ptr_freeres.
2911         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2912         New freeres function.
2913
2914 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2915
2916         [BZ #3018]
2917         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2918
2919 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2920
2921         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2922         _XOPEN_REALTIME_THREADS.
2923
2924 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2925
2926         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2927         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2928         HAVE_CLOCK_GETTIME_VSYSCALL.
2929         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2930
2931 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2932
2933         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2934         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2935         * descr.h (struct priority_protection_data): New type.
2936         (struct pthread): Add tpp field.
2937         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2938         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2939         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2940         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2941         TPP mutexes.
2942         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2943         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2944         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2945         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2946         * tpp.c: New file.
2947         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2948         boosted by TPP.
2949         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2950         * pthread_mutexattr_getprioceiling.c
2951         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2952         in the SCHED_FIFO priority range.
2953         * pthread_mutexattr_setprioceiling.c
2954         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2955         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2956         if mutex is not TPP.  Ceiling is now in __data.__lock.
2957         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2958         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2959         is now in __data.__lock.  Add locking.
2960         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2961         * Makefile (libpthread-routines): Add tpp.
2962         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2963         * tst-tpp.h: New file.
2964         * tst-mutexpp1.c: New file.
2965         * tst-mutexpp6.c: New file.
2966         * tst-mutexpp10.c: New file.
2967         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2968         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2969
2970 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2971
2972         [BZ #2843]
2973         * pthread_join.c (pthread_join): Account for self being canceled
2974         when checking for deadlocks.
2975         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2976         (tf1): Don't print anything after pthread_join returns, this would be
2977         another cancellation point.
2978         (tf2): Likewise.
2979         * tst-join6.c: New file.
2980         * Makefile (tests): Add tst-join6.
2981
2982 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2983
2984         [BZ #2892]
2985         * pthread_setspecific.c (__pthread_setspecific): Check
2986         out-of-range index before checking for unused key.
2987
2988         * sysdeps/pthread/gai_misc.h: New file.
2989
2990 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2991
2992         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2993         file.  Don't use sysctl.
2994         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2995         overwrite the file if this is likely not true.
2996
2997 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2998
2999         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
3000         * Makefile (tests): Add tst-getpid3.
3001         * tst-getpid3.c: New file.
3002
3003 2006-07-30  Roland McGrath  <roland@redhat.com>
3004
3005         * Makefile (libpthread-routines): Add ptw-sigsuspend.
3006
3007         * sysdeps/unix/sysv/linux/i386/not-cancel.h
3008         (pause_not_cancel): New macro.
3009         (nanosleep_not_cancel): New macro.
3010         (sigsuspend_not_cancel): New macro.
3011         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
3012         nanosleep_not_cancel macro from <not-cancel.h>.
3013         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
3014         macro from <not-cancel.h>.
3015
3016 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
3017             Jakub Jelinek  <jakub@redhat.com>
3018
3019         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
3020         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
3021         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
3022         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
3023         * pthread_mutex_init.c: Add support for priority inheritance mutex.
3024         * pthread_mutex_lock.c: Likewise.
3025         * pthread_mutex_timedlock.c: Likewise.
3026         * pthread_mutex_trylock.c: Likewise.
3027         * pthread_mutex_unlock.c: Likewise.
3028         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
3029         all mutexes.
3030         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
3031         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
3032         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
3033         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
3034         pthread-pi-defines.sym.
3035         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
3036         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
3037         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3038         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
3039         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3040         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3041         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3042         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
3043         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3044         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3045         _POSIX_THREAD_PRIO_INHERIT to 200112L.
3046         * tst-mutex1.c: Adjust to allow use in PI mutex test.
3047         * tst-mutex2.c: Likewise.
3048         * tst-mutex3.c: Likewise.
3049         * tst-mutex4.c: Likewise.
3050         * tst-mutex5.c: Likewise.
3051         * tst-mutex6.c: Likewise.
3052         * tst-mutex7.c: Likewise.
3053         * tst-mutex7a.c: Likewise.
3054         * tst-mutex8.c: Likewise.
3055         * tst-mutex9.c: Likewise.
3056         * tst-robust1.c: Likewise.
3057         * tst-robust7.c: Likewise.
3058         * tst-robust8.c: Likewise.
3059         * tst-mutexpi1.c: New file.
3060         * tst-mutexpi2.c: New file.
3061         * tst-mutexpi3.c: New file.
3062         * tst-mutexpi4.c: New file.
3063         * tst-mutexpi5.c: New file.
3064         * tst-mutexpi6.c: New file.
3065         * tst-mutexpi7.c: New file.
3066         * tst-mutexpi7a.c: New file.
3067         * tst-mutexpi8.c: New file.
3068         * tst-mutexpi9.c: New file.
3069         * tst-robust1.c: New file.
3070         * tst-robust2.c: New file.
3071         * tst-robust3.c: New file.
3072         * tst-robust4.c: New file.
3073         * tst-robust5.c: New file.
3074         * tst-robust6.c: New file.
3075         * tst-robust7.c: New file.
3076         * tst-robust8.c: New file.
3077         * Makefile (tests): Add the new tests.
3078
3079         * pthread_create.c (start_thread): Add some casts to avoid warnings.
3080         * pthread_mutex_destroy.c: Remove unneeded label.
3081
3082 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
3083
3084         * pthread_mutex_init.c (__pthread_mutex_init): Move some
3085         computations to compile time.
3086
3087 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
3088
3089         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
3090
3091 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
3092
3093         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
3094
3095 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
3096
3097         * pthread_key_create.c (__pthread_key_create): Do away with
3098         __pthread_keys_lock.
3099
3100         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3101         (__kernel_cpumask_size): Mark as hidden.
3102         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3103
3104         * sem_open.c (__sem_mappings_lock): Mark as hidden.
3105         * semaphoreP.h (__sem_mappings_lock): Likewise.
3106
3107 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
3108
3109         * pthread_atfork.c: Mark __dso_handle as hidden.
3110
3111 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
3112
3113         [BZ #2644]
3114         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
3115         the reload problem.  Change the one path in pthread_cancel_init
3116         which causes the problem.  Force gcc to reload.  Simplify callers.
3117         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
3118         (_Unwind_GetBSP): Undo last patch.
3119
3120 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3121
3122         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
3123         function pointer is reloaded after pthread_cancel_init calls.
3124
3125         [BZ #2644]
3126         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
3127         pointers are reloaded after pthread_cancel_init calls.
3128
3129 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
3130
3131         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
3132         __always_inline.
3133
3134 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3135
3136         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3137         Allocate new object which is passed to timer_sigev_thread so that
3138         the timer can be deleted before the new thread is scheduled.
3139
3140 2006-04-26  Roland McGrath  <roland@redhat.com>
3141
3142         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3143
3144 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3145
3146         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3147         suffix for conditional jumps.
3148         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3149         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3150         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3151         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3152         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3153         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3154
3155         * init.c (sigcancel_handler): Compare with correct PID even if the
3156         thread is in the middle of a fork call.
3157         (sighandler_setxid): Likewise.
3158         Reported by Suzuki K P <suzuki@in.ibm.com> .
3159
3160 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3161
3162         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3163
3164 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3165
3166         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3167         fails [Coverity CID 105].
3168
3169 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3170
3171         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3172
3173 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3174
3175         [BZ #2505]
3176         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3177         Define __lll_rel_instr using lwsync.
3178
3179 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3180
3181         * allocatestack.c (allocate_stack): Always initialize robust_head.
3182         * descr.h: Define struct robust_list_head.
3183         (struct pthread): Use robust_list_head in robust mutex list definition.
3184         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3185         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3186         (__pthread_initialize_minimal_internal): Register robust_list with
3187         the kernel.
3188         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3189         Declare __set_robust_list_avail.
3190         * pthread_create.c (start_thread): Register robust_list of new thread.
3191         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3192         waiters.
3193         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3194         number of users, it's unreliable.
3195         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3196         set_robust_list syscall is available.
3197         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3198         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3199         Set robust_head.list_op_pending before trying to lock a robust mutex.
3200         * pthread_mutex_timedlock.c: Likewise.
3201         * pthread_mutex_trylock.c: Likewise.
3202         * pthread_mutex_unlock.c: Likewise for unlocking.
3203         * Makefile (tests): Add tst-robust8.
3204         * tst-robust8.c: New file.
3205
3206 2006-03-08  Andreas Schwab  <schwab@suse.de>
3207
3208         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3209         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3210
3211 2006-03-05  Roland McGrath  <roland@redhat.com>
3212
3213         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3214         and $config_os doesn't match *linux*.
3215
3216 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3217
3218         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3219         Use __syscall_error.
3220         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3221         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3222         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3223         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3224         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3225         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3226
3227 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3228
3229         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3230
3231 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3232
3233         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3234         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3235         mutex.
3236         (__lll_robust_timedlock_wait): Likewise.
3237         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3238         (__lll_robust_lock_wait): Likewise.
3239         (__lll_robust_timedlock_wait): Likewise.
3240         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3241         (__lll_robust_lock_wait): Likewise.
3242         (__lll_robust_timedlock_wait): Likewise.
3243
3244 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3245
3246         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3247         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3248         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3249         lll_robust_mutex_unlock): Define.
3250         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3251
3252 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3253
3254         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3255         instead of <clone.S>.
3256
3257 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3258
3259         * Makefile (libpthread-routines): Add
3260         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3261         and pthread_mutex_[sg]etprioceiling.
3262         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3263         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3264         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3265         pthread_mutex_setprioceiling.
3266         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3267         PTHREAD_PRIO_PROTECT): New enum values.
3268         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3269         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3270         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3271         prototypes.
3272         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3273         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3274         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3275         Define.
3276         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3277         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3278         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3279         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3280         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3281         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3282         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3283         protocol mutexes.
3284         * pthread_mutex_getprioceiling.c: New file.
3285         * pthread_mutex_setprioceiling.c: New file.
3286         * pthread_mutexattr_getprioceiling.c: New file.
3287         * pthread_mutexattr_setprioceiling.c: New file.
3288         * pthread_mutexattr_getprotocol.c: New file.
3289         * pthread_mutexattr_setprotocol.c: New file.
3290
3291 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3292
3293         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3294
3295 2006-02-27  Roland McGrath  <roland@redhat.com>
3296
3297         * sysdeps/pthread/Subdirs: List nptl here too.
3298         * configure (libc_add_on_canonical): New variable.
3299
3300         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3301
3302         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3303         self to get main source tree's file.
3304         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3305         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3306         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3307         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3308         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3309         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3310         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3311         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3312         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3313         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3314         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3315         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3316         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3317
3318         * Makefile: Use $(sysdirs) in vpath directive.
3319
3320         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3321         (CPPFLAGS-timer_routines.c): Likewise.
3322
3323         * Makeconfig (includes): Variable removed.
3324
3325 2006-02-26  Roland McGrath  <roland@redhat.com>
3326
3327         * sysdeps/generic/pt-raise.c: Moved to ...
3328         * pt-raise.c: ... here.
3329         * sysdeps/generic/lowlevellock.h: Moved to ...
3330         * lowlevellock.h: ... here.
3331
3332 2006-02-23  Roland McGrath  <roland@redhat.com>
3333
3334         * descr.h (struct pthread): Add final member `end_padding'.
3335         (PTHREAD_STRUCT_END_PADDING): Use it.
3336
3337 2006-02-20  Roland McGrath  <roland@redhat.com>
3338
3339         * sysdeps/mips: Directory removed, saved in ports repository.
3340         * sysdeps/unix/sysv/linux/mips: Likewise.
3341
3342 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3343
3344         * tst-robust1.c: Add second mutex to check that the mutex list is
3345         handled correctly.
3346
3347 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3348
3349         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3350         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3351         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3352         lll_robust_mutex_unlock): New macros.
3353         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3354         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3355         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3356         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3357         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3358
3359 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3360
3361         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3362         definitions.
3363         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3364
3365 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3366
3367         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3368         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3369         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3370         (lll_robust_mutex_unlock): Likewise.
3371
3372 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3373
3374         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3375         Set robust_list.__next rather than robust_list.
3376         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3377         (__pthread_list_t): New typedef.
3378         (pthread_mutex_t): Replace __next and __prev fields with __list.
3379         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3380         (__pthread_list_t): New typedef.
3381         (pthread_mutex_t): Replace __next and __prev fields with __list.
3382         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3383         (__pthread_list_t, __pthread_slist_t): New typedefs.
3384         (pthread_mutex_t): Replace __next and __prev fields with __list.
3385         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
3386         (__pthread_list_t, __pthread_slist_t): New typedefs.
3387         (pthread_mutex_t): Replace __next and __prev fields with __list.
3388         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3389         (__pthread_list_t, __pthread_slist_t): New typedefs.
3390         (pthread_mutex_t): Replace __next and __prev fields with __list.
3391         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3392         (__pthread_slist_t): New typedef.
3393         (pthread_mutex_t): Replace __next field with __list.
3394
3395 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3396
3397         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3398         PTHREAD_MUTEX_OWNERDEAD.
3399         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3400         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3401         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3402         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3403         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3404         to PTHREAD_MUTEX_INCONSISTENT.
3405         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3406         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3407         * pthread_mutex_trylock.c: Likewise.
3408         * pthread_mutex_timedlock.c: Likewise.
3409         * pthread_mutex_unlock.c: Likewise.
3410         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3411         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3412         lowlevelrobustlock.sym.
3413         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3414         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3415         definitions.
3416         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3417         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3418         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3419         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3420         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3421
3422 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3423
3424         * allocatestack.c (allocate_stack): Initialize robust_list.
3425         * init.c (__pthread_initialize_minimal_internal): Likewise.
3426         * descr.h (struct xid_command): Pretty printing.
3427         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3428         robust_list.  Adjust macros.
3429         * pthread_create.c (start_thread): Adjust robust_list handling.
3430         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3431         but the owner for all robust mutex types.
3432         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3433         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3434         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3435         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3436
3437         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3438         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3439
3440 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3441
3442         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3443         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3444
3445 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3446
3447         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3448         Return status.
3449         (lll_futex_timed_wait): Define.
3450
3451 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3452
3453         * tst-cancel4.c: Test ppoll.
3454
3455 2006-01-18  Andreas Jaeger  <aj@suse.de>
3456
3457         [BZ #2167]
3458         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3459         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3460         by Jim Gifford <patches@jg555.com>.
3461
3462 2006-01-13  Richard Henderson  <rth@redhat.com>
3463
3464         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3465
3466 2006-01-10  Roland McGrath  <roland@redhat.com>
3467
3468         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3469         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3470         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3471         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3472         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3473         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3474         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3475         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3476         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3477         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3478
3479 2006-01-09  Roland McGrath  <roland@redhat.com>
3480
3481         * tst-initializers1-c89.c: New file.
3482         * tst-initializers1-c99.c: New file.
3483         * tst-initializers1-gnu89.c: New file.
3484         * tst-initializers1-gnu99.c: New file.
3485         * Makefile (tests): Add them.
3486         (CFLAGS-tst-initializers1-c89.c): New variable.
3487         (CFLAGS-tst-initializers1-c99.c): New variable.
3488         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3489         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3490
3491         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3492         Use __extension__ on anonymous union definition.
3493         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3494         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3495         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3496         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3497         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3498
3499 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3500
3501         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3502         Don't give the union a name because it changes the mangled name.
3503         Instead name the struct for __data.
3504         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3505         Likewise.
3506         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3507         Likewise.
3508
3509 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3510
3511         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3512         stack bias to mc_ftp field.
3513
3514 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3515
3516         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3517         being too clever and reloading the futex value where it shouldn't.
3518
3519 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3520
3521         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3522         correct type.
3523
3524 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3525
3526         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3527         Add cfi directives.
3528
3529 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3530
3531         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3532         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3533         rename in tcbhead_t.
3534
3535         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3536         Don't give the union a name because it changes the mangled name.
3537         Instead name the struct for __data.
3538         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3539         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3540         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3541         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3542         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3543         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3544
3545 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3546
3547         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3548         Return status.
3549         (lll_futex_timed_wait): Define.
3550         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3551         * sysdeps/pthread/aio_misc.h: New file.
3552
3553 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3554
3555         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3556
3557 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3558
3559         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3560         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3561         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3562
3563 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3564
3565         * tst-cancel24.cc: Use C headers instead of C++ headers.
3566
3567 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3568
3569         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3570         sparc-linux configured glibc.
3571         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3572         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3573         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3574         atomic_compare_and_exchange_val_24_acq instead of
3575         atomic_compare_and_exchange_val_acq.
3576         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3577         instead of atomic_exchange_rel.
3578         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3579         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3580         file.
3581         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3582         file.
3583         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3584         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3585         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3586         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3587         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3588         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3589         New file.
3590         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3591         New file.
3592         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3593         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3594         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3595         file.
3596         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3597         file.
3598         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3599
3600 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3601
3602         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3603         mutex initializers.
3604
3605 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3606
3607         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3608         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3609         THREAD_COPY_POINTER_GUARD): Define.
3610         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3611         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3612
3613 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3614
3615         * version.c: Update copyright year.
3616
3617 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3618
3619         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3620         .eh_frame section, use cfi_* directives.
3621         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3622
3623 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3624
3625         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3626         now.
3627
3628 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3629
3630         * sysdeps/pthread/sigaction.c: Removed.
3631         * sigaction.c: New file.
3632         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3633
3634 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3635
3636         * Makefile (tests): Add tst-signal7.
3637         * tst-signal7.c: New file.
3638
3639 2005-12-27  Roland McGrath  <roland@redhat.com>
3640
3641         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3642         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3643         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3644         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3645         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3646         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3647         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3648         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3649         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3650         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3651         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3652
3653 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3654
3655         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3656         and __prev field to pthread_mutex_t.
3657         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3658         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3659         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3660         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3661         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3662         to pthread_mutex_t.
3663
3664 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3665
3666         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3667         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3668         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3669         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3670         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3671         and PTHREAD_MUTEXATTR_FLAG_BITS.
3672         * descr.h (struct pthread): Add robust_list field and define
3673         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3674         * pthread_mutexattr_getrobust.c: New file.
3675         * pthread_mutexattr_setrobust.c: New file.
3676         * pthread_mutex_consistent.c: New file.
3677         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3678         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3679         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3680         Adjust pthread_mutex_t initializers.
3681         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3682         field to pthread_mutex_t.
3683         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3684         and __prev field to pthread_mutex_t.
3685         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3686         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3687         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3688         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3689         * pthread_mutexattr_gettype.c: Likewise.
3690         * pthread_mutexattr_setpshared.c: Likewise.
3691         * pthread_mutexattr_settype.c: Likewise.
3692         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3693         Initialize mutex kind according to robust flag.
3694         * pthread_mutex_lock.c: Implement local robust mutex.
3695         * pthread_mutex_timedlock.c: Likewise.
3696         * pthread_mutex_trylock.c: Likewise.
3697         * pthread_mutex_unlock.c: Likewise.
3698         * pthread_create.c (start_thread): Mark robust mutexes which remained
3699         locked as dead.
3700         * tst-robust1.c: New file.
3701         * tst-robust2.c: New file.
3702         * tst-robust3.c: New file.
3703         * tst-robust4.c: New file.
3704         * tst-robust5.c: New file.
3705         * tst-robust6.c: New file.
3706         * tst-robust7.c: New file.
3707         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3708         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3709         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3710         tst-robust5, tst-robust6, and tst-robust7.
3711
3712         * tst-typesizes.c: New file.
3713         * Makefile (tests): Add tst-typesizes.
3714
3715         * tst-once3.c: More debug output.
3716
3717 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3718
3719         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3720         missing after last change.
3721
3722         * version.c: Update copyright year.
3723
3724 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3725
3726         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3727         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3728         * pthread_mutex_trylock.c: Likewise.
3729         * pthread_mutex_timedlock.c: Likewise.
3730         * pthread_mutex_unlock.c: Likewise.
3731
3732 2005-12-22  Roland McGrath  <roland@redhat.com>
3733
3734         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3735         so that #include_next's search location is not reset to the -I..
3736         directory where <nptl/...> can be found.
3737
3738 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3739
3740         [BZ #1913]
3741         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3742         Fix unwind info.  Remove useless branch prediction prefix.
3743         * tst-cancel24.cc: New file.
3744         * Makefile: Add rules to build and run tst-cancel24.
3745
3746 2005-12-21  Roland McGrath  <roland@redhat.com>
3747
3748         * libc-cancellation.c: Use <> rather than "" #includes.
3749         * pt-cleanup.c: Likewise.
3750         * pthread_create.c: Likewise.
3751         * pthread_join.c: Likewise.
3752         * pthread_timedjoin.c: Likewise.
3753         * pthread_tryjoin.c: Likewise.
3754         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3755         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3756         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3757         * unwind.c: Likewise.
3758
3759 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3760
3761         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3762         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3763         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3764         THREAD_COPY_POINTER_GUARD): Define.
3765
3766 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3767
3768         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3769         rather than one.
3770         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3771         THREAD_COPY_POINTER_GUARD): Define.
3772         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3773         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3774         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3775         THREAD_COPY_POINTER_GUARD): Define.
3776         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3777         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3778         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3779         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3780         Use PTR_DEMANGLE for B0 if defined.
3781
3782 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3783
3784         * pthread_create.c (__pthread_create_2_1): Use
3785         THREAD_COPY_POINTER_GUARD if available.
3786         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3787         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3788         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3789         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3790         * sysdeps/x86_64/tls.h: Likewise.
3791
3792 2005-12-15  Roland McGrath  <roland@redhat.com>
3793
3794         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3795
3796 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3797
3798         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3799         sysdeps/generic.
3800         * errno-loc.c: New file.
3801
3802 2005-12-12  Roland McGrath  <roland@redhat.com>
3803
3804         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3805         adjustments before choosing stack size.  Update minimum stack size
3806         calculation to match allocate_stack change.
3807
3808 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3809
3810         * allocatestack.c (allocate_stack): Don't demand that there is an
3811         additional full page available on the stack beside guard, TLS, the
3812         minimum stack.
3813
3814 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3815
3816         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3817         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3818
3819         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3820         compiling 32-bit code we must define __cleanup_fct_attribute.
3821
3822 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3823
3824         [BZ #1920]
3825         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3826         __attribute__ instead of __attribute.
3827         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3828         (__cleanup_fct_attribute): Likewise.
3829
3830 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3831
3832         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3833         a write barrier before writing libgcc_s_getcfa.
3834
3835 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3836
3837         * sysdeps/unix/sysv/linux/configure: Removed.
3838
3839 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3840
3841         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3842         optional init_array/fini_array support.
3843
3844 2005-10-24  Roland McGrath  <roland@redhat.com>
3845
3846         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3847         versioned_symbol use.
3848
3849 2005-10-16  Roland McGrath  <roland@redhat.com>
3850
3851         * init.c (__pthread_initialize_minimal_internal): Even when using a
3852         compile-time default stack size, apply the minimum that allocate_stack
3853         will require, and round up to page size.
3854
3855 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3856
3857         * Makefile ($(test-modules)): Remove static pattern rule.
3858
3859 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3860             Ulrich Drepper  <drepper@redhat.com>
3861
3862         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3863         alignment in callback function.
3864         * Makefile: Add rules to build and run tst-align3.
3865         * tst-align3.c: New file.
3866
3867 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3868
3869         * allocatestack.c (setxid_signal_thread): Add
3870         INTERNAL_SYSCALL_DECL (err).
3871
3872 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3873
3874         * allocatestack.c (setxid_signal_thread): Need to use
3875         atomic_compare_and_exchange_bool_acq.
3876
3877 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3878             Jakub Jelinek  <jakub@redhat.com>
3879
3880         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3881         CANCEL_RESTMASK.
3882         (struct pthread): Move specific_used field to avoid padding.
3883         Add setxid_futex field.
3884         * init.c (sighandler_setxid): Reset setxid flag and release the
3885         setxid futex.
3886         * allocatestack.c (setxid_signal_thread): New function.  Broken
3887         out of the bodies of the two loops in __nptl_setxid.  For undetached
3888         threads check whether they are exiting and if yes, don't send a signal.
3889         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3890         * pthread_create.c (start_thread): For undetached threads, check
3891         whether setxid bit is set.  If yes, wait until signal has been
3892         processed.
3893
3894         * allocatestack.c (STACK_VARIABLES): Initialize them.
3895         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3896
3897 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3898
3899         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3900         waiters, awake all waiters on the associated mutex.
3901
3902 2005-09-22  Roland McGrath  <roland@redhat.com>
3903
3904         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3905         ../sysdeps/x86_64/hp-timing.h).
3906
3907 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3908
3909         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3910         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3911         (lll_futex_wake_unlock): Define.
3912         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3913         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3914         (lll_futex_wake_unlock): Define.
3915         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3916         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3917         (lll_futex_wake_unlock): Define.
3918         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3919         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3920         (lll_futex_wake_unlock): Define.
3921         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3922         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3923         (lll_futex_wake_unlock): Define.
3924         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3925         lll_futex_wake_unlock.
3926         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3927         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3928         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3929         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3930         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3931         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3932
3933 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3934
3935         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3936         Fix typo in register name.
3937
3938 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3939
3940         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3941         Use __sigfillset.  Document that sigfillset does the right thing wrt
3942         to SIGSETXID.
3943
3944 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3945
3946         [BZ #1102]
3947         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3948         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3949         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3950         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3951         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3952         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3953         in the structure.
3954         * Makefile (tests): Add tst-initializers1.
3955         (CFLAGS-tst-initializers1.c): Set.
3956         * tst-initializers1.c: New test.
3957
3958 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3959
3960         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3961         Make sure __flags are located at offset 48 from the start of the
3962         structure.
3963
3964 2005-07-02  Roland McGrath  <roland@redhat.com>
3965
3966         * Makeconfig: Comment fix.
3967
3968 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3969
3970         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3971         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3972         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3973         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3974         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3975         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3976         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3977         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3978         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3979         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3980
3981 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3982
3983         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3984         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3985         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3986         fields.
3987         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3988         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3989         field.  Put in sysinfo field unconditionally.
3990         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3991         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3992         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3993         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3994         fields.
3995         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3996         * pthread_create.c (__pthread_create_2_1): Use
3997         THREAD_COPY_STACK_GUARD macro.
3998         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3999         tests.
4000         * tst-stackguard1.c: New file.
4001         * tst-stackguard1-static.c: New file.
4002
4003 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
4004
4005         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
4006         Invoke CGOTSETUP and CGOTRESTORE.
4007         (CGOTSETUP, CGOTRESTORE): Define.
4008
4009 2005-05-29  Richard Henderson  <rth@redhat.com>
4010
4011         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
4012         (tf_write, tf_writev): Use it.
4013         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
4014         the system minimum.
4015
4016 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
4017
4018         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
4019         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
4020         __librt_*_asynccancel@local.
4021
4022 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
4023
4024         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
4025         all occurrences of JUMPTARGET.  Instead append @local to labels.
4026
4027 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
4028
4029         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
4030         size/alignment of struct pthread rather than tcbhead_t.
4031         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4032         Likewise.
4033         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4034         Likewise.
4035         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4036         Likewise.
4037
4038 2005-05-19  Richard Henderson  <rth@redhat.com>
4039
4040         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
4041         __sync_val_compare_and_swap, not explicit _si variant.
4042         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
4043
4044 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
4045
4046         [BZ #915]
4047         * sysdeps/pthread/pthread.h: Avoid empty initializers.
4048
4049 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
4050
4051         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
4052         .eh_frame section, use cfi_* directives.
4053
4054 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
4055
4056         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
4057         of "" includes.
4058
4059 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
4060
4061         [BZ #1075]
4062         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
4063         aio_write blocks.
4064
4065 2005-04-27  Roland McGrath  <roland@redhat.com>
4066
4067         * Makefile (tests): Remove tst-clock2.
4068
4069         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4070         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
4071         translating to the kernel clockid_t for our own process/thread clock.
4072
4073         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
4074
4075 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
4076
4077         * old_pthread_cond_init.c: Include <errno.h>.
4078         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
4079         process shared or uses clock other than CLOCK_REALTIME.
4080         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
4081
4082 2005-04-13  David S. Miller  <davem@davemloft.net>
4083
4084         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
4085         * sysdeps/sparc/sparc64/clone.S: New file.
4086
4087 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4088
4089         [BZ #1102]
4090         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
4091         __inline instead of inline.
4092         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
4093
4094 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
4095
4096         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
4097         functionally equivalent, but shorter instructions.
4098         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4099         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4100         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4101         Likewise.
4102         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
4103         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4104         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4105         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4107         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4108         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4109         Likewise.
4110         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4111         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4112         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4113         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4114         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4115
4116 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
4117
4118         * sysdeps/mips/Makefile: New file.
4119         * sysdeps/mips/nptl-sysdep.S: New file.
4120         * sysdeps/mips/tcb-offsets.sym: New file.
4121         * sysdeps/mips/pthread_spin_lock.S: New file.
4122         * sysdeps/mips/pthread_spin_trylock.S: New file.
4123         * sysdeps/mips/pthreaddef.h: New file.
4124         * sysdeps/mips/tls.h: New file.
4125         * sysdeps/mips/jmpbuf-unwind.h: New file.
4126         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
4127         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
4128         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
4129         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
4130         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
4131         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
4132         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
4133         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4134         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4135         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4136
4137 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4138
4139         [BZ #1112]
4140         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4141         variable to scerr.
4142
4143 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4144
4145         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4146
4147 2005-02-25  Roland McGrath  <roland@redhat.com>
4148
4149         * alloca_cutoff.c: Correct license text.
4150         * tst-unload.c: Likewise.
4151         * sysdeps/pthread/allocalim.h: Likewise.
4152         * sysdeps/pthread/pt-initfini.c: Likewise.
4153         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4154         * sysdeps/pthread/bits/sigthread.h: Likewise.
4155         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4156         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4157
4158 2005-02-16  Roland McGrath  <roland@redhat.com>
4159
4160         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4161         Use unsigned int * for ptr_nthreads.
4162
4163 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4164
4165         [BZ #721]
4166         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4167         gcc4.
4168
4169 2005-02-07  Richard Henderson  <rth@redhat.com>
4170
4171         [BZ #787]
4172         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4173         argument.
4174
4175 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4176
4177         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4178         order of arguments in invocation of atomic_add_zero.
4179
4180 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4181
4182         [BZ #737]
4183         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4184         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4185         at least gotntpoff relocation and addition.
4186         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4187         Likewise.
4188         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4189         Likewise.
4190         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4191         Likewise.
4192
4193 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4194
4195         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4196         entry for static tls deallocation fix.
4197         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4198         also contains information whether the memory pointed to is static
4199         TLS or not.
4200         * sysdeps/i386/tls.h: Likewise.
4201         * sysdeps/ia64/tls.h: Likewise.
4202         * sysdeps/powerpc/tls.h: Likewise.
4203         * sysdeps/s390/tls.h: Likewise.
4204         * sysdeps/sh/tls.h: Likewise.
4205         * sysdeps/sparc/tls.h: Likewise.
4206         * sysdeps/x86_64/tls.h: Likewise.
4207
4208 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4209
4210         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4211
4212 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4213
4214         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4215         %esp.
4216         * Makefile (tests): Add tst-align2.
4217         * tst-align2.c: New test.
4218         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4219         -mpreferred-stack-boundary=4.
4220
4221 2004-12-18  Roland McGrath  <roland@redhat.com>
4222
4223         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4224         New file removed withdrawn for the moment.
4225
4226 2004-12-17  Richard Henderson  <rth@redhat.com>
4227
4228         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4229         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4230
4231 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4232
4233         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4234         Increased PTHREAD_STACK_MIN.
4235
4236         * tst-context1.c (stacks): Use bigger stack size.
4237
4238 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4239
4240         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4241         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4242
4243 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4244
4245         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4246         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4247         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4248
4249 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4250
4251         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4252
4253 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4254
4255         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4256         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4257
4258         * tst-getpid1.c: If child crashes, report this first.  Print which
4259         signal.
4260
4261 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4262
4263         * init.c (__pthread_initialize_minimal_internal): Also unblock
4264         SIGSETXID.
4265
4266 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4267
4268         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4269         _POSIX_THREAD_CPUTIME): Define to 0.
4270         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4271         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4272         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4273         __timer_signal_thread_tclk): Remove.
4274         (init_module): Remove their initialization.
4275         (thread_cleanup): Remove their cleanup assertions.
4276         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4277         __timer_signal_thread_tclk): Remove.
4278         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4279         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4280         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4281
4282 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4283
4284         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4285         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4286
4287         * Makefile (tests): Add tst-getpid2.
4288         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4289         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4290         * tst-getpid2.c: New test.
4291
4292 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4293
4294         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4295
4296 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4297
4298         * Makefile (tests): Add tst-getpid1.
4299         * tst-getpid1.c: New file.
4300         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4301         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4302
4303 2004-12-02  Roland McGrath  <roland@redhat.com>
4304
4305         * Makefile (libpthread-nonshared): Variable removed.
4306         ($(objpfx)libpthread_nonshared.a): Target removed.
4307         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4308         These are now handled by generic magic from
4309         libpthread-static-only-routines being set.
4310
4311 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4312
4313         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4314         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4315         _POSIX_THREAD_PRIO_PROTECT): Define.
4316         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4317         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4318         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4319
4320 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4321
4322         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4323         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4324         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4325         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4326         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4327         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4328         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4329
4330 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4331
4332         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4333
4334         * Makefile (libpthread-routines): Add pthread_setschedprio.
4335         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4336         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4337         * pthread_setschedprio.c: New file.
4338
4339 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4340
4341         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4342         * pthread_cancel.c (pthread_create): Likewise.
4343
4344         * Makefile (libpthread-routines): Add vars.
4345         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4346         * init.c (__default_stacksize, __is_smp): Remove.
4347         * vars.c: New file.
4348         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4349         and define a wrapper macro.
4350         (PTHREAD_STATIC_FN_REQUIRE): Define.
4351         * allocatestack.c (__find_thread_by_id): Undefine.
4352         * pthread_create (__pthread_keys): Remove.
4353         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4354         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4355         PTHREAD_STATIC_FN_REQUIRE.
4356
4357 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4358
4359         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4360         parameter to REGISTER macro.
4361
4362 2004-11-17  Roland McGrath  <roland@redhat.com>
4363
4364         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4365         Make sure SIGCANCEL is blocked as well.
4366
4367 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4368
4369         * sysdeps/pthread/setxid.h: New file.
4370         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4371         (struct xid_command): Add forward decl.
4372         (struct pthread_functions): Change return type of __nptl_setxid hook
4373         to int.
4374         * pthreadP.h (__nptl_setxid): Change return type to int.
4375         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4376         calling thread, return its return value and set errno on failure.
4377         * descr.h (struct xid_command): Change id type to long array.
4378
4379         * Makefile: Add rules to build and test tst-setuid1 and
4380         tst-setuid1-static.
4381         * tst-setuid1.c: New test.
4382         * tst-setuid1-static.c: New test.
4383
4384 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4385
4386         * Makefile (tests): Add tst-exit3.
4387         * tst-exit3.c: New test.
4388
4389 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4390
4391         * Makefile (tests): Add tst-exit2.
4392         * tst-exit2.c: New file.
4393
4394 2004-11-09  Roland McGrath  <roland@redhat.com>
4395
4396         [BZ #530]
4397         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4398         here, before calling clone.
4399         * pthread_create.c (start_thread): Don't do it here.
4400
4401 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4402
4403         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4404
4405 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4406
4407         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4408         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4409         assembler warning.
4410
4411 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4412
4413         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4414         if sched_priority is not between minprio and maxprio.
4415
4416 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4417
4418         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4419         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4420
4421         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4422         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4423
4424 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4425
4426         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4427         not-cancelable I/O functions.
4428
4429 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4430
4431         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4432         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4433         make sure 2 is stored in the futex and we looked at the old value.
4434         Fix a few other problems to return the correct value.
4435
4436 2004-10-14  Richard Henderson  <rth@redhat.com>
4437
4438         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4439         make gcc4 happy.
4440
4441 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4442
4443         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4444         of pthread-functions.h and pthreaddef.h.
4445         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4446
4447         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4448         Change __data.__nwaiters from int to unsigned int.
4449
4450         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4451         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4452
4453         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4454         before return type.
4455
4456         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4457         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4458
4459 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4460
4461         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4462         test fails, remove message queue.
4463         (tf_msgsnd): Likewise.
4464
4465 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4466
4467         * tst-clock1.c: Change #ifdef to #if defined.
4468         * tst-clock2.c: Likewise.
4469         * tst-cond11.c: Likewise.
4470
4471         * sysdeps/pthread/timer_create.c (timer_create): Use
4472         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4473         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4474         THREAD_CPUTIME.
4475
4476 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4477
4478         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4479         _POSIX_THREAD_CPUTIME): Define to 0.
4480
4481 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4482
4483         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4484         and _POSIX_THREAD_CPUTIME to zero.
4485         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4486         * tst-barrier2.c: Fix testing for POSIX feature.
4487         * tst-clock1.c: Likewise.
4488         * tst-clock2.c: Likewise.
4489         * tst-cond11.c: Likewise.
4490         * tst-cond4.c: Likewise.
4491         * tst-cond6.c: Likewise.
4492         * tst-flock2.c: Likewise.
4493         * tst-mutex4.c: Likewise.
4494         * tst-mutex9.c: Likewise.
4495         * tst-rwlock12.c: Likewise.
4496         * tst-rwlock4.c: Likewise.
4497         * tst-signal1.c: Likewise.
4498         * tst-spin2.c: Likewise.
4499         * sysdeps/pthread/posix-timer.h: Likewise.
4500         * sysdeps/pthread/timer_create.c: Likewise.
4501         * sysdeps/pthread/timer_routines.c: Likewise.
4502
4503 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4504
4505         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4506         (__lll_mutex_timedlock_wait): Address futex correctly.
4507
4508         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4509         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4510         make sure 2 is stored in the futex and we looked at the old value.
4511         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4512         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4513         which might very well made the code not working at all before.
4514         [BZ #417]
4515
4516 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4517
4518         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4519         allow SIGSETXID to be sent.
4520         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4521         for SIGSETXID to be defined.
4522         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4523         SIGSETXID cannot be blocked.
4524
4525         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4526         Add __extension__ to long long types.
4527         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4528         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4529         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4530         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4531         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4532         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4533         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4534
4535 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4536
4537         * descr.h (struct pthread): Add stopped_start field.
4538         * sysdeps/pthread/createthread.c (create_thread): Set
4539         start_stopped flag in descriptor for new thread appropriately.
4540         * pthread_create.c (start_thread): Only take lock to be stopped on
4541         startup if stopped_start flag says so.
4542
4543 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4544
4545         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4546         is created detached and if yes, do not try to free the stack in case
4547         the thread creation failed.
4548         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4549         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4550         case there has been no error.  [BZ #405]
4551
4552         * pthread_create.c (start_thread): Don't wait for scheduler data
4553         etc to be set at the beginning of the function.  The cancellation
4554         infrastructure must have been set up.  And enable async
4555         cancellation before potentially going to sleep.  [BZ #401]
4556
4557 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4558
4559         * Versions: Remove exports for pthread_set*id_np functions.
4560         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4561         for now.
4562         * Makefile: Don't build pthread_set*id code for now.
4563
4564 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4565
4566         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4567         internal use.
4568         * allocatestack.c (__nptl_setxid): New function.
4569         * descr.h (struct xid_command): Define type.
4570         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4571         (sighandler_setxid): New function.
4572         (__pthread_initialize_minimal): Register sighandler_setxid for
4573         SIGCANCEL.
4574         * pt-allocrtsig.c: Update comment.
4575         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4576         Declare __nptl_setxid.
4577         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4578         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4579         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4580         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4581         and pthread_setresuid_np.
4582         * pthread_setgid_np.c: New file.
4583         * pthread_setuid_np.c: New file.
4584         * pthread_setegid_np.c: New file.
4585         * pthread_seteuid_np.c: New file.
4586         * pthread_setregid_np.c: New file.
4587         * pthread_setreuid_np.c: New file.
4588         * pthread_setresgid_np.c: New file.
4589         * pthread_setresuid_np.c: New file.
4590         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4591         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4592         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4593         and pthread_setresuid_np.
4594         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4595         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4596         pthread_setregid, and pthread_setresgid.
4597
4598 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4599
4600         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4601         ENOMEM when out of memory.
4602
4603 2004-09-10  Roland McGrath  <roland@redhat.com>
4604
4605         [BZ #379]
4606         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4607         code, since we don't try to use the broken CLONE_STOPPED any more.
4608         * pthread_create.c (start_thread): Likewise.
4609
4610 2004-09-15  Richard Henderson  <rth@redhat.com>
4611
4612         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4613
4614 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4615
4616         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4617         (__libc_unwind_longjmp): Delete macro and declare as function.
4618         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4619         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4620         nptl directory.
4621         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4622         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4623         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4624
4625 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4626
4627         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4628         for __USE_XOPEN2K.
4629         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4630         types also for __USE_XOPEN2K.
4631         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4632         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4633         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4634         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4635         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4636         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4637         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4638         [BZ #320]
4639
4640 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4641
4642         * sysdeps/pthread/pthread.h
4643         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4644         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4645         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4646         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4647         [BZ #375]
4648
4649 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4650
4651         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4652         PSEUDO to be used with . prefix.
4653
4654         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4655         Use atomic_increment instead of atomic_exchange_and_add.
4656         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4657         Likewise.
4658         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4659         Likewise.
4660         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4661         Likewise.
4662
4663         * allocatestack.c (allocate_stack): Use atomic_increment_val
4664         instead of atomic_exchange_and_add.
4665         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4666         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4667         Likewise.
4668         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4669         Likewise.
4670
4671         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4672         the initialization function might throw.
4673
4674 2005-09-05  Richard Henderson  <rth@redhat.com>
4675
4676         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4677         Move definition inside libpthread, libc, librt check.  Provide
4678         definition for rtld.
4679
4680 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4681
4682         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4683         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4684         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4685         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4686         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4687         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4688         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4689         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4690         * unwind.c: Use it.
4691
4692         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4693         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4694         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4695         Likewise.
4696         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4697         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4698         this is the last waiter, signal pthread_cond_destroy caller and
4699         avoid using the pthread_cond_t structure after unlock.
4700         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4701         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4702         Read clock type from the least significant bits of __nwaiters instead
4703         of __clock.
4704         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4705         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4706
4707 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4708
4709         [BZ #342]
4710         * Makefile (tests): Add tst-cond20 and tst-cond21.
4711         * tst-cond20.c: New test.
4712         * tst-cond21.c: New test.
4713         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4714         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4715         it unsigned int.
4716         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4717         Likewise.
4718         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4719         (pthread_cond_t): Likewise.
4720         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4721         Likewise.
4722         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4723         Likewise.
4724         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4725         Likewise.
4726         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4727         (cond_nwaiters): New.
4728         (clock_bits): New.
4729         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4730         if there are waiters not signalled yet.
4731         Wait until all already signalled waiters wake up.
4732         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4733         __nwaiters.  If pthread_cond_destroy has been called and this is the
4734         last waiter, signal pthread_cond_destroy caller and avoid using
4735         the pthread_cond_t structure after unlock.
4736         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4737         decrement it when leaving.  If pthread_cond_destroy has been called
4738         and this is the last waiter, signal pthread_cond_destroy caller.
4739         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4740         Likewise.  Read clock type from the least significant bits of
4741         __nwaiters instead of __clock.
4742         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4743         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4744         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4745         clock type just from the last COND_CLOCK_BITS bits of value.
4746         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4747         instead of __clock, just from second bit of condattr's value.
4748
4749 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4750
4751         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4752         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4753         != 64.
4754         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4755
4756 2004-08-15  Roland McGrath  <roland@frob.com>
4757
4758         * pthread_atfork.c: Update copyright terms including special exception
4759         for these trivial files, which are statically linked into executables
4760         that use dynamic linking for the significant library code.
4761
4762 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4763
4764         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4765         pthread_rwlock_rdlock.
4766         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4767         Decrease __nr_readers_queued after reacquiring lock.
4768         * sysdeps/pthread/pthread_rwlock_timedrdlock
4769         (pthread_rwlock_timedrdlock): Likewise.
4770         Reported by Bob Cook <bobcook47@hotmail.com>.
4771
4772 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4773
4774         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4775         before pthread_barrier_wait.
4776
4777 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4778
4779         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4780         Remove unnecessary exception handling data.
4781
4782 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4783
4784         [BZ #284]
4785         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4786         instead of clockid_t.
4787
4788 2004-07-21  Roland McGrath  <roland@redhat.com>
4789
4790         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4791
4792 2004-07-19  Roland McGrath  <roland@redhat.com>
4793
4794         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4795
4796 2004-07-02  Roland McGrath  <roland@redhat.com>
4797
4798         * configure: Don't exit.
4799
4800 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4801
4802         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4803         (__pthread_cond_timedwait): Check for invalid nanosecond in
4804         timeout value.
4805
4806 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4807
4808         * Makefile: Add rules to build and run tst-fini1.
4809         * tst-fini1.c: New file.
4810         * tst-fini1mod.c: New file.
4811
4812 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4813
4814         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4815         if no cancellation support is needed.
4816         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4817         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4818         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4819         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4820         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4821         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4822         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4823         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4824         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4825
4826         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4827         only if not already defined.
4828
4829 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4830
4831         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4832         constraint "m" instead of "0" for futex.
4833
4834         * shlib-versions: Add powerpc64-.*-linux.*.
4835
4836 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4837
4838         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4839         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4840         for valid tv_nsec.
4841         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4842         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4843         bits.
4844
4845 2004-06-29  Roland McGrath  <roland@redhat.com>
4846
4847         * Banner: NPTL no longer has its own version number.
4848         * Makefile (nptl-version): Variable removed.
4849         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4850         using $(version), the glibc version number.
4851
4852 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4853
4854         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4855         Fix branch offset for a PLT entry.
4856         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4857         Likewise.
4858         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4859         Likewise.
4860         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4861         Likewise.
4862         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4863         Likewise.
4864
4865 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4866
4867         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4868         unconditionally.
4869
4870 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4871
4872         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4873         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4874         instead of tv_sec.
4875         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4876         (pthread_rwlock_timedrdlock): Likewise.
4877
4878 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4879
4880         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4881         Set __r7 to val, not mutex.
4882
4883 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4884
4885         * Makefile: Add rules to build tst-rwlock14.
4886         * tst-rwlock14.c: New file.
4887
4888 2004-06-24  Boris Hu  <boris.hu@intel.com>
4889
4890         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4891         check.
4892         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4893
4894 2004-06-19  Andreas Jaeger  <aj@suse.de>
4895
4896         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4897         assembler in last patch.
4898
4899 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4900
4901         * sysdeps/pthread/pthread_cond_timedwait.c
4902         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4903         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4904         (__pthread_cond_timedwait): Check for invalid nanosecond in
4905         timeout value.
4906         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4907         * tst-cond19.c: New file.
4908         * Makefile: Add rules to build and run tst-cond19.
4909
4910 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4911
4912         * tst-context1.c (GUARD_PATTERN): Defined.
4913         (tst_context_t): Define struct containing ucontext_t & guard words.
4914         (ctx): Declare as an array of tst_context_t.
4915         (fct): Verify uc_link & guard words are still valid.
4916         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4917
4918 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4919
4920         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4921         Add __data.__futex field, reshuffle __data.__clock.
4922         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4923         (__pthread_cond_signal): Increment __futex at the same time as
4924         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4925         address of low 32-bits of __wakeup_seq to futex syscall.
4926         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4927         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4928         releasing internal lock to FUTEX_WAIT.
4929         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4930         (__pthread_cond_timedwait): Likewise.
4931         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4932         (FUTEX_CMP_REQUEUE): Define.
4933         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4934         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4935         Pass __futex value from before the unlock and __futex address instead
4936         of address of low 32-bits of __wakeup_seq to futex syscall.
4937         Fallback to FUTEX_WAKE all on any errors.
4938
4939 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4940
4941         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4942         comment typo.
4943         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4944         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4945         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4946         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4947         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4948
4949 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4950
4951         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4952         Add memory clobber to inline assembly.
4953         (__lll_mutex_trylock): Likewise.
4954         (__lll_mutex_cond_trylock): Likewise.
4955
4956 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4957
4958         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4959         Pass val argument as 6th system call argument in %r7.
4960
4961 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4962
4963         * Makefile (tests): Add tst-cond16.
4964         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4965         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4966         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4967         Add __data.__futex field, reshuffle __data.__clock.
4968         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4969         (__pthread_cond_signal): Increment __futex at the same time as
4970         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4971         address of low 32-bits of __wakeup_seq to futex syscall.
4972         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4973         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4974         releasing internal lock to FUTEX_WAIT.
4975         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4976         (__pthread_cond_timedwait): Likewise.
4977         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4978         (FUTEX_CMP_REQUEUE): Define.
4979         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4980         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4981         Pass __futex value from before the unlock and __futex address instead
4982         of address of low 32-bits of __wakeup_seq to futex syscall.
4983         Fallback to FUTEX_WAKE all on any errors.
4984         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4985         Define.
4986         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4987         internally.  Return non-zero if error, zero if success.
4988         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4989         Add __data.__futex field, reshuffle __data.__clock.
4990         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4991         Define.
4992         (lll_futex_requeue): Add val argument, return 1 unconditionally
4993         for the time being.
4994         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4995         Add __data.__futex field, reshuffle __data.__clock.
4996         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4997         Define.
4998         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4999         internally.  Return non-zero if error, zero if success.
5000         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5001         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
5002         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
5003         Define.
5004         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5005         internally.  Return non-zero if error, zero if success.
5006         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
5007         Add __data.__futex field, reshuffle __data.__clock.
5008         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
5009         Define.
5010         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5011         internally.  Return non-zero if error, zero if success.
5012         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
5013         Add __data.__futex field, reshuffle __data.__clock.
5014         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
5015         Add __data.__futex field, reshuffle __data.__clock.
5016         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
5017         Increment __futex at the same time as __wakeup_seq or __total_seq.
5018         Pass address of __futex instead of address of low 32-bits of
5019         __wakeup_seq to futex syscall.
5020         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5021         Pass __futex value from before releasing internal lock
5022         to FUTEX_WAIT.
5023         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5024         Likewise.  Avoid unnecessary shadowing of variables.
5025         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
5026         Set __futex to 2 * __total_seq.  Pass __futex value from before the
5027         unlock and __futex address instead of address of low 32-bits of
5028         __wakeup_seq to futex_requeue macro, adjust for new return value
5029         meaning.
5030         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
5031         (__pthread_cond_signal): Increment __futex at the same time as
5032         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5033         address of low 32-bits of __wakeup_seq to futex syscall.
5034         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5035         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5036         releasing internal lock to FUTEX_WAIT.
5037         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5038         (__pthread_cond_timedwait): Likewise.
5039         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5040         (FUTEX_CMP_REQUEUE): Define.
5041         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5042         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5043         Pass __futex value from before the unlock and __futex address instead
5044         of address of low 32-bits of __wakeup_seq to futex syscall.
5045         Fallback to FUTEX_WAKE all on any errors.
5046
5047 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5048
5049         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
5050         Add nop to align the end of critical section.
5051         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
5052
5053 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5054
5055         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5056         Add __broadcast_seq field.
5057         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
5058         all waiters as woken with woken_seq and bump broadcast counter.
5059         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
5060         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
5061         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5062         Comment typo fixes.  Avoid returning -ETIMEDOUT.
5063
5064 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
5065
5066         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5067         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
5068         Reported by Kaz Kojima.
5069
5070 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
5071
5072         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
5073
5074 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5075
5076         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
5077         __broadcast_seq with bc_seq after acquiring internal lock instead of
5078         before it.
5079
5080 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
5081
5082         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
5083         compilation.
5084         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5085         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
5086         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5087         (pthread_cond_t): Add __data.__broadcast_seq field.
5088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5089         (FRAME_SIZE): Define.
5090         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
5091         Comment typo fixes.
5092         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
5093         Define.
5094         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
5095         typo fixes.
5096         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5097         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
5098         fixes.
5099
5100 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
5101
5102         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
5103         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5104         Add __broadcast_seq field.
5105         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5106         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5107         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5108         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5109         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5110         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
5111         all waiters as woken with woken_seq and bump broadcast counter.
5112         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
5113         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
5114         __broadcast_seq field.
5115         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5116         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5117         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5118         * pthread_cond_init.c: Initialize __broadcast_seq field.
5119         * Makefile (tests): Add tst-cond17 and tst-cond18.
5120         Add .NOTPARALLEL goal.
5121         * tst-cond16.c: New file.  From Jakub.
5122         * tst-cond17.c: New file.  From Jakub.
5123         * tst-cond18.c: New file.  From Jakub.
5124
5125 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
5126
5127         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
5128         unwind info.
5129
5130         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5131         Parametrize frame size.  Correct some unwind info.
5132         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5133
5134 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5135
5136         * tst-stack3.c: Note testing functionality beyond POSIX.
5137
5138 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5139
5140         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5141         Change conditional from ifdef to if.
5142
5143 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5144
5145         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5146         SYSDEP_CANCEL_ERROR): Define.
5147         (PSEUDO): Use it.
5148
5149 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5150
5151         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5152
5153 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5154
5155         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5156
5157 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5158
5159         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5160         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5161         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5162         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5163
5164 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5165
5166         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5167         thread has all signals blocked.
5168
5169 2004-04-18  Andreas Jaeger  <aj@suse.de>
5170
5171         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5172         (SEM_VALUE_MAX): Add missing brace.
5173
5174 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5175
5176         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5177         in rt subdir.
5178         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5179         * sysdeps/pthread/tst-mqueue8x.c: New test.
5180         * tst-cancel4.c: Update comment about message queues.
5181
5182         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5183         return it_value { 0, 0 }.
5184         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5185         like SIGEV_SIGNAL.
5186         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5187         assertion for SIGEV_NONE.
5188         (thread_attr_compare): Compare all attributes, not just a partial
5189         subset.
5190
5191 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5192
5193         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5194
5195 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5196
5197         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5198         Just use a plain number.
5199         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5200         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5201         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5202         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5203         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5204         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5205         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5206
5207 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5208
5209         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5210         frame info.
5211         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5212
5213 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5214
5215         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5216         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5217         of calling sigwaitinfo.
5218
5219 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5220
5221         * allocatestack.c (allocate_stack): Set reported_guardsize
5222         unconditionally.
5223         * pthread_getattr_np.c (pthread_getattr_np): Use
5224         reported_guardsize instead of guardsize.
5225         * descr.h (struct pthread): Add reported_guardsize field.
5226
5227 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5228
5229         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5230
5231 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5232
5233         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5234
5235 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5236
5237         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5238         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5239         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5240         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5241         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5242         Define.
5243         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5244         (_POSIX_MESSAGE_PASSING): Define.
5245         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5246         (_POSIX_MESSAGE_PASSING): Define.
5247         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5248         (_POSIX_MESSAGE_PASSING): Define.
5249
5250 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5251
5252         * tst-context1.c (fct): Check whether correct stack is used.
5253
5254 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5255
5256         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5257         matching constraints for asm mem parameters.
5258
5259         * tst-clock2.c (tf): Don't define unless needed.
5260
5261 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5262
5263         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5264         $(gnulib).
5265
5266 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5267
5268         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5269         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5270         * pthreadP.h: Declare __nptl_deallocate_tsd.
5271         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5272         Adjust caller.
5273
5274         * Makefile (tests): Add tst-tsd5.
5275         * tst-tsd5.c: New file.
5276
5277 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5278
5279         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5280         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5281         is SHLIB_COMPAT check.
5282         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5283         (__pthread_attr_getaffinity_old): Likewise.
5284         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5285         (__pthread_getaffinity_old): Likewise.
5286         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5287         (__pthread_setaffinity_old): Likewise.
5288
5289 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5290
5291         * allocatestack.c (_make_stacks_executable): Call
5292         _dl_make_stack_executable first.
5293
5294 2004-03-24  Roland McGrath  <roland@redhat.com>
5295
5296         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5297         constraint instead of "0".
5298
5299 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5300
5301         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5302         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5303
5304         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5305         code to avoid warning.
5306
5307 2004-03-24  Andreas Jaeger  <aj@suse.de>
5308
5309         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5310         (__pthread_attr_setaffinity_old): Remove const.
5311
5312 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5313
5314         * sysdeps/unix/sysv/linux/smp.h: New file.
5315         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5316         * init.c: Define __is_smp.
5317         (__pthread_initialize_minimal_internal): Call is_smp_system to
5318         initialize __is_smp.
5319         * pthreadP.h: Declare __is_smp.
5320         Define MAX_ADAPTIVE_COUNT is necessary.
5321         * pthread_mutex_init.c: Add comment regarding __spins field.
5322         * pthread_mutex_lock.c: Implement adaptive mutex type.
5323         * pthread_mutex_timedlock.c: Likewise.
5324         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5325         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5326         Add __spins field.
5327         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5328         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5329         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5330         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5331         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5332         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5333         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5334         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5335         lll_mutex_cond_trylock.
5336         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5337         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5338         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5339         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5340         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5341         Define BUSY_WAIT_NOP.
5342         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5343         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5344
5345         * tst-mutex5.c: Add support for testing adaptive mutexes.
5346         * tst-mutex7.c: Likewise.
5347         * tst-mutex5a.c: New file.
5348         * tst-mutex7a.c: New file.
5349         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5350
5351         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5352         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5353         vgettimeofday call might destroy the content.
5354
5355         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5356         @pause in the loop.
5357
5358         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5359         No need to restrict type of ret.  Make it int.  Add comment.
5360
5361         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5362         Remove unnecessary setne instruction.
5363
5364 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5365
5366         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5367         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5368         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5369         If realloc fails, break out of the loop.
5370
5371 2004-03-20  Andreas Jaeger  <aj@suse.de>
5372
5373         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5374         (__pthread_setaffinity_old): Fix interface.
5375         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5376         (__pthread_getaffinity_old): Likewise.
5377
5378         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5379         (__pthread_setaffinity_new): Remove duplicate declaration.
5380
5381 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5382
5383         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5384         the return value to a safe register.
5385         (CDISABLE): Set the function argument correctly.
5386
5387 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5388
5389         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5390         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5391         Rewrite so that only one locked memory operation per round is needed.
5392         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5393         (pthread_barrier_wait): After wakeup, release lock only when the
5394         last thread stopped using the barrier object.
5395         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5396         (__pthread_cond_wait): Don't store mutex address if the current
5397         value is ~0l.  Add correct cleanup support and unwind info.
5398         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5399         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5400         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5401         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5402         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5403         Add correct cleanup support and unwind info.
5404         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5405         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5406         information for syscall wrappers.
5407
5408 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5409
5410         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5411         cpusetsize field, remove next.
5412         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5413         parameter for size of the CPU set.
5414         (pthread_setaffinity_np): Likewise.
5415         (pthread_attr_getaffinity_np): Likewise.
5416         (pthread_attr_setaffinity_np): Likewise.
5417         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5418         interface change, keep compatibility code.
5419         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5420         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5421         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5422         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5423         __pthread_getaffinity_np.
5424         * Versions: Add version for changed interfaces.
5425         * tst-attr3.c: Adjust test for interface change.
5426         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5427         increasing buffer sizes.
5428         * pthread_attr_destroy.c: Remove unused list handling.
5429         * pthread_attr_init.c: Likewise.
5430
5431 2004-03-17  Roland McGrath  <roland@redhat.com>
5432
5433         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5434         first argument to clock_getres so we ever enable kernel timers.
5435
5436 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5437
5438         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5439
5440 2004-03-12  Richard Henderson  <rth@redhat.com>
5441
5442         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5443         oldvalue from CENABLE to CDISABLE.
5444
5445 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5446
5447         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5448         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5449         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5450         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5451
5452 2004-03-11  Richard Henderson  <rth@redhat.com>
5453
5454         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5455         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5456         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5457
5458 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5459
5460         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5461         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5462         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5463
5464 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5465
5466         * forward.c (__pthread_cond_broadcast_2_0,
5467         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5468         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5469         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5470
5471 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5472
5473         * sysdeps/sh/tcb-offsets.sym: Add PID.
5474         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5475         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5476
5477 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5478
5479         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5480         include <sysdep-cancel.h>, vfork is no cancellation point.
5481         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5482         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5483         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5484
5485 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5486
5487         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5488         libc_hidden_def.
5489         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5490         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5491         Likewise.
5492         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5493         Likewise.
5494         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5495         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5496         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5497         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5498         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5499
5500         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5501         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5502         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5503         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5504         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5505         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5506
5507         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5508         a local register for saving old PID.  Negate PID in parent upon exit.
5509
5510         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5511         tcb-offsets.h.
5512         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5513         before syscall, set to the old value in the parent afterwards.
5514         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5515         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5516         tcb-offsets.h.
5517         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5518         before syscall, set to the old value in the parent afterwards.
5519         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5520         * sysdeps/s390/tcb-offsets.sym: Add PID.
5521
5522         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5523         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5524         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5525         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5526         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5527         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5528
5529 2004-03-10  Andreas Schwab  <schwab@suse.de>
5530
5531         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5532         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5533         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5534
5535 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5536
5537         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5538         * tst-cancel21.c (do_one_test): Likewise.
5539         Reported by Gordon Jin <gordon.jin@intel.com>.
5540
5541 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5542
5543         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5544         if non-zero and set to INT_MIN if zero.
5545         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5546         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5547         (SAVE_PID, RESTORE_PID): Define.
5548         (__vfork): Use it.
5549         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5550         Use relative path to avoid including NPTL i386/vfork.S.
5551         (SAVE_PID, RESTORE_PID): Define.
5552         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5553         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5554         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5555         tst-vfork2x.
5556         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5557         * tst-vfork1.c: New test.
5558         * tst-vfork2.c: New test.
5559         * tst-vfork1x.c: New test.
5560         * tst-vfork2x.c: New test.
5561
5562 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5563
5564         * sysdeps/i386/tcb-offsets.sym: Add PID.
5565         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5566         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5567         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5568
5569 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5570
5571         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5572
5573 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5574
5575         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5576         _rtld_global_ro.
5577
5578 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5579
5580         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5581         _rtld_global_ro.
5582
5583         * tst-once4.c: Remove unnecessary macro definition.
5584
5585         * tst-mutex7.c (do_test): Limit thread stack size.
5586         * tst-once2.c (do_test): Likewise.
5587         * tst-tls3.c (do_test): Likewise.
5588         * tst-tls1.c (do_test): Likewise.
5589         * tst-signal3.c (do_test): Likewise.
5590         * tst-kill6.c (do_test): Likewise.
5591         * tst-key4.c (do_test): Likewise.
5592         * tst-join4.c (do_test): Likewise.
5593         * tst-fork1.c (do_test): Likewise.
5594         * tst-context1.c (do_test): Likewise.
5595         * tst-cond2.c (do_test): Likewise.
5596         * tst-cond10.c (do_test): Likewise.
5597         * tst-clock2.c (do_test): Likewise.
5598         * tst-cancel10.c (do_test): Likewise.
5599         * tst-basic2.c (do_test): Likewise.
5600         * tst-barrier4.c (do_test): Likewise.
5601
5602 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5603
5604         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5605
5606 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5607
5608         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5609         (__pthread_cond_timedwait): Optimize wakeup test.
5610         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5611         (__pthread_cond_wait): Likewise.
5612         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5613         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5614         Likewise.
5615
5616 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5617
5618         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5619         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5620         the atomic instruction needed.
5621         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5622         (__lll_mutex_lock_wait): Likewise.
5623
5624 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5625
5626         * Makefile (tests): Add tst-cond14 and tst-cond15.
5627         * tst-cond14.c: New file.
5628         * tst-cond15.c: New file.
5629
5630 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5631
5632         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5633         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5634         needs to be implemented differently to be useful.
5635
5636 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5637
5638         * pthread_attr_setschedparam.c: Don't test priority against limits
5639         here.  Set ATTR_FLAG_SCHED_SET flag.
5640         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5641         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5642         from parent thread to child.  If attribute is used and scheduling
5643         parameters are not inherited, copy parameters from attribute or
5644         compute them.  Check priority value.
5645         * pthread_getschedparam.c: If the parameters aren't known yet get
5646         them from the kernel.
5647         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5648         ATTR_FLAG_POLICY_SET flag for thread.
5649         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5650         and ATTR_FLAG_POLICY_SET.
5651
5652         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5653
5654         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5655         fail if stack address hasn't been set.  Just return 0.
5656
5657 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5658
5659         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5660         libpthread for the files in this list.
5661         (CFLAGS-tst-unload): Removed.
5662         * tst-unload.c (do_test): Don't use complete path for
5663         LIBPHREAD_SO.
5664
5665         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5666         tst-_res1mod2.
5667
5668 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5669
5670         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5671         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5672         operation per round is needed.
5673         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5674         (__lll_mutex_lock_wait): Likewise.
5675
5676 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5677
5678         * tst-cancel9.c (cleanup): Don't print to stderr.
5679
5680 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5681
5682         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5683
5684 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5685
5686         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5687         (__syscall_error_handler2): Call CDISABLE.
5688         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5689         (__syscall_error_handler2): Call CDISABLE.
5690
5691         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5692         Release lock before the loop, don't reacquire it.
5693
5694         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5695
5696 2004-02-19  Andreas Schwab  <schwab@suse.de>
5697
5698         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5699         Fix last change.
5700
5701 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5702
5703         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5704         (pthread_barrier_wait): After wakeup, release lock only when the
5705         last thread stopped using the barrier object.
5706         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5707         (pthread_barrier_wait): Likewise.
5708         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5709         Likewise.
5710         * Makefile (tests): Add tst-barrier4.
5711         * tst-barrier4.c: New file.
5712
5713         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5714         (__pthread_cond_timedwait): Perform timeout test while holding
5715         internal lock to prevent wakeup race.
5716         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5717         * sysdeps/pthread/pthread_cond_timedwait.c
5718         (__pthread_cond_timedwait): Likewise.
5719         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5720         (__pthread_cond_timedwait): Likewise.
5721
5722 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5723
5724         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5725         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5726         * Makefile (tests): Add tst-rwlock13.
5727         * tst-rwlock13.c: New test.
5728
5729 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5730
5731         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5732         (__condvar_tw_cleanup): Little optimization.
5733         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5734
5735 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5736
5737         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5738         libpthread as "lib" parameter to SHLIB_COMPAT.
5739         (__novmx_siglongjmp): Fix typo in function name.
5740         (__novmx_longjmp): Fix typo in function name.
5741
5742 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5743
5744         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5745         __builtin_expect.
5746
5747         * sysdeps/generic/pt-longjmp.c: Moved to...
5748         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5749
5750 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5751
5752         * Makefile (libpthread-routines): Add pt-cleanup.
5753         * pt-longjmp.c: Removed.
5754         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5755         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5756         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5757         Version longjmp, siglongjmp for GLIBC_2.3.4.
5758         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5759
5760 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5761
5762         * sysdeps/pthread/pthread_cond_timedwait.c
5763         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5764         Reuse code.  Add __builtin_expects.
5765
5766         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5767         (__pthread_cond_timedwait): Get internal lock in case timeout has
5768         passed before the futex syscall.
5769         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5770
5771 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5772
5773         * allocatestack.c: Pretty printing.
5774
5775         * sysdeps/pthread/createthread.c (create_thread): Don't add
5776         CLONE_DETACHED bit if it is not necessary.
5777
5778 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5779
5780         * pthread_getattr_np.c: Include ldsodefs.h.
5781
5782 2004-01-16  Richard Henderson  <rth@redhat.com>
5783
5784         * allocatestack.c: Don't declare __libc_stack_end.
5785         * init.c (__pthread_initialize_minimal_internal): Likewise.
5786         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5787
5788 2004-01-15  Richard Henderson  <rth@redhat.com>
5789
5790         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5791         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5792         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5793         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5794         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5795         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5796         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5797         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5798
5799 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5800
5801         * init.c (pthread_functions): Make array const.
5802
5803 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5804
5805         * allocatestack.c (__make_stacks_executable): Change interface.
5806         Check parameters.  Pass parameter on to libc counterpart.
5807         * pthreadP.h: Change declaration.
5808
5809 2004-01-13  Richard Henderson  <rth@redhat.com>
5810
5811         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5812         prototype form.
5813         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5814         Likewise.
5815
5816         * sysdeps/alpha/Makefile: New file.
5817         * sysdeps/alpha/tcb-offsets.sym: New file.
5818         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5819         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5820
5821         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5822         on powerpc version.
5823
5824 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5825
5826         * Makefile (tests): Add tst-backtrace1.
5827         * tst-backtrace1.c: New test.
5828
5829 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5830
5831         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5832         register as second parameter to the REGISTER macro.
5833         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5834         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5835         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5836         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5837         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5838         of thread register as second parameter to REGISTER macro in 64 case.
5839
5840 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5841
5842         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5843         (CFLAGS-getpid.o): Defined.
5844         (CFLAGS-getpid.os): Defined.
5845
5846 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5847
5848         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5849         returned for main thread does not overlap with any other VMA.
5850         Patch by Jakub Jelinek.
5851
5852 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5853
5854         * tst-raise1.c: Include stdio.h.
5855
5856 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5857
5858         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5859         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5860         If pid is 0, set it to selftid.
5861         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5862         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5863         != 0, return self->tid without doing a syscall.
5864         * descr.h (struct pthread): Move pid field after tid.
5865
5866         * Makefile (tests): Add tst-raise1.
5867         * tst-raise1.c: New file.
5868
5869 2003-12-23  Roland McGrath  <roland@redhat.com>
5870
5871         * tst-oddstacklimit.c: New file.
5872         * Makefile (tests): Add it.
5873         (tst-oddstacklimit-ENV): New variable.
5874
5875         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5876         value up to page size for __default_stacksize.
5877
5878 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5879
5880         * Makefile (tests): Add tst-eintr5.
5881         * tst-eintr5.c: New file.
5882
5883         * eintr.c (eintr_source): Prevent sending signal to self.
5884
5885         * tst-eintr2.c (tf1): Improve error message.
5886
5887 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5888
5889         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5890         * sysdeps/unix/sysv/linux/getpid.c: New file.
5891         * pthread_cancel.c: Add comment explaining use of PID field.
5892         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5893         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5894         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5895         temporarily to signal the field must not be relied on and updated
5896         by getpid().
5897         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5898         temporarily negative.
5899         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5900
5901 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5902
5903         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5904         (eintr_source): If ARG != NULL, use pthread_kill.
5905         * tst-eintr1.c: Adjust for this change.
5906         * tst-eintr2.c: Likewise.
5907         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5908         * tst-eintr3.c: New file.
5909         * tst-eintr4.c: New file.
5910
5911 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5912
5913         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5914         if CANCELSTATE_BITMASK is set.
5915         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5916         Likewise.
5917
5918         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5919         (tests-reverse): Add tst-cancel23.
5920         * tst-cancel22.c: New test.
5921         * tst-cancel23.c: New test.
5922
5923 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5924
5925         * tst-eintr1.c: Better error messages.
5926
5927         * Makefile (tests): Add tst-eintr2.
5928         * tst-eintr2.c: New file.
5929
5930 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5931
5932         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5933         (CFLAGS-tst-cancelx21.c): Set.
5934         * tst-cancel21.c: New test.
5935         * tst-cancelx21.c: New test.
5936
5937         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5938         comparison operand.
5939         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5940         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5941         * pt-longjmp.c: Include jmpbuf-unwind.h.
5942         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5943         _JMPBUF_UNWINDS.  Adjust compared pointers.
5944         * init.c (__pthread_initialize_minimal_internal): Initialize
5945         pd->stackblock_size.
5946         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5947         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5948         * sysdeps/i386/jmpbuf-unwind.h: New file.
5949         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5950         * sysdeps/s390/jmpbuf-unwind.h: New file.
5951         * sysdeps/sh/jmpbuf-unwind.h: New file.
5952         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5953         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5954         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5955         (_JMPBUF_CFA_UNWINDS): Remove.
5956         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5957
5958 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5959
5960         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5961         (CFLAGS-tst-cancelx20.c): Set.
5962         * tst-cancel20.c: New test.
5963         * tst-cancelx20.c: New test.
5964
5965 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5966
5967         * init.c (__pthread_initialize_minimal_internal): Don't treat
5968         architectures with separate register stack special here when
5969         computing default stack size.
5970
5971 2003-12-17  Roland McGrath  <roland@redhat.com>
5972
5973         * Makefile (tst-cancelx7-ARGS): New variable.
5974         Reportd by Greg Schafer <gschafer@zip.com.au>.
5975
5976 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5977
5978         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5979         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5980         (tst-stack3-ENV): Set.
5981         ($(objpfx)tst-stack3-mem): New.
5982         * tst-stack3.c: New test.
5983
5984 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5985
5986         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5987         Add unwind directives.  Drop unused .regstk directive.
5988         (_fini_EPILOG_BEGINS): Add unwind directives.
5989
5990 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5991
5992         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5993         Assume parameter is a pointer.
5994         (lll_futex_wake): Likewise.
5995         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5996         Likewise.
5997         (lll_futex_wake): Likewise.
5998         Reported by Boris Hu.
5999         * sysdeps/unix/sysv/linux/unregister-atfork.c
6000         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
6001
6002         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
6003
6004 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
6005
6006         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
6007         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
6008         __rtld_lock_initialize for ld.so lock.
6009         Patch in part by Adam Li <adam.li@intel.com>.
6010
6011 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
6012
6013         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
6014         in $(gnulib).  Also, remove stale comment.
6015
6016 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
6017
6018         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
6019         advantage of new syscall stub and optimize accordingly.
6020
6021         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
6022         from SYS_futex, to match expectations of
6023         sysdep.h:DO_INLINE_SYSCALL.
6024         (lll_futex_clobbers): Remove.
6025         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
6026         (lll_futex_wake): Likewise.
6027         (lll_futex_requeue): Likewise.
6028         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
6029         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
6030         Jelinek).
6031         (__lll_mutex_lock): Likewise.
6032         (__lll_mutex_cond_lock): Likewise.
6033         (__lll_mutex_timed_lock): Likewise.
6034         (__lll_mutex_unlock): Likewise.
6035         (__lll_mutex_unlock_force): Likewise.
6036
6037         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
6038         comes before the include of <sysdep.h>.
6039         (THREAD_SELF_SYSINFO): New macro.
6040         (THREAD_SYSINFO): Likewise.
6041         (INIT_SYSINFO): New macro.
6042         (TLS_INIT_TP): Call INIT_SYSINFO.
6043
6044         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
6045
6046         * sysdeps/pthread/createthread.c (create_thread): Use
6047         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
6048         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
6049         THREAD_SELF_SYSINFO instead of open code.
6050         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
6051         (THREAD_SYSINFO): Likewise.
6052
6053         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
6054
6055         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
6056
6057 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
6058
6059         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
6060         instead of .init.  Patch by David Mosberger.
6061
6062 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
6063
6064         * sysdeps/pthread/configure.in: Remove broken declaration in C
6065         cleanup handling check.
6066
6067 2003-11-30  Andreas Jaeger  <aj@suse.de>
6068
6069         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
6070         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
6071         Likewise.
6072
6073 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
6074
6075         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
6076         * pthread_attr_destroy.c: Include shlib-compat.h.
6077         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
6078         is set in iattr->flags.
6079         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
6080
6081 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
6082
6083         * Makefile (distribute): Add tst-cleanup4aux.c.
6084
6085         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
6086         include.
6087
6088 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
6089
6090         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
6091         pthread_cond_signal.
6092
6093         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
6094         store mutex address if the current value is ~0l.
6095         * sysdeps/pthread/pthread_cond_timedwait.c
6096         (__pthread_cond_timedwait): Likewise.
6097         * sysdeps/pthread/pthread_cond_broadcast.c
6098         (__pthread_cond_broadcast): Don't use requeue for pshared
6099         condvars.
6100
6101         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6102         (__pthread_cond_wait): Don't store mutex address if the current
6103         value is ~0l.
6104         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6105         (__pthread_cond_timedwait): Likewise.
6106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6107         (__pthread_cond_broadcast): Don't use requeue for pshared
6108         condvars.
6109
6110         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
6111         element with ~0l for pshared condvars, with NULL otherwise.
6112
6113         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6114         (__pthread_cond_wait): Don't store mutex address if the current
6115         value is ~0l.
6116         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6117         (__pthread_cond_timedwait): Likewise.
6118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6119         (__pthread_cond_broadcast): Don't use requeue for pshared
6120         condvars.
6121
6122         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
6123         * tst-cond12.c: New file.
6124         * tst-cond13.c: New file.
6125
6126 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
6127
6128         * sysdeps/pthread/configure.in: Make missing forced unwind support
6129         fatal.
6130
6131 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
6132
6133         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6134
6135 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6136
6137         * Makefile: Add magic to clean up correctly.
6138
6139 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6140
6141         * unwind.c (FRAME_LEFT): Define.
6142         (unwind_stop): Handle old style cleanups here.
6143         (__pthread_unwind): Handle old style cleanups only if
6144         !HAVE_FORCED_UNWIND.
6145         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6146         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6147         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6148         ($(objpfx)tst-cleanupx4): Likewise.
6149         * tst-cleanup4.c: New test.
6150         * tst-cleanup4aux.c: New.
6151         * tst-cleanupx4.c: New test.
6152
6153 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6154
6155         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6156         lll_mutex_*lock macros to skip atomic operations on some archs.
6157
6158 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6159
6160         * sysdeps/pthread/tst-timer.c (main): Initialize
6161         sigev2.sigev_value as well.
6162
6163 2003-10-15  Roland McGrath  <roland@redhat.com>
6164
6165         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6166         is missing.
6167         * sysdeps/pthread/configure: Regenerated.
6168
6169 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6170
6171         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6172         locking macros.  No distinction between normal and mutex locking
6173         anymore.
6174         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6175         Merge bits from lowlevelmutex.S we still need.
6176         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6177         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6178         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6179         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6180         new mutex implementation.
6181         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6182         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6183         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6184         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6185         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6186         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6187         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6188         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6189         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6190         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6191         symbol for entry point to avoid cancellation.
6192
6193 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6194
6195         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6196         changes.
6197         (SAVE_OLDTYPE_0): Fix a typo.
6198
6199 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6200
6201         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6202         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6203
6204 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6205
6206         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6207         correct offset.
6208
6209 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6210
6211         * Makefile (tests): Add tst-cancel19.
6212         * tst-cancel19.c: New test.
6213
6214 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6215
6216         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6217         restoring of the old cancellation type.
6218
6219 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6220
6221         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6222
6223 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6224
6225         * sysdeps/pthread/malloc-machine.h: New file
6226
6227 2003-09-24  Roland McGrath  <roland@redhat.com>
6228
6229         * allocatestack.c (__make_stacks_executable): Don't ignore return
6230         value from _dl_make_stack_executable.
6231
6232 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6233
6234         * allocatestack.c (__make_stacks_executable): Also change
6235         permission of the currently unused stacks.
6236
6237         * allocatestack.c (change_stack_perm): Split out from
6238         __make_stacks_executable.
6239         (allocate_stack): If the required permission changed between the time
6240         we started preparing the stack and queueing it, change the permission.
6241         (__make_stacks_executable): Call change_stack_perm.
6242
6243         * Makefile: Build tst-execstack-mod locally.
6244         * tst-execstack-mod.c: New file.
6245
6246 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6247
6248         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6249
6250 2003-09-23  Roland McGrath  <roland@redhat.com>
6251
6252         * tst-execstack.c: New file.
6253         * Makefile (tests): Add it.
6254         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6255         (LDFLAGS-tst-execstack): New variable.
6256
6257         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6258         whether to use PROT_EXEC for stack mmap.
6259         (__make_stacks_executable): New function.
6260         * pthreadP.h: Declare it.
6261         * init.c (__pthread_initialize_minimal_internal): Set
6262         GL(dl_make_stack_executable_hook) to that.
6263
6264 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6265
6266         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6267         recommendation from AMD re avoidance of lock prefix.
6268
6269 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6270
6271         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6272         lll_futex_timed_wait instead of lll_futex_wait.
6273         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6274         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6275         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6276         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6277         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6278         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6279         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6280         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6281         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6282         Completely revamp the locking macros.  No distinction between
6283         normal and mutex locking anymore.
6284         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6285         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6286         __lll_lock_timedwait): Fix prototypes.
6287         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6288         __lll_lock_timedwait): Likewise.
6289         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6290         macros, add __builtin_expect.
6291         (lll_mutex_timedlock): Likewise.  Fix return value.
6292         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6293         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6294         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6295         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6296         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6297         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6298         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6299         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6300
6301 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6302
6303         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6304         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6305         operation if possible.
6306
6307         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6308         like jumping over the lock prefix.
6309
6310 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6311
6312         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6313         locking macros.  No distinction between normal and mutex locking
6314         anymore.
6315         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6316         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6317         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6318         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6319         locking.  Merge bits from lowlevelmutex.S we still need.
6320         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6321         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6322         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6323         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6324         * Makefile (routines): Remove libc-lowlevelmutex.
6325         (libpthread-rountines): Remove lowlevelmutex.
6326         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6327         for new mutex implementation.
6328         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6329         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6330         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6331         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6332         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6333         Likewise.
6334         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6335         Likewise.
6336         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6337         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6338         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6339         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6341         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6342         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6343         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6344         Likewise.
6345         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6346         Likewise.
6347         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6348         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6349         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6350         Don't use requeue.
6351         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6352         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6353
6354 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6355
6356         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6357         in parameters of asm with output parameters.
6358
6359         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6360         type of DECR parameter to int.
6361         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6362
6363 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6364
6365         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6366         guardsize for each thread.
6367
6368 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6369
6370         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6371         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6372         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6373
6374         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6375         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6376         NULL.
6377         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6378         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6379         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6380         (pthread_getaffinity_np): Add hidden_def.
6381
6382         * Makefile (tests): Add tst-attr3.
6383         * tst-attr3.c: New test.
6384
6385         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6386
6387 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6388
6389         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6390         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6391
6392 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6393
6394         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6395         * tst-align.c: Include tst-stack-align.h.
6396         (tf, do_test): Use TEST_STACK_ALIGN macro.
6397
6398 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6399
6400         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6401         variable.
6402
6403 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6404
6405         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6406         stack-related values for the initial thread.
6407
6408 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6409
6410         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6411
6412 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6413
6414         * pthread_mutex_lock.c: Minor code rearrangements.
6415
6416 2003-09-05  Roland McGrath  <roland@redhat.com>
6417
6418         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6419         Instead, include ../nptl_db/db_info.c to do its magic.
6420         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6421         (__pthread_pthread_key_2ndlevel_size): Likewise.
6422         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6423         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6424         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6425         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6426         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6427         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6428         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6429         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6430         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6431         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6432         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6433         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6434         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6435         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6436         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6437         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6438         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6439
6440 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6441
6442         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6443         of pthread_t to be compatible with LT.
6444         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6445         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6446         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6447         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6448         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6449         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6450         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6451
6452 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6453
6454         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6455
6456 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6457
6458         * unwind-forcedunwind.c: Move to...
6459         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6460         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6461         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6462         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6463         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6464         * unwind.c: Include jmpbuf-unwind.h.
6465         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6466
6467 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6468
6469         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6470         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6471         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6472         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6473         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6474         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6475         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6476         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6477         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6478         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6479         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6480         function.
6481         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6482         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6483         * Makefile (tests): Add tst-stack2.
6484         * tst-stack2.c: New test.
6485         * tst-stack1.c: Include limits.h and sys/param.h.
6486         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6487
6488         * pthread_condattr_setpshared.c: Include errno.h.
6489         (pthread_condattr_setpshared): Return EINVAL if pshared
6490         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6491
6492         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6493         defined symbol for entry point to avoid cancellation.
6494         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6495         Likewise.
6496         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6497         Likewise.
6498         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6499         Likewise.
6500         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6501         Likewise.
6502         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6503         Likewise.
6504         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6505         __close_nocancel, __read_nocancel, __write_nocancel,
6506         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6507         libpthread.so or librt.so, define to corresponding function
6508         without _nocancel suffix.
6509         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6510         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6511         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6512
6513         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6514
6515 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6516
6517         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6518         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6519
6520         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6521         in subsections has a symbol associated with it.
6522
6523         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6524         defined symbol for entry point to avoid cancellation.
6525         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6526
6527 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6528
6529         * Makefile (tests): Add tst-tls5.
6530         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6531         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6532         ($(objpfx)tst-tls5): New.
6533         ($(objpfx)tst-tls6.out): Likewise.
6534         (tests): Depend on $(objpfx)tst-tls6.out.
6535         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6536         (do_test): Check pthread_self () return value alignment.
6537         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6538         (tf): Check pthread_self () return value alignment.
6539         * tst-tls5.c: New test.
6540         * tst-tls5.h: New.
6541         * tst-tls5mod.c: New.
6542         * tst-tls5moda.c: New.
6543         * tst-tls5modb.c: New.
6544         * tst-tls5modc.c: New.
6545         * tst-tls5modd.c: New.
6546         * tst-tls5mode.c: New.
6547         * tst-tls5modf.c: New.
6548         * tst-tls6.sh: New test.
6549
6550         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6551         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6552         * init.c (pthread_functions): Initialize them.
6553         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6554         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6555         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6556         pthread_cond_timedwait@@GLIBC_2.3.2.
6557
6558 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6559
6560         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6561         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6562         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6563         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6564         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6565         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6566
6567         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6568
6569         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6570         _POSIX_THREAD_PRIORITY_SCHEDULING.
6571         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6572
6573 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6574
6575         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6576         nested function, use static inline function from libio.h.
6577         Code by Richard Henderson.
6578
6579         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6580         weak.
6581
6582 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6583
6584         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6585         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6586         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6587         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6588         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6589         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6590         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6591         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6592         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6593         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6594         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6595         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6596         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6597         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6598         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6599         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6600         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6601         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6602         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6603         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6604         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6605         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6606         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6607         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6608         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6609         * sysdeps/sparc/tls.h: New file.
6610         * sysdeps/sparc/tcb-offsets.sym: New file.
6611         * sysdeps/sparc/Makefile: New file.
6612         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6613         * init.c [__sparc__] (__NR_set_tid_address): Define.
6614
6615 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6616
6617         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6618         _IO_release_lock): Define.
6619
6620 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6621
6622         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6623         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6624
6625 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6626
6627         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6628         (__pthread_cleanup_class): Add missing return types of member
6629         functions.
6630
6631 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6632
6633         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6634         (lll_mutex_unlock_force): Add memory barrier between store and futex
6635         syscall.
6636
6637 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6638
6639         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6640         tempmsg in first loop.
6641
6642 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6643
6644         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6645         _POSIX_THREAD_PRIORITY_SCHEDULING.
6646         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6647
6648 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6649
6650         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6651         (__rtld_lock_default_lock_recursive,
6652         __rtld_lock_default_unlock_recursive): Define.
6653         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6654         __rtld_lock_unlock_recursive): Define using
6655         GL(_dl_rtld_*lock_recursive).
6656         * init.c (__pthread_initialize_minimal_internal): Initialize
6657         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6658         Lock GL(_dl_load_lock) the same number of times as
6659         GL(_dl_load_lock) using non-mt implementation was nested.
6660
6661         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6662         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6663
6664 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6665
6666         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6667         PIPE_BUF.
6668
6669 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6670
6671         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6672
6673 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6674
6675         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6676         to first syscall error check.  Move syscall error check for tkill
6677         into __ASSUME_CLONE_STOPPED #ifdef.
6678
6679 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6680
6681         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6682         is not defined, do explicit synchronization.
6683         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6684         is not defined also unlock pd->lock for non-debugging case in case
6685         it is necessary.
6686         * pthread_create.c (start_thread): Always get and release pd->lock
6687         if __ASSUME_CLONE_STOPPED is not defined.
6688         (start_thread_debug): Removed.  Adjust users.
6689         * allocatestack.c (allocate_stack): Always initialize lock if
6690         __ASSUME_CLONE_STOPPED is not defined.
6691         * Makefile (tests): Add tst-sched1.
6692         * tst-sched1.c: New file.
6693
6694         * sysdeps/pthread/createthread.c (do_clone): Only use
6695         sched_setschduler and pass correct parameters.
6696
6697 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6698
6699         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6700         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6701         PTHREAD_STACK_MIN in comments.
6702
6703 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6704
6705         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6706         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6707         argument.
6708         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6709         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6710         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6711         (__pthread_cleanup_upto): Fix prototype.
6712         (_longjmp_unwind): Adjust caller.
6713         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6714         Change second argument to const struct pointer.
6715         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6716         * tst-sem9.c (main): Likewise.
6717         * unwind.c: Include string.h for strlen prototype.
6718
6719 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6720
6721         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6722         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6723         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6724         Define HAVE_CMOV.
6725         Patch by Nicholas Miell <nmiell@attbi.com>.
6726
6727 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6728
6729         * init.c (__pthread_initialize_minimal_internal): Initialize
6730         GL(dl_init_static_tls).
6731         * pthreadP.h (__pthread_init_static_tls): New prototype.
6732         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6733         New functions.
6734         * Makefile (tests): Add tst-tls4.
6735         (modules-names): Add tst-tls4moda and tst-tls4modb.
6736         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6737         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6738         tst-tls4modb.so.
6739         * tst-tls4.c: New file.
6740         * tst-tls4moda.c: New file.
6741         * tst-tls4modb.c: New file.
6742
6743 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6744
6745         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6746         before __timer_dealloc.
6747         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6748         Don't call list_unlink.
6749
6750 2003-07-29  Roland McGrath  <roland@redhat.com>
6751
6752         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6753
6754 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6755
6756         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6757         Don't reuse struct aiocb A if it failed.
6758         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6759         not just one byte, as that does not block.
6760
6761 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6762
6763         * sysdeps/pthread/unwind-resume.c: New file.
6764         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6765         unwind-resume in csu subdir.
6766         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6767         exceptions.
6768         (librt-sysdep_routines, librt-shared-only-routines): Add
6769         rt-unwind-resume.
6770         * sysdeps/pthread/rt-unwind-resume.c: New file.
6771         * unwind-forcedunwind.c: New file.
6772         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6773         (libpthread-shared-only-routines): Likewise.
6774         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6775         * pthreadP.h (pthread_cancel_init): New prototype.
6776         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6777
6778         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6779         attr argument const struct pthread_attr *.
6780
6781         * res.c (__res_state): Return __resp.
6782         * descr.h: Include resolv.h.
6783         (struct pthread): Add res field.
6784         * pthread_create.c: Include resolv.h.
6785         (start_thread): Initialize __resp.
6786         * Makefile (tests): Add tst-_res1.
6787         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6788         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6789         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6790         libpthread.
6791         * tst-_res1.c: New file.
6792         * tst-_res1mod1.c: New file.
6793         * tst-_res1mod2.c: New file.
6794
6795 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6796
6797         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6798
6799         * Makefile: Define various *-no-z-defs variables for test DSOs
6800         which has undefined symbols.
6801
6802 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6803
6804         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6805         Retry if the stwcx fails to store once_control.
6806
6807 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6808
6809         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6810         pthread_attr_setaffinity.
6811         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6812         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6813         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6814         * pthread_attr_destroy.c: Free cpuset element if allocated.
6815         * pthread_create.c: Pass iattr as additional parameter to
6816         create_thread.
6817         * sysdeps/pthread/createthread.c: If attribute is provided and
6818         a new thread is created with affinity set or scheduling parameters,
6819         start thread with CLONE_STOPPED.
6820         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6821         pthread_attr_setaffinity.
6822         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6823         cpuset element.
6824
6825 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6826
6827         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6828
6829 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6830
6831         * sysdeps/pthread/configure.in: Require CFI directives also for
6832         ppc and s390.
6833
6834 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6835
6836         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6837         Add cfi directives.
6838
6839 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6840
6841         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6842         CLEANUP_JMP_BUF.
6843         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6844         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6845         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6846         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6847         not self pointer in __writer.  Compare with TID to determine
6848         deadlocks.
6849         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6850         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6851         Likewise.
6852         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6853         Likewise.
6854         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6855         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6856         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6857         macros also when compiling librt.
6858
6859 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6860
6861         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6862         -fasynchronous-unwind-tables.
6863         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6864         (PSEUDO): Add cfi directives.
6865         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6866         Likewise.
6867         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6868         Likewise.
6869
6870 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6871
6872         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6873         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6874         * unwind.c (__pthread_unwind_next): Add hidden_def.
6875         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6876         Likewise.
6877         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6878         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6879         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6880         Likewise.
6881         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6882         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6883         Likewise.
6884         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6885         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6886         __pthread_unregister_cancel and __pthread_unwind_next.
6887
6888 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6889
6890         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6891         different symbol for the cancellation syscall wrapper and
6892         non-cancellation syscall wrapper.
6893         (PSEUDO_END): Define.
6894
6895 2003-07-05  Richard Henderson  <rth@redhat.com>
6896
6897         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6898         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6899         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6900         return actual return value from the syscall, not 0.
6901
6902 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6903
6904         * descr.h (struct pthread): Add pid field.
6905         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6906         (__reclaim_stacks): Likewise.
6907         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6908         also check for PID of the signal source.
6909         (__pthread_initialize_minimal_internal): Also initialize pid field
6910         of initial thread's descriptor.
6911         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6912         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6913         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6914         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6915         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6916
6917 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6918
6919         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6920         Fix use of parameter.
6921         (__libc_cleanup_pop): Likewise.
6922
6923 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6924
6925         * init.c (sigcancel_handler): Change parameters to match handler
6926         for SA_SIGACTION.  Check signal number and code to recognize
6927         invalid invocations.
6928
6929 2003-07-03  Roland McGrath  <roland@redhat.com>
6930
6931         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6932         Apply sizeof (struct pthread) bias to r13 value.
6933
6934 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6935
6936         * sysdeps/pthread/configure.in: Require CFI directives.
6937
6938         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6939         definition.
6940         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6941         libpthread compilation.
6942         * unwind.c (__pthread_unwind): Add hidden_def.
6943         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6944
6945 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6946
6947         * libc-cancellation.c (__libc_cleanup_routine): Define.
6948         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6949         (__pthread_cleanup_pop): Define.
6950
6951 2003-07-01  Richard Henderson  <rth@redhat.com>
6952
6953         * sysdeps/alpha/elf/pt-initfini.c: New file.
6954         * sysdeps/alpha/pthread_spin_lock.S: New file.
6955         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6956         * sysdeps/alpha/pthreaddef.h: New file.
6957         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6958         * sysdeps/alpha/tls.h: New file.
6959         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6960         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6961         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6962         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6963         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6964         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6965         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6966         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6967         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6968         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6969
6970 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6971
6972         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6973         cleanup support and unwind info.
6974
6975 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6976
6977         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6978         Use correct cleanup handler registration.  Add unwind info.
6979         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6980         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6981         * tst-once3.c: Add cleanup handler and check it is called.
6982         * tst-once4.c: Likewise.
6983         * tst-oncex3.c: New file.
6984         * tst-oncex4.c: New file.
6985         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6986
6987 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6988
6989         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6990
6991 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6992
6993         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6994         (tf_msgsnd): Likewise.
6995
6996         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6997         premature returns a bit more.
6998
6999 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
7000
7001         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
7002         definition to the front.
7003
7004         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
7005         the cleanup functions to make the names unique.  Fix dwarf opcode
7006         un unwind table.
7007         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
7008         functions to make the names unique.  Fix CFA offset for two blocks.
7009
7010 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
7011
7012         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
7013         missing closing braces.
7014         Patch by Christophe Saout <christophe@saout.de>.
7015
7016 2003-06-24  Roland McGrath  <roland@redhat.com>
7017
7018         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
7019
7020 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
7021
7022         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
7023         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
7024
7025         * pthreadP.h: Declare __find_thread_by_id.
7026         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
7027         * pthread_clock_gettime.c: Allow using other thread's clock.
7028         * pthread_clock_settime.c: Likewise.
7029         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
7030         * Makefile: Add rules to build and run tst-clock2.
7031         * tst-clock2.c: New file.
7032
7033 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
7034
7035         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
7036         to use exception-based cleanup handler.
7037         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7038
7039         * tst-cond8.c (ch): Announce that we are done.
7040
7041         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
7042
7043         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
7044         Also test aio_suspend with timeout value.
7045
7046 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
7047
7048         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
7049         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
7050         attribute_hidden.
7051
7052         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
7053         (__pthread_mutex_lock_internal): Likewise.
7054         (__pthread_mutex_unlock_internal): Likewise.
7055         (__pthread_mutex_unlock_usercnt): Declare.
7056         * pthread_mutex_destroy.c: Always fail if used in any way.
7057         * pthread_mutex_init.c: Update comment.
7058         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
7059         * pthread_mutex_timedlock.c: Adjust __nusers.
7060         * pthread_mutex_trylock.c: Adjust __nusers.
7061         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
7062         and public interfaces are wrapper with pass additional parameter.
7063         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
7064         parameter zero.
7065         * tst-mutex8.c: New file.
7066         * Makefile (tests): Add tst-mutex8.
7067         * sysdeps/pthread/pthread_cond_timedwait.c: Call
7068         __pthread_mutex_unlock_usercnt.
7069         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7070         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7071         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7072         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7073         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7074         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
7075         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7076         Add __nusers.
7077         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7078         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7079         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7080         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7081         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7082
7083         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
7084         * pthread_mutex_timedlock.c: Likewise.
7085         * pthread_mutex_trylock.c: Adjust __nusers.
7086         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
7087         * tst-mutex9.c: New file.
7088         * Makefile (tests): Add tst-mutex9.
7089         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
7090         * sysdeps/ia64/tls.h: Likewise.
7091         * sysdeps/powerpc/tls.h: Likewise.
7092         * sysdeps/s390/tls.h: Likewise.
7093         * sysdeps/sh/tls.h: Likewise.
7094         * sysdeps/x86_64/tls.h: Likewise.
7095         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7096         Change type of __owner.
7097         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7098         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7099         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7100         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7101         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7102
7103 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
7104
7105         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
7106         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
7107
7108         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
7109         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
7110         instead of nr to lll_futex_wake.  Only set errno and return -1
7111         if err < 0.
7112
7113         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
7114         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7115         return actual return value from the syscall, not 0.
7116
7117 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
7118
7119         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
7120         find a random value.
7121         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
7122         errno==EIDRM.
7123
7124         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
7125         compat_timer_settime.
7126         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
7127         compat_timer_gettime.
7128         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
7129         compat_timer_getoverrun.
7130         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
7131         compat_timer_delete.
7132
7133         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7134         error-checking mutex detect busy mutexes.
7135
7136 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7137
7138         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7139         Add ax to clobber list.
7140         (lll_mutex_cond_lock): Likewise.
7141         (lll_mutex_unlock): Likewise.
7142         (lll_lock): Likewise.
7143         (lll_unlock): Likewise.
7144
7145         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7146         * tst-cancel18.c: New file.
7147         * tst-cancelx18.c: New file.
7148
7149         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7150         and tcdrain.
7151
7152         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7153         * tst-cancel17.c: New file.
7154         * tst-cancelx17.c: New file.
7155
7156         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7157         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7158         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7159
7160         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7161
7162 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7163
7164         * sysdeps/pthread/createthread.c (create_thread): Set
7165         header.multiple_threads unconditionally.
7166         * allocatestack.c (allocate_stack): Likewise.
7167         * descr.h (struct pthread): Add header.multiple_threads
7168         unconditionally.
7169         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7170         Define for librt.  #error if neither libpthread, libc nor librt.
7171         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7172         Likewise.
7173         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7174         CDISABLE): Likewise.
7175         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7176         CDISABLE): Likewise.
7177         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7178         CDISABLE): Likewise.
7179         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7180         CDISABLE): Likewise.  Access header.multiple_threads outside of
7181         libc and libpthread.
7182         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7183         Likewise.
7184         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7185         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7186
7187 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7188
7189         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7190         Also test early cancellation before the thread reaches the cancellation
7191         point.
7192
7193         * Makefile: Compile forward.c with exceptions.
7194
7195         * sysdeps/unix/sysv/linux/sleep.c: New file.
7196
7197 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7198
7199         * Makefile: Add CFLAGS definition to compile function wrappers
7200         duplicated from libc with exceptions.
7201         * tst-cancel4.c: Also check cancellation handlers.
7202
7203         * Makefile: Add rules to build and run tst-cancel16 and
7204         tst-cancelx16.  Add missing CFLAGS definitions.
7205         * tst-cancel16.c: New file.
7206         * tst-cancelx16.c: New file.
7207
7208 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7209
7210         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7211         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7212         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7213         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7214
7215         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7216         (LIBC_CANCEL_RESET): Likewise.
7217         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7218         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7219         librt-cancellation.
7220         (CFLAGS-libcrt-cancellation.c): Define.
7221         * sysdeps/pthread/librt-cancellation.c: New file.
7222         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7223         macros also when compiling librt.
7224         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7225         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7226         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7227         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7228         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7229         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7230         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7231
7232         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7233         compat_timer_create.
7234
7235 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7236
7237         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7238
7239         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7240         __register_atfork.
7241         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7242         Add libc_hidden_def.
7243
7244 2003-06-13  Roland McGrath  <roland@redhat.com>
7245
7246         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7247         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7248
7249 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7250
7251         * allocatestack.c (queue_stack): Always inline.
7252         * ptreadhP.h (__do_cancel): Likewise.
7253
7254 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7255
7256         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7257         a typo.
7258
7259 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7260
7261         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7262         (__pthread_cond_signal): Remove incorrect second addition for
7263         cond_lock!=0.
7264
7265 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7266
7267         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7268         (__pthread_cond_signal): Use correct futex pointer in
7269         __lll_mutex_lock_wait call.
7270
7271         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7272         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7273
7274 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7275
7276         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7277         cancelable.
7278         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7279         Likewise.
7280
7281         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7282         hand-written CFI generation code.  Since ENTRY/END also initiated
7283         CFI frames this caused two CFI sets to be generated.
7284
7285 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7286
7287         * cleanup_routine.c: New file.
7288         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7289         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7290         cleanup handling.
7291         * Makefile (libpthread-routines): Add cleanup_routine.
7292         Add more CFLAGS variables to compile with exceptions.  Add comments
7293         why which file needs unwind tables.
7294         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7295         tests.
7296         * tst-cancelx1.c: New file.
7297         * tst-cancelx2.c: New file.
7298         * tst-cancelx3.c: New file.
7299         * tst-cancelx4.c: New file.
7300         * tst-cancelx5.c: New file.
7301         * tst-cancelx6.c: New file.
7302         * tst-cancelx7.c: New file.
7303         * tst-cancelx8.c: New file.
7304         * tst-cancelx9.c: New file.
7305         * tst-cancelx10.c: New file.
7306         * tst-cancelx11.c: New file.
7307         * tst-cancelx12.c: New file.
7308         * tst-cancelx13.c: New file.
7309         * tst-cancelx14.c: New file.
7310         * tst-cancelx15.c: New file.
7311         * tst-cleanupx0.c: New file.
7312         * tst-cleanupx0.expect: New file.
7313         * tst-cleanupx1.c: New file.
7314         * tst-cleanupx2.c: New file.
7315         * tst-cleanupx3.c: New file.
7316
7317         * tst-cleanup0.c: Make standard compliant.
7318         * tst-cleanup1.c: Likewise.
7319
7320         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7321         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7322         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7323         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7324         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7325         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7326         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7327         CLEANUP_JMP_BUF.
7328         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7329         * tst-cancel12.c: New file.
7330         * tst-cancel13.c: New file.
7331         * tst-cancel14.c: New file.
7332         * tst-cancel15.c: New file.
7333         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7334         and tst-cancel15.
7335
7336         * tst-cancel1.c: Add some comments.
7337
7338         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7339         timeout correctly.
7340
7341 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7342
7343         * Makefile (CFLAGS-pthread_cancel.c): Define.
7344
7345 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7346
7347         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7348         Change type of __writer element to int.
7349         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7350         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7351         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7352         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7353         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7354         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7355         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7356         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7357         Compare with TID to determine deadlocks.
7358         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7359         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7360         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7361         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7362         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7363         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7364         Likewise.
7365         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7366         Likewise.
7367         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7368         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7369         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7370         Likewise.
7371         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7372         Likewise.
7373         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7374         * Makefile (tests): Add tst-rwlock12.
7375         * tst-rwlock12.c: New file.
7376
7377 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7378
7379         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7380         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7381         Remove bogus hidden_proto.
7382         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7383         Likewise.
7384         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7385         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7386         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7387         ___lll_mutex_timedlock): Likewise.
7388
7389 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7390
7391         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7392         (__pthread_cond_signal): Add some code to eventually handle
7393         cond_lock!=0.
7394
7395 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7396
7397         * Makefile (tests): Add tst-exec4.
7398         (tst-exec4-ARGS): Define.
7399         * tst-exec4.c: New file.
7400
7401 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7402
7403         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7404         Also fail if tv_nsec < 0.
7405         (__lll_timedwait_tid): Likewise.
7406         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7407         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7408         Likewise.
7409         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7410         Likewise.
7411         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7412         Likewise.
7413         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7414         Likewise.
7415         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7416         Likewise.
7417         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7418         Likewise.
7419
7420         * Makefile (tests): Add tst-sem8 and tst-sem9.
7421         * tst-sem8.c: New file.
7422         * tst-sem9.c: New file.
7423         * sem_open.c: Fix creation of in_use record if the file exists but
7424         no internal record.
7425
7426         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7427         definitions.
7428
7429         * sysdeps/pthread/timer_create.c (timer_create): In case
7430         evp==NULL, assign timer ID to sival_ptr.
7431
7432         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7433         struct pthread_unwind_buf *.
7434         (struct pthread): Likewise for cleanup_jmp_buf element.
7435
7436         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7437         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7438         * unwind.c (__pthread_unwind_next): Likewise.
7439
7440 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7441
7442         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7443         (lll_futex_timed_wait): Use int for futex value parameter.
7444         (lll_futex_wake): Likewise.
7445         (lll_futex_requeue): Likewise.
7446
7447         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7448         Replace one memory operation with one register operation.
7449
7450         * tst-join4.c (do_test): Fix error message.
7451
7452         * tst-rwlock6.c (do_test): Use correct format specifier.
7453
7454         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7455         (__lll_mutex_lock_wait): Replace one memory operation with one
7456         register operation.
7457         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7458         (__lll_mutex_lock_wait): Likewise.
7459
7460         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7461         (__lll_mutex_cond_lock): Add one to value parameter of
7462         __lll_lock_wait to reflect reality in the futex syscall.
7463         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7464         (lll_mutex_cond_lock): Likewise.
7465
7466 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7467
7468         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7469         New function.
7470         (lll_mutex_cond_lock): Define.
7471
7472 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7473
7474         * Makefile (tests): Add tst-signal6.
7475         * tst-signal6.c: New file.
7476
7477         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7478         (__lll_mutex_unlock_force): New function
7479         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7480
7481         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7482         (__lll_mutex_unlock_force): New function.
7483         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7484
7485         * tst-rwlock7.c (do_test): Use correct format specifier.
7486
7487         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7488         Find break parameter in correct asm argument.
7489
7490 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7491
7492         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7493         Remove out4.
7494         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7495         error occured.
7496         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7497         Add __mutex.
7498         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7499         lll_futex_requeue, lll_mutex_unlock_force): Define.
7500
7501 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7502
7503         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7504         (pthread_cond_t): Add __mutex.
7505         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7506         lll_futex_requeue, lll_mutex_unlock_force): Define.
7507
7508 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7509
7510         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7511         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7512         Add __mutex field.
7513         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7514         Define.
7515         (lll_futex_wait, lll_futex_wake): Define.
7516         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7517         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7518         FUTEX_REQUEUE instead of FUTEX_WAIT.
7519         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7520         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7521         mutex which was used in condvar structure.  Call
7522         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7523         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7524
7525         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7526         include tcb-offsets.h.  Read wakeup value in locked region.
7527         Use the value of gbr register as THREAD_ID.
7528         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7529         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7530         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7531
7532         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7533         macros.
7534
7535 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7536
7537         * sysdeps/pthread/pthread_cond_broadcast.c
7538         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7539
7540 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7541
7542         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7543         typo in register name.
7544         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7545         correctly.  Actually use requeue.  Little optimization.
7546         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7547         mutex address early.  Handle cancellation state as 32-bit value.
7548         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7549         Remove unnecessary label.
7550
7551 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7552
7553         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7554         instead of FUTEX_WAIT.
7555         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7556         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7557         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7558         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7559         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7560         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7561         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7562         of __pthread_mutex_lock_internal.
7563         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7564         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7565         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7566         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7567         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7568         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7569         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7570         Add pthread_mutex_cond_lock.
7571         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7572         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7573         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7574         lll_mutex_cond_lock.
7575         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7576         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7577         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7578         Add __mutex field.
7579         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7580         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7581
7582         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7583         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7584
7585         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7586         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7587         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7588         macro don't define aliases.
7589
7590         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7591         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7592         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7593         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7594         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7595         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7596         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7597         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7598         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7599
7600 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7601
7602         * sem_open.c: Fix one endless loop.  Implement correct semantics
7603         wrt opening the same semaphore more then once.
7604         * sem_close.c: Adjust for sem_open change.
7605         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7606         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7607         * Makefile (tests): Add tst-sem7.
7608         * tst-sem7.c: New file.
7609
7610 2003-05-16  Roland McGrath  <roland@redhat.com>
7611
7612         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7613         uninitialized variable braino.
7614
7615 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7616
7617         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7618         test for syscall availability.
7619
7620         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7621         __no_posix_timers to -1 if the syscalls don't exist.
7622
7623         * pthread_join.c (pthread_join): Set tid field of the joined
7624         thread to -1.  This isn't necessary but helps to recognize some
7625         error conditions with almost no cost.
7626
7627         * allocatestack.c (FREE_P): Also negative values indicate an
7628         unused stack.
7629
7630         * unwind.c: Include <unistd.h>.
7631
7632 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7633
7634         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7635
7636 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7637
7638         * Makefile (crti-objs, crtn-objs): New variables.
7639         (omit-deps, extra-objs): Add crtn.
7640         ($(objpfx)libpthread.so): Depend on both crti and crtn
7641         and links to them in multidir.
7642         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7643
7644 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7645
7646         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7647         (lll_mutex_unlock): Use atomic_exchange_rel.
7648
7649 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7650
7651         * cond-perf.c (cons): Add missing locking around setting of alldone.
7652
7653 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7654
7655         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7656         related macros.
7657         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7658
7659 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7660
7661         * tst-sem6.c: New file.
7662         * Makefile (tests): Add tst-sem6.
7663
7664         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7665         Use atomic_exchange_rel instead of atomic_exchange.
7666         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7667         Likewise.
7668
7669         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7670         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7671         vsyscall is possible.
7672
7673         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7674         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7675         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7676         pthread_setaffinity_np.
7677         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7678         and pthread_setaffinity_np.
7679         * Makefile (libpthread-routines): Add pthread_getaffinity and
7680         pthread_setaffinity.
7681
7682         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7683         use it in case mmap to allocate the stack fails.
7684         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7685         ARCH_MAP_FLAGS here.
7686         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7687         ARCH_RETRY_MMAP.
7688
7689 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7690
7691         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7692         handler implementation.  It is now lockless in fork().
7693         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7694         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7695         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7696         declare the __fork_*_lists.
7697         (struct fork_handler): Include pointers to all three functions.
7698         Add next, refcntr and need_signal elements.
7699         (__fork_handlers): New declaration.
7700         (__register_atfork_malloc): Remove declaration.
7701         (HAVE_register_atfork_malloc): Remove definition.
7702         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7703         __pthread_child_handler variable.
7704         (__libc_pthread_init): Use __register_atfork instead of explicitly
7705         adding to the list.
7706         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7707         and lll_futex_wake.
7708         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7709
7710         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7711         function must never be reached.
7712
7713         * cond-perf.c: New file.
7714
7715 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7716
7717         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7718
7719 2003-05-04  Roland McGrath  <roland@redhat.com>
7720
7721         * Makefile ($(objpfx)../libc.so): New target.
7722
7723 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7724
7725         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7726         (pthread_condattr_t): Size is only an int, don't use long for
7727         alignment.
7728         (pthread_mutexattr_t): Likewise.
7729         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7730         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7731         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7732
7733 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7734
7735         * sysdeps/i386/tls.h: Define THREAD_ID.
7736         * sysdeps/ia64/tls.h: Likewise.
7737         * sysdeps/powerpc/tls.h: Likewise.
7738         * sysdeps/s390/tls.h: Likewise.
7739         * sysdeps/sh/tls.h: Likewise.
7740         * sysdeps/x86_64/tls.h: Likewise.
7741         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7742         record ownership.
7743         * pthread_mutex_timedlock.c: Likewise.
7744         * pthread_mutex_trylock.c: Likewise.
7745         * pthread_mutex_unlock.c: Likewise.
7746         * pthread_rwlock_trywrlock.c: Likewise.
7747         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7748         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7749         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7750         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7751
7752         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7753         flag.
7754
7755 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7756
7757         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7758         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7759         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7760         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7761         Make __align long long instead of long.
7762         (pthread_rwlock_t): Formatting.
7763         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7764         (pthread_rwlock_t): Formatting.
7765         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7766         (pthread_cond_t): Make __align long long instead of long.
7767         (pthread_rwlock_t): Move __flags field to the same position as in
7768         linuxthreads.
7769
7770 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7771
7772         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7773         * tst-rwlock7.c (do_test): Likewise.
7774
7775 2003-04-26  Roland McGrath  <roland@redhat.com>
7776
7777         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7778
7779 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7780
7781         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7782         sizeof (struct pthread).
7783         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7784         1 struct pthread.
7785         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7786         to 0.
7787         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7788         struct pthread.
7789         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7790         to 32-bit bytes.
7791         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7792         tcbp.
7793         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7794         unneccessarily.
7795         (NO_TLS_OFFSET): Define.
7796         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7797         add TLS_TCB_SIZE unnecessarily.
7798
7799 2003-04-22  Roland McGrath  <roland@redhat.com>
7800
7801         * Makeconfig (shared-thread-library): Reverse link order to work
7802         around linker bug.
7803
7804 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7805
7806         * semaphore.h: Fix typo in comment.
7807
7808 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7809
7810         * sysdeps/pthread/sigfillset.c: New file.
7811
7812         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7813         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7814         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7815         * sysdeps/pthread/sigaction.c: Likewise.
7816         * sysdeps/pthread/sigprocmask.c: New file.
7817         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7818         __SIGRTMIN+1.
7819         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7820         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7821         in this case.
7822
7823 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7824
7825         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7826         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7827
7828         * sysdeps/unix/sysv/linux/unregister-atfork.c
7829         (__unregister_atfork): Don't free memory not allocated dynamically.
7830
7831         * semaphore.h: Remove __THROW marker from cancellation points.
7832         * nptl/sysdeps/pthread/pthread.h: Likewise.
7833
7834 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7835
7836         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7837         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7838         __THROW.
7839
7840 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7841
7842         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7843
7844 2003-04-15  Roland McGrath  <roland@redhat.com>
7845
7846         * forward.c (__pthread_unwind): Tweak to avoid warning.
7847
7848 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7849
7850         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7851
7852 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7853
7854         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7855         overflow CFA advance instructions.
7856         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7857
7858 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7859
7860         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7861         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7862         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7863         defined.
7864
7865         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7866         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7867         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7868         DW_CFA_advance_loc for .Laddl-.Lsubl.
7869
7870 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7871
7872         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7873         position-independent unwind data for static libraries.
7874         Add missing unwind info.  Add comments.
7875
7876         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7877         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7878         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7879         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7880
7881 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7882
7883         * Makefile: Make sure all cancellation points are compiled with
7884         exception and asynchronous unwind tables.
7885
7886         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7887         which mishandles loading of global object addresses in PIC.
7888         (THREAD_SETMEM_NC): Likewise.
7889
7890 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7891
7892         * pthread.h: Define new data structure for cleanup buffer.  Declare
7893         new cleanup handler interfaces.
7894         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7895         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7896         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7897         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7898         it.  Declare old cleanup handler installation functions.
7899         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7900         handling.
7901         * cleanup_defer.c: Likewise.
7902         * cleanup_compat.c: New file.  Old cleanup code.
7903         * cleanup_def_compat.c: New file.  Old cleanup code.
7904         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7905         if own thread descriptor.
7906         * unwind.c: New file.
7907         * forward.c: Add __pthread_unwind.
7908         * init.c (pthread_functions): Add __pthread_unwind.
7909         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7910         Add ptr___pthread_unwind.
7911         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7912         and unwind function.
7913         * Makefile (libpthread-routines): Add cleanup_compat,
7914         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7915         table generation if necessary.
7916         * version.c: Record whether unwind support is compiled in.
7917         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7918         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7919         handler interfaces.
7920         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7921         complication to generate unwind information for syscall wrappers.
7922         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7923         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7924         __cleanup_fct_attribute.
7925
7926         * Makefile: Add rules to build and run tst-cleanup0.
7927         * tst-cleanup0.c: New file.
7928         * tst-cleanup0.expect: New file.
7929
7930         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7931         caller.  Optimize to avoid often unecessary local variable.
7932
7933 2003-04-11  Roland McGrath  <roland@redhat.com>
7934
7935         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7936         sets variable `multidir'; include that.
7937         (generated): Add it.
7938         ($(objpfx)$(multidir)/crti.o): New target.
7939         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7940
7941 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7942
7943         * tst-attr2.c (do_test): Add cast to avoid warning.
7944         * tst-mutex4.c (do_test): Likewise.
7945
7946 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7947
7948         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7949         in child.
7950
7951 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7952
7953         * Makefile (tests): Add tst-detach1.
7954         * tst-detach1.c: New file.
7955
7956 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7957
7958         * sysdeps/pthread/pthread.h: Remove duplicate
7959         pthread_cleanup_{push,pop} definitions.
7960
7961         * tst-barrier2.c: Eliminate warnings.
7962         * tst-cancel4.c: Likewise.
7963         * tst-cond4.c: Likewise.
7964         * tst-cond6.c: Likewise.
7965         * tst-detach1.c: Likewise.
7966         * tst-rwlock4.c: Likewise.
7967         * tst-rwlock6.c: Likewise.
7968         * tst-rwlock7.c: Likewise.
7969         * tst-sem3.c: Likewise.
7970         * tst-spin2.c: Likewise.
7971         * tst-umask1.c: Likewise.
7972
7973 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7974
7975         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7976
7977 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7978
7979         * descr.h (struct pthread): Move cancelhandling member to the front.
7980
7981 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7982
7983         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7984         malloc_parent, and malloc_child statically.
7985         (__register_atfork_malloc): New function.
7986         (free_mem): Don't free any of the malloc_* variables on the list.
7987         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7988         Define HAVE_register_atfork_malloc.
7989
7990 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7991
7992         * sysdeps/pthread/createthread.c (create_thread): Add some more
7993         comments explaining when to set multiple_threads and when not.
7994
7995         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7996         THREAD_ATOMIC_BIT_SET if not already defined.
7997         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7998         THREAD_ATOMIC_BIT_SET:
7999         * sysdeps/x86_64/tls.h: Likewise.
8000         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
8001         THREAD_ATOMIC_CMPXCHG_VAL.
8002         (_pthread_cleanup_pop_restore): Likewise.
8003         * cancellation.c (__pthread_enable_asynccancel): Likewise.
8004         (__pthread_enable_asynccancel_2): Likewise.
8005         (__pthread_disable_asynccancel): Likewise.
8006         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8007         (__libc_disable_asynccancel): Likewise.
8008         * init.c (sigcancel_handler): Likewise.
8009         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
8010         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
8011
8012 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
8013
8014         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
8015         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8016         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
8017         * Makefile (tests): Add tst-cancel11.
8018         * tst-cancel11.c: New file.
8019
8020 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
8021
8022         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
8023         round, not the first.  Use specific_used flag instead of local
8024         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
8025         (__free_tcb): Don't call deallocate_tsd here.
8026         (start_thread): Call deallocate_tsd here.
8027         * pthread_setspecific.c: Set specific_used flag really only when
8028         needed.
8029         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
8030         * tst-tsd3.c: New file.
8031         * tst-tsd4.c: New file.
8032
8033 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8034
8035         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
8036         Use atomic_exchange_and_add instead of __lll_add.
8037         (__lll_mutex_timedlock): Likewise.
8038         Patch by Ian Wienand.
8039
8040 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
8041
8042         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8043         (SINGLE_THREAD_P): Fix typo.
8044         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
8045
8046 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8047
8048         * Makefile (tests): Add tst-align.
8049         * tst-align.c: New file.
8050         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
8051
8052         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
8053         function correctly.
8054
8055         * tst-tsd2.c: Add casts to avoid warnings.
8056
8057 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
8058
8059         * descr.h (struct pthread): Move most often used elements to the front.
8060
8061 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
8062
8063         * Makefile (libpthread-routines): Add pthread_atfork.
8064         (libpthread-static-only-routines): Add pthread_atfork.
8065
8066 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8067
8068         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
8069         of TLS_DTV_AT_TP.
8070         (INSTALL_DTV): Add parens.
8071         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
8072         Use passed descr instead of THREAD_SELF.
8073         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
8074         (__lll_mutex_timedlock_wait): Correct expected value after
8075         spurious wakeup.
8076         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
8077         Release lock before waking up the waiters.
8078         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
8079         criteria.  Reorderstruct passed to cleanup handler.  Fix
8080         handling of cancellation and failung pthread_mutex_unlock call.
8081         Use __pthread_enable_asynccancel_2 instead of
8082         __pthread_enable_asynccancel.
8083         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8084         Return result of lock re-get if it fails.
8085         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
8086         for __pthread_cleanup_push.
8087         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
8088         completely broken rwlock implementation.
8089         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8090         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8091         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8092         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
8093         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8094         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
8095         versioned_symbol macro.
8096         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
8097         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8098
8099 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
8100
8101         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
8102         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
8103         and __helper_tid.
8104         (struct timer): Remove th and bar field.
8105         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
8106         debugging code.  Create only one helper thread.
8107         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
8108         helper thread.
8109         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8110         Renamed.  Define statically.  Use thread info from siginfo.
8111         (__helper_once): New variable.
8112         (__helper_tid): New variable.
8113         (__reset_helper_control): New function.
8114         (__start_helper_thread): New function.
8115
8116         * pthread_create.c (start_thread): Don't use setjmp inside
8117         __builtin_expect to work around gcc bug.
8118
8119         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
8120         timer_delete syscall fails, but not with ENOSYS, set
8121         __no_posix_timers.
8122
8123         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
8124         (timer_settime): Fix typo.
8125         * sysdeps/unix/sysv/linux/timer_getoverr.c
8126         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
8127
8128 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
8129
8130         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
8131         offset of cleanupbuf.__prev.
8132
8133 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8134
8135         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8136         of included file.
8137
8138 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8139
8140         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8141         NULL provide default definition to syscall.
8142
8143 2003-03-25  Roland McGrath  <roland@redhat.com>
8144
8145         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8146         (timer_id2ptr): Fix typo.
8147
8148 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8149
8150         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8151         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8152         * sysdeps/ia64/pthreaddef.h: Likewise.
8153         * sysdeps/powerpc/pthreaddef.h: Likewise.
8154         * sysdeps/s390/pthreaddef.h: Likewise.
8155         * sysdeps/sh/pthreaddef.h: Likewise.
8156         * sysdeps/x86_64/pthreaddef.h: Likewise.
8157         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8158         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8159         being changed.
8160         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8161         SIGTIMER is not unblocked.
8162         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8163         RT signal taken.
8164         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8165         be send.
8166         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8167         pass pointer through as ID.
8168         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8169         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8170         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8171         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8172         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8173         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8174         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8175         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8176         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8177         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8178         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8179         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8180         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8181         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8182         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8183         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8184         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8185         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8186         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8187         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8188         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8189         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8190         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8191         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8192         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8193         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8194         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8195         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8196         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8197         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8198         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8199         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8200         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8201
8202         * pthreadP.h: Remove FRAME_LEFT definition.
8203         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8204         already left frame.  Programs which have this problem are not POSIX
8205         compliant.
8206         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8207
8208 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8209
8210         * sysdeps/pthread/tst-timer.c: Check return values of the
8211         functions we test.
8212
8213 2003-03-23  Roland McGrath  <roland@redhat.com>
8214
8215         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8216         * tst-tls3mod.c: Likewise.
8217         * tst-tls1.c: Likewise.
8218         * tst-tls2.c: Likewise.
8219
8220         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8221         undefined behavior.
8222
8223         * tst-join5.c (tf1, tf2): Add a cast.
8224
8225         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8226
8227         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8228         Don't test anything.
8229         * tst-cond4.c: Likewise.
8230         * tst-cond6.c: Likewise.
8231         * tst-flock2.c: Likewise.
8232         * tst-mutex4.c: Likewise.
8233         * tst-rwlock4.c: Likewise.
8234         * tst-signal1.c: Likewise.
8235         * tst-spin2.c: Likewise.
8236         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8237
8238         * tst-mutex4.c: Use test-skeleton.c.
8239         * tst-spin2.c: Likewise.
8240         * tst-sysconf.c: Likewise.
8241         * tst-barrier2.c: Likewise.
8242         * tst-cond4.c: Likewise.
8243         * tst-cond6.c: Likewise.
8244         * tst-rwlock4.c: Likewise.
8245         * tst-unload.c: Likewise.
8246         * tst-flock2.c (do_test): Use return instead of exit.
8247
8248 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8249
8250         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8251
8252 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8253
8254         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8255         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8256         instead of __lll_compare_and_swap.
8257         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8258         Likewise.
8259         Removed definition if __lll_compare_and_swap.
8260
8261         * cancellation.c: Adjust for new form of compare&exchange macros.
8262         * cleanup_defer.c: Likewise.
8263         * init.c: Likewise.
8264         * libc-cancellation.c: Likewise.
8265         * old_pthread_cond_broadcast.c: Likewise.
8266         * old_pthread_cond_signal.c: Likewise.
8267         * old_pthread_cond_timedwait.c: Likewise.
8268         * old_pthread_cond_wait.c: Likewise.
8269         * pthread_cancel.c: Likewise.
8270         * pthread_create.c: Likewise.
8271         * pthread_detach.c: Likewise.
8272         * pthread_join.c: Likewise.
8273         * pthread_key_delete.c: Likewise.
8274         * pthread_setcancelstate.c: Likewise.
8275         * pthread_setcanceltype.c: Likewise.
8276         * pthread_timedjoin.c: Likewise.
8277         * pthread_tryjoin.c: Likewise.
8278         * sysdeps/pthread/createthread.c: Likewise.
8279
8280 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8281
8282         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8283         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8284         definitions.  Replace uses with calls to atomic_* functions.
8285         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8286         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8287         __lll_test_and_set calls with atomic_exchange_and_add and
8288         atomic_exchange calls respectively.
8289         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8290         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8291         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8292         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8293         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8294         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8295         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8296
8297         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8298         returns the old value.
8299
8300 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8301
8302         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8303         int for variable OLDVAL and correct inline assembler contraint.
8304         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8305         type int for variable OLD.
8306
8307         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8308         only for s390-32.
8309         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8310         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8311         instead of multiple_threads field in the TCB.
8312
8313 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8314
8315         * sysdeps/i386/i686/bits/atomic.h: Removed.
8316         * sysdeps/i386/i586/bits/atomic.h: Removed.
8317         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8318         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8319         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8320         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8321         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8322         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8323         * atomic.h: Removed.  Moved to glibc.
8324
8325         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8326         support for clock selection.
8327
8328         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8329         signalling waiters.
8330
8331 2003-03-18  Roland McGrath  <roland@redhat.com>
8332
8333         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8334         Add __lll_rel_instr first.  Add memory clobber.
8335         (lll_mutex_unlock): Use __lll_test_and_set.
8336         From Paul Mackerras <paulus@samba.org>.
8337
8338         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8339         unconditionally.
8340         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8341         (SINGLE_THREAD_P):  Add `header.' prefix.
8342         From Paul Mackerras <paulus@samba.org>.
8343
8344         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8345         pthread_timedjoin_np to ...
8346         (libpthread: GLIBC_2.3.3): ... here.
8347         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8348
8349         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8350         Avoid shadowing VAL variable.
8351
8352         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8353         New macro.
8354
8355 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8356
8357         * Makefile (tests): Add tst-cond11.
8358         * tst-cond11.c: New file.
8359
8360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8361         struct passed to cleanup handler to eliminate one more
8362         instruction.
8363         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8364
8365         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8366         (pthrad_cond_t): Replace __unused field with __clock.
8367
8368         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8369         waken all waiters in cleanup handler.
8370         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8371         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8372
8373         * pthread_condattr_getclock.c: New file.
8374         * pthread_condattr_setclock.c: New file.
8375         * sysdeps/pthread/pthread.h: Declare these new functions.
8376         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8377         * Makefile (libpthread-routines): Add the new functions.
8378         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8379         Renamed field to value.  Document use of the bits.
8380         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8381         change.
8382         * pthread_condattr_setpshared.c: Likewise.
8383         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8384         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8385         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8386         Add __clock field.
8387         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8388         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8389         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8390         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8391         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8392         Implement clock selection.
8393         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8394         * pthread-errnos.sym: Add ENOSYS.
8395         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8396         _POSIX_CLOCK_SELECTION.
8397         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8398
8399         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8400         invalid .size directive.
8401
8402 2003-03-17  Roland McGrath  <roland@redhat.com>
8403
8404         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8405         Formatting tweaks.
8406
8407 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8408
8409         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8410         Use __lll_add instead of spelling it out.  Use protected symbol names.
8411         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8412         Use __lll_add.
8413         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8414         Renamed from lll_compare_and_swap.  Use new name where necessary.
8415         (__lll_add): Defined.
8416         (__lll_dec_if_positive): Defined.
8417         (__lll_test_and_set): Defined.
8418         * sysdeps/ia64/pthread_spin_init.c: Removed.
8419         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8420         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8421         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8422         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8423         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8424         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8425         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8426         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8427         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8428         __sync_lock_release_si.
8429         Patch by Jakub Jelinek.
8430
8431         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8432         Fix timeout handling.
8433         (__lll_timedwait_tid): Likewise.
8434         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8435         Patch by Jakub Jelinek.
8436
8437         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8438
8439 2003-03-17  Roland McGrath  <roland@redhat.com>
8440
8441         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8442         * sysdeps/pthread/pthread_spin_init.c: New file.
8443         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8444         * sysdeps/powerpc/Makefile: New file.
8445         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8446         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8447         * sysdeps/powerpc/pthreaddef.h: New file.
8448         * sysdeps/powerpc/tcb-offsets.sym: New file.
8449         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8450         * sysdeps/powerpc/tls.h: New file.
8451         * sysdeps/powerpc/bits/atomic.h: New file.
8452         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8453         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8454         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8455
8456         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8457         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8458         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8459         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8460         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8461         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8462         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8463         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8464         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8465         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8466         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8467         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8468         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8469         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8470         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8471
8472         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8473         not gettimeofday.
8474         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8475         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8476         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8477         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8478         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8479
8480 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8481
8482         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8483         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8484         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8485         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8486         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8487
8488 2003-03-16  Roland McGrath  <roland@redhat.com>
8489
8490         * tst-fork4.c: Include <string.h>.
8491         * tst-signal2.c: Likewise.
8492         * tst-mutex5.c (do_test): exit -> return.
8493         * tst-mutex2.c: Include <stdlib.h>.
8494
8495 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8496
8497         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8498         (__lll_mutex_timedlock_wait): Correct expected value after
8499         spurious wakeup.  Otherwise we would never wait again.
8500
8501         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8502         zone versus inline asm stupidity.  Use correct instructions.
8503
8504         * tst-rwlock6.c: Add some more status output.
8505
8506 2003-03-15  Roland McGrath  <roland@redhat.com>
8507
8508         * sysdeps/pthread/configure.in: New file.
8509         * sysdeps/pthread/configure: New file (generated).
8510
8511 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8512
8513         * allocatestack.c (allocate_stack): Store the exact stack size of
8514         user allocated stacks.
8515
8516 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8517
8518         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8519         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8520         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8521         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8522         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8523         Use `header.' prefix.
8524         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8525
8526 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8527
8528         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8529         __builtin_frame_address, use stack pointer.
8530
8531         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8532         instead of __builtin_frame_pointer.
8533
8534 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8535
8536         * tst-basic1.c (do_test): Add cast to avoid warning.
8537         * tst-basic2.c (do_test): Likewise.
8538
8539         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8540         amount of stack correction.
8541
8542         * tst-fork4.c: Use test-skeleton.c.
8543
8544 2003-03-14  Roland McGrath  <roland@redhat.com>
8545
8546         * init.c: Fix typo "#eli" for "#else".
8547
8548 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8549
8550         * allocatestack.c (__stack_user): Use hidden_data_def.
8551         * pthread_create.c (__pthread_keys): Likewise.
8552
8553         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8554
8555 2003-03-14  Roland McGrath  <roland@redhat.com>
8556
8557         * tst-fork4.c: New file.
8558         * Makefile (tests): Add it.
8559
8560         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8561         we always define the padding space.
8562         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8563         stopped supporting its own extensions fully.
8564         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8565         struct also called `header', so `header.multiple_threads' is the field
8566         name to use on all machines.
8567         * allocatestack.c (allocate_stack): Use `header.' prefix.
8568         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8569         * pthread_create.c (__pthread_create_2_1): Likewise.
8570         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8571         (THREAD_SELF): Likewise.
8572         * sysdeps/x86_64/tls.h: Likewise.
8573         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8574         (SINGLE_THREAD_P): Likewise.
8575         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8576         (SINGLE_THREAD_P): Likewise.
8577         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8578         (SINGLE_THREAD_P): Likewise.
8579
8580         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8581         value directly.
8582
8583 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8584
8585         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8586         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8587
8588         * pthread_create.c (start_thread): setjmp is expected to return 0.
8589
8590         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8591         (THREAD_GETMEM_NC): Likewise.
8592
8593 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8594
8595         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8596         and the size of the stack which must be allocated is a multiple,
8597         allocate one more page.
8598         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8599         MULTI_PAGE_ALIASING.
8600
8601 2003-03-13  Roland McGrath  <roland@redhat.com>
8602
8603         * pthread_create.c (start_thread): Set EXITING_BIT after the
8604         event-reporting (and destructors), not before.
8605
8606 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8607
8608         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8609         lll_futex_wake): Declare register variables as long int instead of
8610         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8611         Make syscall arguments clobbered by the syscall.
8612         (lll_futex_wait): Define using lll_futex_timed_wait.
8613
8614         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8615         to void *.
8616
8617         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8618         PPID if [! NDEBUG].
8619
8620         * allocatestack.c (nptl_ncreated): Only declare if
8621         COLORING_INCREMENT != 0.
8622
8623         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8624         (__libc_enable_asynccancel_2): Remove prototype.
8625
8626         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8627         ctid to match kernel.
8628
8629 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8630
8631         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8632         libc_multiple_threads.
8633         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8634         __libc_multiple_threads to...
8635         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8636
8637         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8638         versioning.
8639         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8640         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8641
8642         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8643         (__pthread_once_internal): Define.
8644
8645         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8646         macros instead of .symver directly.
8647         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8648         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8649
8650         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8651         * sysdeps/x86_64/tcb-offsets.sym: New file.
8652         * sysdeps/x86_64/Makefile: New file.
8653
8654         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8655         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8656         to access own pthread_t in TCB.
8657         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8658         Likewise.
8659         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8660         Likewise.
8661         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8662
8663 2003-03-12  Roland McGrath  <roland@redhat.com>
8664
8665         * pthread-errnos.sym: New file.
8666         * Makefile (gen-as-const-headers): New variable, list that file.
8667         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8668         header <pthread-errnos.h> instead of defining errno values here.
8669         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8670         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8671         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8672         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8673         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8674         Likewise.
8675         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8676         Likewise.
8677         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8678         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8679         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8680         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8681         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8682         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8683         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8684         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8685         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8686         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8687         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8688         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8689         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8690         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8691         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8692         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8693         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8694         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8695         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8696         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8697         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8698         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8699         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8700         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8701         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8702         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8703         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8704
8705         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8706         CLONE_CHILD_SETTID worked.
8707
8708 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8709
8710         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8711         file.
8712         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8713         file.
8714
8715         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8716         (pthread_cond_t): Add padding.
8717
8718         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8719         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8720         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8721
8722         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8723         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8724         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8725         (__pthread_rwlock_timedrdlock): Likewise.
8726         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8727         (__pthread_rwlock_wrlock): Likewise.
8728         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8729         (__pthread_rwlock_rdlock): Likewise.
8730
8731         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8732
8733         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8734         result of lock re-get if it fails.
8735
8736 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8737
8738         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8739         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8740         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8741         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8742         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8743         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8744         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8745         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8746         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8747         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8748
8749         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8750         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8751
8752         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8753         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8754         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8755         (create_thread): Likewise.
8756         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8757         * init.c (__pthread_initialize_minimal_internal): Initialize
8758         __libc_multiple_threads_ptr if necessary.
8759         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8760         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8761         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8762         __libc_multiple_threads.
8763         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8764         necessary.
8765
8766         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8767         (THREAD_SETMEM_NC): Likewise.
8768
8769         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8770         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8771         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8772         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8773
8774         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8775         Eliminate one entire instruction.
8776
8777         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8778         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8779         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8780         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8781         instead of __pthread_enable_asynccancel.
8782         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8783         (__pthread_cond_wait): Likewise.
8784         * sysdeps/pthread/pthread_cond_timedwait.c
8785         (__pthread_cond_timedwait): Likewise.
8786         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8787
8788         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8789         (__condvar_cleanup): Wake up all waiters in case we got signaled
8790         after being woken up but before disabling asynchronous
8791         cancellation.
8792         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8793         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8794         (__condvar_cleanup): Likewise.
8795
8796         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8797         Make it an error if architecture has no #if case.  Add x86-64.
8798
8799         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8800         pt-initfini.s generation.
8801
8802         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8803         (TLS_INIT_TP): Fix typo.
8804
8805 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8806
8807         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8808         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8809
8810         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8811         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8812         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8813         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8814         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8815         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8816         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8817         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8818
8819 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8820
8821         * sysdeps/pthread/pthread_cond_timedwait.c
8822         (__pthread_cond_timedwait): Return the result of the final
8823         locking.  If it succeeds, the regular function return value.
8824
8825         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8826         Return result of the final locking.
8827         * version.c (__nptl_main): Work around problems with the strange
8828         INTERNAL_SYSCALL macro on ppc32.
8829         * init.c (__pthread_initialize_minimal_internal): Unblock
8830         SIGCANCEL in case the parent blocked it.
8831         Reported by Paul Mackerras <paulus@samba.org>.
8832
8833         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8834         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8835         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8836
8837 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8838
8839         * sysdeps/pthread/pthread_cond_timedwait.c
8840         (__pthread_cond_timedwait): Unlock and fail if
8841         __pthread_mutex_unlock_internal failed.
8842
8843         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8844         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8845         Use ARCH_CLONE.
8846         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8847         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8848         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8849         ALLOCATE_STACK): New macros.
8850         (TLS_TPADJ): New macro.
8851         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8852         (allocate_stack): Handle TLS_DTV_AT_TP and
8853         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8854         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8855         Don't set PD->self.
8856         * init.c [__ia64__] (__NR_set_tid_address): Define.
8857
8858         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8859         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8860         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8861         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8862         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8863         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8864         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8865         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8866         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8867         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8868         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8869         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8870         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8871         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8872         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8873         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8874         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8875         * sysdeps/ia64/bits/atomic.h: New file.
8876         * sysdeps/ia64/Makefile: New file.
8877         * sysdeps/ia64/pthread_spin_init.c: New file.
8878         * sysdeps/ia64/pthread_spin_lock.c: New file.
8879         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8880         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8881         * sysdeps/ia64/pthreaddef.h: New file.
8882         * sysdeps/ia64/tcb-offsets.sym: New file.
8883         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8884         * sysdeps/ia64/tls.h: New file.
8885
8886         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8887         to syscall instead of no arguments.
8888
8889 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8890
8891         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8892         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8893         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8894         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8895
8896         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8897         unused code.
8898
8899         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8900
8901         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8902         lowlevelbarrier.sym.
8903         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8904         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8905         Include lowlevelbarrier.h and don't define offsets locally.
8906         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8907
8908         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8909         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8910         (__lll_mutex_timedlock_wait): Likewise.
8911         (lll_mutex_lock): Adjust asm for that.
8912         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8913         (lll_lock): Adjust asm for operand order change.
8914         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8915         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8916
8917         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8918         Reverse order of parameters.
8919         (__lll_timedwait_tid): Remove regparms attribute.
8920         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8921         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8922
8923         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8924         (__lll_timedwait_tid): Remove one unnecessary instruction.
8925
8926         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8927         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8928         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8929         lowlevelmutex.S.
8930
8931         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8932         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8933         for NOT_IN_libc.
8934         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8935         lowlevellock.S.
8936
8937         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8938         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8939         for libc.so.
8940         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8941         define LOCK here (if UP is not defined).  The actual code is in
8942         lowlevelmutex.S.
8943
8944         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8945         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8946         __lll_timedwait_tid for libc.so.
8947         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8948         define LOCK here (if UP is not defined).  The actual code is in
8949         lowlevellock.S.
8950
8951         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8952         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8953         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8954         instead of lowlevelsem.h.
8955         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8956         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8957         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8958
8959         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8960         lowlevelrwlock.sym.
8961         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8962         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8963         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8964
8965         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8966         register loading.
8967         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8968         last changed.  D'oh.
8969
8970         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8971
8972         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8973         of __libc_locking_needed.
8974         (lll_trylock): Initialize %eax to zero.
8975
8976         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8977         pthread_cond_t definition.
8978
8979 2003-03-10  Roland McGrath  <roland@redhat.com>
8980
8981         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8982         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8983         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8984         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8985         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8986
8987         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8988         Instead of setting PD->multiple_threads, set globals
8989         __pthread_multiple_threads and __libc_multiple_threads.
8990         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8991         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8992         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8993
8994         * descr.h (struct pthread): Conditionalize first member on
8995         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8996         containing an anonymous tcbhead_t.  Move `list' member out.
8997         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8998         * allocatestack.c: Remove use of `header.data.' prefix.
8999         * pthread_create.c: Likewise.
9000         * init.c (__pthread_initialize_minimal_internal): Likewise.
9001         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9002         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
9003         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
9004         * sysdeps/x86_64/tls.h: Likewise.
9005         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
9006         (SINGLE_THREAD_P): Likewise.
9007         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
9008         (SINGLE_THREAD_P): Likewise.
9009         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
9010         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
9011
9012 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
9013
9014         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
9015
9016         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
9017         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9018
9019         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
9020         leftovers from the ia32 code.
9021
9022         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
9023         memory load.
9024         (clear_once_control): Don't load %esi.
9025
9026         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
9027         handling.
9028
9029         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9030
9031         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
9032         * sysdeps/unix/sysv/linux/createthread.c: ...here.
9033
9034         * Makefile (tests): Add tst-cond10.
9035         * tst-cond10.c: New file.
9036
9037 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
9038
9039         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
9040         * tst-signal3.c (do_test): Likewise.
9041         * tst-sem5.c (do_test): Likewise.
9042         * tst-kill6.c (do_test): Likewise.
9043         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
9044
9045         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
9046         of inc/dec.
9047         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9048         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
9049         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
9050         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
9051         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9052         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9053         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9054         Likewise.
9055         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9056         Likewise.
9057         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9058         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9059         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9060         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9062         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9063         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9064         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9065
9066         * allocatestack.c (allocate_stack): If mprotect() fails free the
9067         TLS memory.
9068
9069 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
9070
9071         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
9072
9073         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
9074         lll_wake_tid.  This was used only to work around kernel limits in
9075         the early days.
9076         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
9077         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
9078         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9079         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
9080
9081         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
9082         (__pthread_initialize_minimal_internal): Change initialization of
9083         __static_tls_align_m1 appropriately.
9084         * pthreadP.h (__static_tls_align_m1): Renamed from
9085         __static_tls_align.
9086         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
9087         instead of __static_tls_align-1.
9088
9089 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
9090
9091         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
9092
9093         * pthread_create.c: Define __pthread_keys using nocommon
9094         attribute, not by placing it explicitly in bss.
9095         Remove DEFINE_DEALLOC definition.  Not needed anymore.
9096
9097         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
9098         Use it in mmap call to allocate stacks.
9099
9100         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
9101
9102         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
9103         result of the thread function.
9104
9105 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
9106
9107         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
9108         version is just fine.
9109
9110         * sysdeps/unix/sysv/linux/libc_pthread_init.c
9111         (__pthread_child_handler): Renamed from pthread_child_handler,
9112         exported, and marked hidden.  Change all users.
9113         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
9114         free __pthread_child_handler from child list.
9115
9116 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9117
9118         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
9119
9120         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9121         Fix handling of cancellation and failing pthread_mutex_unlock call.
9122         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9123         (__pthread_cond_wait): Likewise.
9124
9125         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
9126         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
9127         lll_futex_timed_wait call.
9128         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
9129         (pthread_rwlock_timedwrlock): Likewise.
9130
9131         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
9132         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
9133         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9134
9135         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9136         check of lll_futex_wake return value.
9137
9138 2003-03-03  Roland McGrath  <roland@redhat.com>
9139
9140         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9141
9142         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9143         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9144         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9145
9146 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9147
9148         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9149         error for CPU clocks.
9150
9151         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9152         _POSIX_MONOTONIC_CLOCK.
9153         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9154
9155         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9156         recent kernels.
9157
9158 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9159
9160         * descr.h (struct pthread): Move cleanup field to the front.
9161
9162 2003-03-01  Roland McGrath  <roland@redhat.com>
9163
9164         * sem_open.c (sem_open): Braino fix.
9165
9166 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9167
9168         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9169         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9170         __pthread_cleanup_pop functionality.
9171         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9172
9173         * descr.h (struct pthread): Move tid field to the front now that
9174         it is often used.
9175
9176         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9177         (__lll_mutex_timedlock_wait): Remove.
9178         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9179         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9180         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9181         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9182         (lll_unlock_wake_cb): Don't save and restore %esi.
9183         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9184         %esi.
9185         (__lll_timedwait_tid): Add alignment.
9186         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9187         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9188         %esi.
9189         (__lll_timedwait_tid): Removed.
9190         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9191         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9192         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9193         (pthread_barrier_wait): Don't save, load, and restore %esi for
9194         last thread.
9195         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9196         (__pthread_cond_signal): Don't save, load, and restore %esi.
9197         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9198         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9199         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9200         Don't save, load, and restore %esi.
9201
9202 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9203
9204         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9205         Release lock before waking up the waiters.
9206
9207         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9208
9209         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9210         (reader_thread): Likewise.
9211
9212         * sysdeps/pthread/pthread_rwlock_unlock.c
9213         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9214         to wake up readers if there are none.
9215
9216         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9217         Release internal lock before wake threads.
9218
9219 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9220
9221         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9222         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9223         predefined.
9224         * tst-rwlock9.c: Likewise.
9225         * tst-rwlock10.c: New file.
9226         * tst-rwlock11.c: New file.
9227
9228         * Makefile (tests): Add tst-dlsym1.
9229         * tst-dlsym1.c: New file.
9230
9231         * init.c (__pthread_initialize_minimal_internal): Set
9232         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9233         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9234
9235 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9236
9237         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9238
9239         * tst-cond2.c: Fix sychronization with child.
9240
9241         * tst-rwlock8.c (reader_thread): Remove unused variable.
9242
9243         * Makefile: Add rules to build and run tst-tls3.
9244         * tst-tls3.c: New file.
9245         * tst-tls3mod.c: New file.
9246
9247         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9248         * tst-rwlock8.c: New file.
9249         * tst-rwlock9.c: New file.
9250         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9251         complete broken rwlock implementation.
9252         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9253         Likewise.
9254         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9255         Likewise.
9256         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9257         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9258         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9259         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9260         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9261         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9262         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9263
9264 2003-02-23  Roland McGrath  <roland@redhat.com>
9265
9266         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9267
9268 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9269
9270         * Makefile (tests): Add tst-context1.
9271         * tst-context1.c: New file.
9272
9273         * Makefile (tests): Add tst-tls1 and tst-tls2.
9274         * tst-tls1.c: New file.
9275         * tst-tls2.c: New file.
9276
9277         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9278         for failed cmpxchg.
9279
9280         * pthread_create.c (start_thread): Set EXITING_BIT early.
9281
9282         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9283         (THREAD_GETMEM_NC): Likewise.
9284
9285 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9286
9287         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9288         off 3 more bytes by using offset-less instructions when possible.
9289
9290         * Makefile: Add dependency for $(objpfx)version.d.
9291
9292         * eintr.c (eintr_source): Add unnecessary return but the compiler
9293         insists.
9294
9295         * tst-kill3.c: Include <unistd.h>.
9296
9297 2003-02-21  Roland McGrath  <roland@redhat.com>
9298
9299         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9300
9301 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9302
9303         * Makefile (tests): Add tst-eintr1.
9304         (distribute): Add eintr.c.
9305         * tst-eintr1.c: New file.
9306         * eintr.c: New file.
9307
9308         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9309
9310         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9311         Disallow sending SIGCANCEL.
9312
9313         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9314         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9315         * tst-kill1.c: New file.
9316         * tst-kill2.c: New file.
9317         * tst-kill3.c: New file.
9318         * tst-kill5.c: New file.
9319         * tst-kill6.c: New file.
9320         * tst-basic7.c: Renamed to...
9321         * tst-kill4.c: ...this.
9322
9323 2003-02-21  Roland McGrath  <roland@redhat.com>
9324
9325         * Makefile (install-lib-ldscripts): New variable.
9326
9327 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9328
9329         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9330         * pthread_cancel.c: Use INVALID_TD_P.
9331         * pthread_detach.c: Likewise.
9332         * pthread_getschedparam.c: Likewise.
9333         * pthread_setschedparam.c: Likewise.
9334         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9335         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9336         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9337         * pthread_timedjoin.c: Likewise.
9338
9339         * tst-basic7.c: Include <signal.h>.
9340
9341         * pthread_join.c (pthread_join): Limited checking for invalid
9342         descriptors.
9343         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9344
9345 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9346
9347         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9348         beginning of the loop.  Clear the entire first block of TSD.
9349         * Makefile (tests): Add tst-key4.
9350         * tst-key4.c: New file.
9351
9352 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9353
9354         * Makefile (tests): Add tst-basic7.
9355         * tst-basic7.c: New file.
9356
9357         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9358         Add some more __builtin_expect.
9359
9360         * pthreadP.h: Define dummy version of DEBUGGING_P.
9361
9362 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9363
9364         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9365         _POSIX_THREAD_PRIORITY_SCHEDULING.
9366         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9367         _XOPEN_REALTIME_THREADS.
9368         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9369
9370         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9371         kernel returns EINVAL for PID <= 0, work around it.
9372
9373         * Makefile (tests): Add tst-signal5.
9374         * tst-signal5.c: New file.
9375
9376         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9377         and LOGIN_NAME_MAX.
9378
9379         * tst-cancel1.c (tf): Block all signals.
9380
9381         * Makefile (tests): Add tst-basic6.
9382         * tst-basic6.c: New file.
9383
9384         * tst-basic1.c: Add test for process ID.
9385
9386         * Makefile (tests): Add tst-cancel10.
9387         * tst-cancel10.c: New file.
9388
9389         * Makefile (tests): Add tst-signal4.
9390         * tst-signal4.c: New file.
9391
9392         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9393         __sigismember instead of sigismember.  Add __builtin_expect.
9394
9395 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9396
9397         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9398         pthread_setcancelstate, and pthread_rwlock_setpshared.
9399
9400         * tst-cancel7.c (do_test): Make sure the pid file exists before
9401         canceling the thread.
9402
9403         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9404         pthread_rwlock_timedrdlock tests.
9405         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9406         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9407         Check for invalid tv_nsec field.
9408         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9409         Likewise.
9410
9411         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9412         recursive mutex of overflow.
9413
9414         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9415
9416         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9417         going into an endless loop.
9418         * Makefile (tests): Add tst-cancel9.
9419         * tst-cancel9.c: New file.
9420
9421         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9422
9423 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9424
9425         * tst-mutex5.c (do_test): Add more timedlock tests.
9426
9427         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9428         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9429
9430         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9431         use INLINE_SYSCALL.  Error number is returned, not -1.
9432
9433         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9434         and __deallocate_stack with internal_function.
9435         * pthread_create.c: Adjust definitions appropriately.
9436         * allocatestack.c: Likewise.
9437
9438         * pthread_join.c: Add one more __builtin_expect.
9439         * pthread_timedjoin.c: Likewise.
9440
9441         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9442         not data of sequence number does not match.
9443         Add one __builtin_expect.
9444
9445         * Makefile (tests): Add tst-clock1.
9446         * tst-clock1.c: New file.
9447
9448         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9449         negative arguments.
9450         * Makefile (tests): Add tst-basic5.
9451         * tst-basic5.c: New file.
9452
9453 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9454
9455         * Makefile (tests): Add tst-basic4.
9456         * tst-basic4.c: New file.
9457
9458         * pthreadP.h: Add declaraction for __nptl_nthreads.
9459         * pthread_create.c: Define __nptl_nthreads
9460         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9461         after thread is done.  If then zero, call exit(0).
9462         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9463         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9464         * init.c (pthread_functions): Initialize ptr_nthreads.
9465         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9466         (__reclaim_stacks): Decrement __nptl_nthreads.
9467         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9468         Define.
9469         * Makefile (tests): Add tst-basic3.
9470         * tst-basic3.c: New file.
9471
9472         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9473         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9474         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9475         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9476         if asynchronous canceling is enabled.
9477         * pthread_join.c (pthread_join): When recognizing circular joins,
9478         take into account the other thread might be already canceled.
9479         * Makefile (tests): Add tst-join5.
9480         * tst-join5.c: New file.
9481
9482         * Makefile (tests): Add tst-join4.
9483         * tst-join4.c: New file.
9484
9485 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9486
9487         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9488
9489 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9490
9491         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9492         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9493         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9494         warning.
9495         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9496         to avoid warning.
9497         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9498         error if lll_futex_wake failed.
9499
9500 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9501
9502         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9503         handling of cancellation and failung pthread_mutex_unlock call.
9504         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9505         * Makefile (tests): Add tst-cond8 and tst-cond9.
9506         * tst-cond8.c: New file.
9507         * tst-cond9.c: New file.
9508
9509         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9510
9511         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9512         non-standard initializers with __USE_GNU.
9513
9514         * Makefile (tests): Add tst-cleanup3.
9515         * tst-cleanup3.c: New file.
9516
9517 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9518
9519         * Makefile (tests): Add tst-attr1 and tst-attr2.
9520         * tst-attr1.c: New file.
9521         * tst-attr2.c: New file.
9522
9523         * Makefile: Add rules to build and run tst-atfork2 test.
9524         * tst-atfork2.c: New file.
9525         * tst-atfork2mod.c: New file.
9526
9527         * sysdeps/unix/sysv/linux/unregister-atfork.c
9528         (__unregister_atfork): Free the memory allocated for the handlers
9529         after removing them from the lists.
9530
9531         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9532         cleanup function.
9533
9534         * tst-atfork1.c (do_test): Wait for the child we forked.
9535         Report error in child.
9536
9537         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9538
9539         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9540
9541 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9542
9543         * Makefile (tests): Add tst-cancel8.
9544         * tst-cancel8.c: New file.
9545
9546         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9547         clearing of control variable.
9548         * Makefile (tests): Add tst-once3 and tst-once4.
9549         * tst-once3.c: New file.
9550         * tst-once4.c: New file.
9551
9552 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9553
9554         * sysdeps/sh/Makefile: New file.
9555         * sysdeps/sh/bits/atomic.h: New file.
9556         * sysdeps/sh/pthread_spin_init.c: New file.
9557         * sysdeps/sh/pthread_spin_lock.c: New file.
9558         * sysdeps/sh/pthread_spin_trylock.S: New file.
9559         * sysdeps/sh/pthread_spin_unlock.S: New file.
9560         * sysdeps/sh/pthreaddef.h: New file.
9561         * sysdeps/sh/tcb-offsets.sym: New file.
9562         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9563         * sysdeps/sh/tls.h: New file.
9564         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9565         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9566         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9567         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9568         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9569         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9570         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9571         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9572         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9573         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9574         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9575         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9576         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9577         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9578         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9579         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9580         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9581         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9582         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9583         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9584         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9585         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9586         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9587         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9588         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9589         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9590         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9591         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9592         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9593         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9594
9595 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9596
9597         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9598         according to POSIX.
9599
9600         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9601
9602 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9603
9604         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9605         (TLS_GET_FS): New #define.
9606         (TLS_SET_FS): New #define.
9607         Correct value of __NR_set_thread_area.
9608
9609         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9610
9611 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9612
9613         * Makefile (tests): Add tst-popen1.
9614         * tst-popen1.c: New file.
9615
9616         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9617         but inactive generalization.
9618         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9619         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9620         Minor optimization, remove one instruction.
9621         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9622
9623 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9624
9625         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9626
9627 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9628
9629         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9630         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9631         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9632         * sysdeps/pthread/pthread_cond_signal.c: New file.
9633         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9634         * sysdeps/pthread/pthread_cond_wait.c: New file.
9635         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9636         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9637         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9638         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9639         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9640         * sysdeps/s390/Makefile: New file.
9641         * sysdeps/s390/bits/atomic.h: New file.
9642         * sysdeps/s390/pthread_spin_init.c: New file.
9643         * sysdeps/s390/pthread_spin_lock.c: New file.
9644         * sysdeps/s390/pthread_spin_trylock.c: New file.
9645         * sysdeps/s390/pthread_spin_unlock.c: New file.
9646         * sysdeps/s390/pthreaddef.h: New file.
9647         * sysdeps/s390/tcb-offsets.sym: New file.
9648         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9649         * sysdeps/s390/tls.h: New file.
9650         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9651         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9652         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9653         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9654         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9655         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9656         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9657         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9658         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9659         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9660         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9661         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9662         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9663         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9664         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9665         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9666         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9667         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9668         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9669         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9670         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9671         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9672         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9673
9674 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9675
9676         * atomic.h: Add a couple more default implementations.
9677         (atomic_compare_and_exchange_acq): Use
9678         __arch_compare_and_exchange_32_acq in return value definition.  It
9679         always exists.
9680         (atomic_bit_set): Renamed from atomic_set_bit.
9681         Add missing atomic_ prefixes.
9682
9683         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9684         thread library is available, use correct value to mark initialized
9685         once variable.
9686
9687 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9688
9689         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9690         __sysconf to determine pagesize.
9691
9692         * pthread_create.c: Include <atomic.h>.
9693         * allocatestack.c (allocate_stack): Implement coloring of the
9694         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9695         size minus one.  Adjust users.
9696         * sysdeps/i386/i686/Makefile: New file.
9697
9698 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9699
9700         * allocatestack.c: Improve comment throughout the file.
9701
9702         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9703         (__lll_lock_wait): Add branch prediction.
9704         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9705         (__lll_lock_wait): Likewise.
9706         (lll_unlock_wake_cb): Removed.
9707
9708 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9709
9710         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9711         _POSIX_THREAD_PRIORITY_SCHEDULING.
9712
9713 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9714
9715         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9716         Fix return type of ptr___pthread_getspecific.
9717
9718 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9719
9720         * Makefile (tests): Add tst-umask1.
9721         (tst-umask1-ARGS): Define.
9722         * tst-umask1.c: New file.
9723
9724 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9725
9726         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9727         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9728         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9729         pthread_rwlock_unlock.
9730         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9731         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9732         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9733         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9734         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9735         New file.
9736         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9737         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9738         New file.
9739         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9740         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9741         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9742         New file.
9743         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9744         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9745         New file.
9746         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9747         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9748         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9749         New file.
9750         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9751         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9752         New file.
9753         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9754
9755         * Makefile (libpthread-routines): Remove lowlevelcond and
9756         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9757         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9758         and pthread_cond_broadcast.
9759         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9760         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9761         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9762         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9763         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9764         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9765         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9766         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9767         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9768         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9769         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9770         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9771         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9772         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9773         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9774         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9775         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9776         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9777         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9778         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9779         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9780         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9781         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9782         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9783         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9784         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9785         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9786         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9787         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9788         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9789         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9790
9791         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9792         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9793         of the code is moved to ...
9794         * sysdeps/pthread/createthread.c: ...here.  New file.
9795
9796 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9797
9798         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9799         (__new_sem_post): Clear %eax before returning.
9800         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9801
9802         * Makefile (tests): Add tst-cleanup2.
9803         * tst-cleanup2.c: New file.
9804
9805         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9806         Interpret first parameter correctly.
9807
9808 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9809
9810         * Makefile (headers): Add bits/semaphore.h.
9811
9812 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9813
9814         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9815         if not SHARED.
9816
9817 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9818
9819         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9820         must be used and mapping failed.
9821         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9822
9823         * Makefile (CFLAGS-pthread_self.os): Define this, not
9824         CFLAGS-pthread_self.c.
9825
9826 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9827
9828         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9829         lll_unlock_wake_cb.
9830
9831         * Makefile (libpthread-routines): Add version.  Add rules to build
9832         version.os and banner.h.
9833         * version.c: New file.
9834
9835 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9836
9837         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9838         the alias unconditional.
9839         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9840
9841 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9842
9843         * Makefile (CFLAGS-pthread_self.c): New definition.
9844
9845 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9846
9847         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9848         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9849         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9850         * init.c (__pthread_initialize_minimal_internal): Likewise.
9851
9852 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9853
9854         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9855
9856         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9857         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9858         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9859         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9860         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9861         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9862
9863 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9864
9865         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9866         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9867         * tst-cancel-wrappers.sh: Remove all exceptions.
9868
9869 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9870
9871         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9872         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9873
9874         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9875         Use __libc_pthread_functions array if SHARED.
9876
9877         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9878         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9879
9880         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9881         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9882         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9883         __libc_ptf_call instead of __libc_maybe_call.
9884         (PTF): New #define.
9885         (__libc_cleanup_region_start): Wrap function name with PTF call.
9886         (__libc_cleanup_region_end): Likewise.
9887         (__libc_cleanup_end): Likewise.
9888
9889         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9890         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9891         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9892         * pthreadP.h: Add prototypes.
9893
9894         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9895         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9896         __pthread_rwlock_unlock aliases.
9897         * pthreadP.h: Add prototypes for new aliases.
9898
9899         * pthreadP.h (struct pthead_functions): Moved to...
9900         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9901         * init.c (pthread_functions): Add initializers for new elements.
9902
9903         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9904         __pthread_cleanup_pop_restore aliases.
9905         * pthreadP.h: Add prototypes.
9906
9907         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9908         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9909         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9910         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9911         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9912         * pthreadP.h: Adjust prototypes and callers.
9913
9914 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9915
9916         * Makefile (tests): Add tst-cancel7.
9917         (tst-cancel7-ARGS): New variable.
9918         * tst-cancel7.c: New file.
9919
9920         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9921         around gcc defficiencies.
9922         * old_pthread_cond_signal.c: Likewise.
9923         * old_pthread_cond_timedwait.c: Likewise.
9924         * old_pthread_cond_wait.c: Likewise.
9925
9926         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9927
9928 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9929
9930         * Makefile (tests): Add tst-cond7.
9931         * tst-cond7.c: New file.
9932
9933         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9934         (condvar_cleanup): Get condvar address from the right place.
9935
9936         * atomic.h: Correct definitions of atomic_full_barrier,
9937         atomic_read_barrier, atomic_write_barrier.
9938
9939         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9940         race-free.
9941         * old_pthread_cond_signal.c: Likewise.
9942         * old_pthread_cond_timedwait.c: Likewise.
9943         * old_pthread_cond_wait.c: Likewise.
9944
9945 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9946
9947         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9948
9949 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9950
9951         * pthreadP.h (pthread_cond_2_0_t): New type.
9952         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9953         Use new type for the 2.0 condvar function prototypes.
9954         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9955         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9956         parameter.
9957         * old_pthread_cond_destroy.c: Likewise.
9958         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9959         * old_pthread_cond_signal.c: Likewise.
9960         * old_pthread_cond_timedwait.c: Likewise.
9961         * old_pthread_cond_wait.c: Likewise.
9962
9963         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9964         (__pthread_cond_wait): Don't save cancellation mode and seq value
9965         in same location.
9966
9967         * herrno.c (__h_errno_location): Don't define as weak.
9968
9969 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9970
9971         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9972         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9973         and pthread_cond_wait.
9974         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9975         Renamed to...
9976         (__pthread_cond_broadcast_2_0): ... this.
9977         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9978         Renamed to...
9979         (__pthread_cond_destroy_2_0): ... this.
9980         * old_pthread_cond_init.c (__old_pthread_cond_init):
9981         Renamed to...
9982         (__pthread_cond_init_2_0): ... this.
9983         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9984         Renamed to...
9985         (__pthread_cond_signal_2_0): ... this.
9986         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9987         Renamed to...
9988         (__pthread_cond_wait_2_0): ... this.
9989         * pthread_cond_destroy.c: Include shlib-compat.h.
9990         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9991         * pthread_cond_init.c: Include shlib-compat.h.
9992         (pthread_cond_init): Change strong_alias into versioned_symbol.
9993         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9994         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9995         fields.
9996         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9997         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9998         __pthread_cond_wait_2_0): New prototypes.
9999         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
10000         __old_pthread_cond_init, __old_pthread_cond_signal,
10001         __old_pthread_cond_wait): Removed.
10002         * init.c: Include shlib-compat.h.
10003         (pthread_functions): Guard ptr___pthread_attr_init_2_0
10004         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
10005         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
10006         ptr___pthread_cond_*_2_0 fields.
10007         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
10008         pthread_cond_*@GLIBC_2.0 compatibility symbols.
10009
10010         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
10011         LIBC_SIGACTION was not yet defined.
10012         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
10013         [!defined LIBC_SIGACTION] (__sigaction): New function and
10014         libc_hidden_weak.
10015         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
10016         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
10017
10018 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10019
10020         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
10021
10022 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
10023
10024         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
10025         New, larger type definition.
10026         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
10027         implementation.
10028         * Versions [libpthread]: Add definitions for new pthread_cond_*
10029         interfaces for version GLIBC_2.3.2.
10030         * pthread_cond_init.c: Update initialization for new type definition.
10031         * Makefile (libpthread-routines): Remove pthread_cond_wait,
10032         pthread_cond_timedwait, pthread_cond_signal, and
10033         pthread_cond_broadcast.  Add old_pthread_cond_init,
10034         old_pthread_cond_destroy, old_pthread_cond_wait,
10035         old_pthread_cond_timedwait, old_pthread_cond_signal, and
10036         old_pthread_cond_broadcast.
10037         * old_pthread_cond_broadcast.c: New file.
10038         * old_pthread_cond_destroy.c: New file.
10039         * old_pthread_cond_init.c: New file.
10040         * old_pthread_cond_signal.c: New file.
10041         * old_pthread_cond_timedwait.c: New file.
10042         * old_pthread_cond_wait.c: New file.
10043         * pthreadP.h: Add prototypes for the compatibility interfaces.
10044
10045         * pthread_cond_destroy.c: Don't include <errno.h>.
10046
10047 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
10048
10049         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
10050         unnecessary zero offset when addressing MUTEX.
10051
10052 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10053
10054         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
10055         __register_atfork.
10056         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
10057         for __register_atfork.
10058
10059 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10060
10061         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
10062         instead of ASSEMBLER test macro.
10063
10064         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
10065         __libc_current_sigrtmax): Add libc_hidden_def.
10066
10067         * sysdeps/pthread/list.h: Remove assert.h include.
10068
10069 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10070
10071         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
10072         __pthread_initialize_minimal_internal not
10073         __pthread_initialize_minimal.
10074
10075 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
10076
10077         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
10078         __pthread_initialize_minimal as hidden.
10079
10080         * init.c (__pthread_initialize_minimal_internal): Don't mark as
10081         constructor.
10082
10083 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10084
10085         * Makefile ($(inst_libdir)/libpthread.so): Depend on
10086         $(common-objpfx)format.lds, include that into the output script.
10087         Fix comment.
10088         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
10089
10090 2002-12-28  Andreas Jaeger  <aj@suse.de>
10091
10092         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
10093         nsec resolution changes.
10094         (xstat64_conv): Likewise.
10095         (xstat32_conv): Likewise.
10096         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
10097         struct kernel_stat.
10098         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
10099         structs stat and stat64.
10100         * time/time.h (__timespec_defined): Define for __USE_MISC.
10101         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
10102
10103 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
10104
10105         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
10106         argument.
10107         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
10108         (pthread_exit): Use strong_alias to avoid warnings.
10109         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
10110         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
10111         ptr___pthread_attr_init_2_*.
10112         * init.c (pthread_functions): Adjust.
10113
10114 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
10115
10116         * forward.c: Make all functions available by default again.  It
10117         caused too much trouble.
10118
10119         * pt-siglongjmp.c: Removed.
10120
10121 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
10122
10123         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
10124         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
10125         * sysdeps/i386/Makefile: New file.
10126         * sysdeps/i386/tcb-offsets.sym: New file.
10127         * sysdeps/pthread/tcb-offsets.h: New file.
10128         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10129         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
10130
10131         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
10132         __register_atfork...
10133         (GLIBC_2.3.2): ...here.
10134
10135 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10136
10137         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10138         pthread_attr_setstackaddr with __attribute_deprecated__.
10139
10140 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10141
10142         * pt-system.c (system): Remove cancellation handling.
10143         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10144         cancellation routines.
10145
10146 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10147
10148         * descr.h: Include <dl-sysdep.h>.
10149         (struct pthread): Move header.data.list to the back of the struct.
10150         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10151         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10152         (SYSINFO_OFFSEET): Likewise.
10153
10154 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10155
10156         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10157         Define.
10158         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10159         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10160         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10161         (USE_DL_SYSINFO): Undef.
10162
10163 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10164
10165         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10166         $(common-objpfx)libc.so.
10167         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10168         it is bigger than pipe buffer size even on arches with bigger
10169         page size.
10170         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10171
10172 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10173
10174         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10175         correct errno access for case that USE___THREAD is not defined.
10176
10177 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10178
10179         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10180         Patch by Marijn Ros <marijn@mad.scientist.com>.
10181
10182 2002-12-22  Roland McGrath  <roland@redhat.com>
10183
10184         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10185
10186 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10187
10188         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10189
10190 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10191
10192         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10193         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10194         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10195
10196         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10197         of int $0x80.
10198         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10199         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10200         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10201         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10202         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10203         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10204         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10205         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10206
10207         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10208         sysenter.
10209         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10210
10211         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10212
10213         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10214         in new TCB.
10215         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10216         that sysinfo is properly initialized.
10217         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10218         to 1 only for ld.so.
10219
10220         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10221         RTLD_CORRECT_DYNAMIC_WEAK.
10222
10223 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10224
10225         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10226         Use return 0 as 6th argument to FORWARD4.
10227         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10228
10229 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10230
10231         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10232         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10233         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10234         (INIT_SYSINFO): New #define.
10235         (TLS_TP_INIT): Use INIT_SYSINFO.
10236         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10237         At test to make sure SYSINFO_OFFSET value is correct.
10238         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10239
10240 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10241
10242         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10243         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10244         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10245         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10246         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10247         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10248         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10249
10250 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10251
10252         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10253         macro instead of using int $0x80 directly.
10254
10255         * sysdeps/pthread/bits/stdio-lock.h: New file.
10256         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10257         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10258         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10259         * Makefile (routines): Add libc-lowlevelmutex.
10260
10261         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10262         __i686.get_pc_thunk.dx.
10263
10264 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10265
10266         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10267         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10268         ($(objpfx)tst-cancel-wrappers.out): New rule.
10269         * tst-cancel-wrappers.sh: New test.
10270         * tst-locale1.c: Include signal.h.
10271         (uselocale): Test static linking of __libc_current_sigrt*.
10272
10273 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10274
10275         * Makefile (tests): Add tst-cancel6.
10276         * tst-cancel6.c: New file
10277
10278 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10279
10280         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10281         Define meaningfully for assembler as well.
10282         * pthreadP.h (struct pthread_functions): Remove
10283         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10284         and ptr_pthread_attr_init_2_1 fields.
10285         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10286         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10287         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10288         (FORWARD3): Define using FORWARD4.
10289         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10290         versions.
10291         * pt-system.c: Remove duplicate stdlib.h include.
10292
10293 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10294
10295         * sem_init.c: Define sem_init@GLIBC_2.0.
10296         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10297         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10298
10299         * flockfile.c: Moved to...
10300         * sysdeps/pthread/flockfile.c: ...here.  New file.
10301         * funlockfile.c: Moved to...
10302         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10303         * ftrylockfile.c: Moved to...
10304         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10305
10306 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10307
10308         * libc-cancellation.c: Guard both function with
10309         #if !defined NOT_IN_libc.
10310         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10311         automatically provided pthread wrappers.
10312         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10313         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10314         nor in libpthread.
10315         * pt-open.c: Removed.
10316         * pt-fcntl.c: Removed.
10317         * pt-fsync.c: Removed.
10318         * pt-lseek.c: Removed.
10319         * pt-msgrcv.c: Removed.
10320         * pt-msgsnd.c: Removed.
10321         * pt-msync.c: Removed.
10322         * pt-nanosleep.c: Removed.
10323         * pt-open64.c: Removed.
10324         * pt-pause.c: Removed.
10325         * pt-pread.c: Removed.
10326         * pt-pread64.c: Removed.
10327         * pt-pwrite.c: Removed.
10328         * pt-pwrite64.c: Removed.
10329         * pt-read.c: Removed.
10330         * pt-recv.c: Removed.
10331         * pt-recvfrom.c: Removed.
10332         * pt-recvmsg.c: Removed.
10333         * pt-send.c: Removed.
10334         * pt-sendto.c: Removed.
10335         * pt-sigtimedwait.c: Removed.
10336         * pt-sigwait.c: Removed.
10337         * pt-wait.c: Removed.
10338         * pt-waitpid.c: Removed.
10339         * pt-write.c: Removed.
10340         * pt-accept.c: Removed.
10341         * pt-close.c: Removed.
10342         * pt-connect.c: Removed.
10343         * pt-lseek64.c: Removed.
10344         * pt-sendmsg.c: Removed.
10345         * pt-tcdrain.c: Removed.
10346
10347 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10348
10349         * init.c (__pthread_initialize_minimal_internal): Renamed from
10350         __pthread_initialize_minimal.  Make old name an alias.  This
10351         converts a normal relocation into a relative relocation.
10352
10353         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10354
10355         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10356         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10357         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10358         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10359         pt-sigwaitinfo, pt-waitid, and pt-writev.
10360         * pt-creat.c: Removed.
10361         * pt-poll.c: Removed.
10362         * pt-pselect.c: Removed.
10363         * pt-readv.c: Removed.
10364         * pt-select.c: Removed.
10365         * pt-sigpause.c: Removed.
10366         * pt-sigsuspend.c: Removed.
10367         * pt-sigwaitinfo.c: Removed.
10368         * pt-waitid.c: Removed.
10369         * pt-writev.c: Removed.
10370
10371         * init.c (pthread_functions): New variable.
10372         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10373         (or NULL) to __libc_pthread_init.
10374         * forward.c: Rewrite to use __libc:pthread_functions array to get
10375         function addresses.
10376         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10377         prototype.
10378         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10379         Take new parameter.  Copy content of variable pointed to by it
10380         to __libc_pthread_init.
10381
10382         * pthreadP.h (struct pthread_functions): New type.
10383         (__libc_pthread_init): Declare.
10384
10385         * pthread_attr_destroy.c: Add namespace protected alias.
10386         * pthread_attr_getdetachstate.c: Likewise.
10387         * pthread_attr_getinheritsched.c: Likewise.
10388         * pthread_attr_getschedparam.c: Likewise.
10389         * pthread_attr_getschedpolicy.c: Likewise.
10390         * pthread_attr_getscope.c: Likewise.
10391         * pthread_attr_setdetachstate.c: Likewise.
10392         * pthread_attr_setinheritsched.c: Likewise.
10393         * pthread_attr_setschedparam.c: Likewise.
10394         * pthread_attr_setschedpolicy.c: Likewise.
10395         * pthread_attr_setscope.c: Likewise.
10396         * pthread_cond_broadcast.c: Likewise.
10397         * pthread_cond_destroy.c: Likewise.
10398         * pthread_cond_init.c: Likewise.
10399         * pthread_cond_signal.c: Likewise.
10400         * pthread_cond_wait.c: Likewise.
10401         * pthread_condattr_destroy.c: Likewise.
10402         * pthread_condattr_init.c: Likewise.
10403         * pthread_equal.c: Likewise.
10404         * pthread_exit.c: Likewise.
10405         * pthread_getschedparam.c: Likewise.
10406         * pthread_self.c: Likewise.
10407         * pthread_setcancelstate.c: Likewise.
10408         * pthread_setschedparam.c: Likewise.
10409         * pthread_mutex_destroy.c: Likewise.
10410         * pthread_mutex_init.c: Likewise.
10411         * pthreadP.h: Add prototypes for the aliases.
10412
10413         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10414         multiple_threads member in correct TCB to 1.
10415
10416         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10417         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10418         member of thread decriptor, otherwise return unconditionally 1.
10419
10420 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10421
10422         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10423         regular Linux version.  Remove file.
10424         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10425         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10426         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10427         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10428         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10429         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10430         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10431         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10432         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10433         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10434         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10435         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10436         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10437         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10438         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10439         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10440         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10441         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10442         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10443         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10444         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10445         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10446         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10447         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10448         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10449         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10450         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10451         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10452         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10453         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10454
10455 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10456
10457         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10458         * sysdeps/unix/sysv/linux/open.c: Removed.
10459         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10460         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10461         * sysdeps/unix/sysv/linux/msync.c: Removed.
10462         * sysdeps/unix/sysv/linux/read.c: Removed.
10463         * sysdeps/unix/sysv/linux/close.c: Removed.
10464         * sysdeps/unix/sysv/linux/creat.c: Removed.
10465         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10466         * sysdeps/unix/sysv/linux/pause.c: Removed.
10467         * sysdeps/unix/sysv/linux/select.c: Removed.
10468         * sysdeps/unix/sysv/linux/write.c: Removed.
10469
10470 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10471
10472         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10473         element in TCB to see whether locking is needed.
10474
10475         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10476         MULTIPLE_THREADS_OFFSET value is correct.
10477
10478         * sysdeps/unix/sysv/linux/close.c: New file.
10479         * sysdeps/unix/sysv/linux/connect.S: New file.
10480         * sysdeps/unix/sysv/linux/creat.c: New file.
10481         * sysdeps/unix/sysv/linux/fsync.c: New file.
10482         * sysdeps/unix/sysv/linux/llseek.c: New file.
10483         * sysdeps/unix/sysv/linux/lseek.c: New file.
10484         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10485         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10486         * sysdeps/unix/sysv/linux/msync.c: New file.
10487         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10488         * sysdeps/unix/sysv/linux/open.c: New file.
10489         * sysdeps/unix/sysv/linux/open64.c: New file.
10490         * sysdeps/unix/sysv/linux/pause.c: New file.
10491         * sysdeps/unix/sysv/linux/poll.c: New file.
10492         * sysdeps/unix/sysv/linux/pread.c: New file.
10493         * sysdeps/unix/sysv/linux/pread64.c: New file.
10494         * sysdeps/unix/sysv/linux/pselect.c: New file.
10495         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10496         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10497         * sysdeps/unix/sysv/linux/readv.c: New file.
10498         * sysdeps/unix/sysv/linux/recv.S: New file.
10499         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10500         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10501         * sysdeps/unix/sysv/linux/select.c: New file.
10502         * sysdeps/unix/sysv/linux/send.S: New file.
10503         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10504         * sysdeps/unix/sysv/linux/sendto.S: New file.
10505         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10506         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10507         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10508         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10509         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10510         * sysdeps/unix/sysv/linux/system.c: New file.
10511         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10512         * sysdeps/unix/sysv/linux/wait.c: New file.
10513         * sysdeps/unix/sysv/linux/waitid.c: New file.
10514         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10515         * sysdeps/unix/sysv/linux/writev.c: New file.
10516         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10517
10518         * pt-readv.c: Fix comment.
10519
10520 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10521
10522         * tst-cleanup1.c: Include stdlib.h.
10523
10524         * tst-cancel5.c: New test.
10525         * Makefile (tests): Add tst-cancel5.
10526         (tst-cancel5): Link against libc.so libpthread.so in that order.
10527
10528 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10529
10530         * forward.c (test_loaded): Prevent recursive calls.
10531
10532         * Makefile (routines): Add libc-cancellation.
10533         * libc-cancellation.c: New file.
10534         * descr.h (struct pthread): Add multiple_threads field.
10535         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10536         new thread descriptor to 1.
10537         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10538         Initialize multiple_thread field after successful thread creation.
10539         * cancellation.c (__do_cancel): Move to pthreadP.h.
10540         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10541         (__pthread_disable_asynccancel): Add internal_function attribute.
10542         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10543         * pthread_setcancelstate.c: Likewise.
10544         * pthread_setcanceltype.c: Likewise.
10545         * pthread_exit.c: Likewise.
10546         * pthreadP.h (CANCELLATION_P): Likewise.
10547         (__do_cancel): Define as static inline.
10548         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10549         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10550         declarations.
10551         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10552         fields.  Define MULTIPLE_THREADS_OFFSET.
10553         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10554         declaration.
10555         * sysdeps/unix/sysv/linux/accept.S: New file.
10556         * sysdeps/unix/sysv/linux/read.c: New file.
10557         * sysdeps/unix/sysv/linux/write.c: New file.
10558         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10559         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10560         initialization of __libc_locking_needed.
10561         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10562         __libc_locking_needed, use multiple_threads field in TCB.
10563         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10564
10565 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10566
10567         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10568         version.
10569         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10570
10571         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10572         access to __libc_locking_needed for PIC.
10573
10574 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10575
10576         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10577         declare for libc.so.
10578         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10579         expression.
10580         (__libc_lock_lock): Put into statement expression.
10581         (__libc_lock_unlock): Remove trailing semicolon.
10582         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10583
10584 2002-12-12  Roland McGrath  <roland@redhat.com>
10585
10586         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10587         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10588
10589 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10590
10591         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10592         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10593         Initialize __libc_locking_needed.
10594         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10595         instead of __register_pthread_fork_handler.
10596         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10597         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10598         fork-gen with libc_pthread_init.
10599         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10600         of __register_pthread_fork_handler.
10601         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10602         of __register_pthread_fork_handler.
10603         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10604         __libc_locking_needed to determine whether lock prefix can be avoided.
10605         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10606
10607 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10608
10609         * Makefile (tests): Add tst-cleanup1.
10610         * tst-cleanup1.c: New file.
10611         * cancellation.c (__cleanup_thread): Removed.
10612         (__do_cancel): Remove call to __cleanup_thread.
10613         * pthreadP.h: Remove __cleanup_thread prorotype.
10614
10615         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10616         Remember function and argument even if cancellation handler
10617         function is not available.
10618         (__libc_cleanup_region_end): Execute registered function directly if
10619         pthread functions are not available.
10620         (__libc_cleanup_end): Likewise.
10621
10622         * init.c (__pthread_initialize_minimal): Fix initialization in
10623         static lib by preventing gcc from being too clever.
10624
10625 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10626
10627         * init.c (__pthread_initialize_minimal): Remove unneccesary
10628         sigaddset call.
10629
10630         * Makefile (tests): We can run tst-locale2 now.
10631
10632 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10633
10634         * Versions: Remove duplicated sigwait entry.
10635
10636 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10637
10638         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10639         inside libpthread.
10640
10641         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10642
10643         * pthreadP.h: Declare __pthread_enable_asynccancel and
10644         __pthread_disable_asynccancel.
10645         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10646         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10647         * cancellation.c (__pthread_enable_asynccancel): New function.
10648         (__pthread_disable_asynccancel): New function.
10649         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10650         * pt-close.c: Likewise.
10651         * pt-connect.c: Likewise.
10652         * pt-creat.c: Likewise.
10653         * pt-fcntl.c: Likewise.
10654         * pt-fsync.c: Likewise.
10655         * pt-lseek.c: Likewise.
10656         * pt-lseek64.c: Likewise.
10657         * pt-msgrcv.c: Likewise.
10658         * pt-msgsnd.c: Likewise.
10659         * pt-msync.c: Likewise.
10660         * pt-nanosleep.c: Likewise.
10661         * pt-open.c: Likewise.
10662         * pt-open64.c: Likewise.
10663         * pt-pause.c: Likewise.
10664         * pt-poll.c: Likewise.
10665         * pt-pread.c: Likewise.
10666         * pt-pread64.c: Likewise.
10667         * pt-pselect.c: Likewise.
10668         * pt-pwrite.c: Likewise.
10669         * pt-pwrite64.c: Likewise.
10670         * pt-read.c: Likewise.
10671         * pt-readv.c: Likewise.
10672         * pt-recv.c: Likewise.
10673         * pt-recvfrom.c: Likewise.
10674         * pt-recvmsg.c: Likewise.
10675         * pt-select.c: Likewise.
10676         * pt-send.c: Likewise.
10677         * pt-sendmsg.c: Likewise.
10678         * pt-sendto.c: Likewise.
10679         * pt-sigpause.c: Likewise.
10680         * pt-sigsuspend.c: Likewise.
10681         * pt-sigtimedwait.c: Likewise.
10682         * pt-sigwait.c: Likewise.
10683         * pt-sigwaitinfo.c: Likewise.
10684         * pt-system.c: Likewise.
10685         * pt-tcdrain.c: Likewise.
10686         * pt-wait.c: Likewise.
10687         * pt-waitid.c: Likewise.
10688         * pt-waitpid.c: Likewise.
10689         * pt-write.c: Likewise.
10690         * pt-writev.c: Likewise.
10691         * pthread_join.c: Likewise.
10692         * pthread_timedjoin.c: Likewise.
10693
10694         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10695         (__xpg_sigpause): New function.
10696         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10697
10698 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10699
10700         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10701
10702         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10703         _GI_pthread_cleanup_pop to pthreadP.h.
10704
10705         * ftrylockfile.c: Use _IO_lock_trylock instead of
10706         pthread_mutex_trylock.
10707
10708         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10709         (CANCEL_RESET): Likewise.
10710         (__pthread_setcanceltype_): Declare.
10711         (__pthread_mutex_lock_internal): Declare.
10712         (__pthread_mutex_unlock_internal): Declare.
10713         (__pthread_once_internal): Declare.
10714         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10715         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10716
10717         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10718         and pthread_mutex_unlock.
10719         * pthread_cond_wait.c: Likewise.
10720         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10721         * pthread_mutex_unlock.c: Likewise.
10722
10723         * pthread_setcanceltype.c: Add additional alias
10724         __pthread_setcanceltype.
10725
10726         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10727         * sem_open.c (sem_open): Likewise.
10728         Use __libc_open, __libc_write, and __libc_close instead of
10729         open, write, and close respectively.
10730
10731         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10732         Rewrite as statement expression since it must return a value.
10733
10734         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10735         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10736         __pthread_kill.
10737
10738         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10739         alias __pthread_once_internal.
10740
10741         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10742
10743 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10744
10745         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10746         * tst-stdio1.c: New file.
10747         * tst-stdio2.c: New file.
10748
10749         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10750
10751         * Makefile (tests): Comment out tst-locale2 for now.
10752         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10753
10754         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10755         -D_IO_MTSAFE_IO.
10756         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10757         Use _IO_lock_init instead of explicit assignment.
10758
10759         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10760         Define __libc_lock_* and __libc_lock_recursive macros with
10761         lowlevellock macros, not pthread mutexes.
10762
10763         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10764         of pthread_mutex_lock.
10765         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10766         instead of pthread_mutex_unlock.
10767
10768 2002-12-06  Roland McGrath  <roland@redhat.com>
10769
10770         * allocatestack.c (__stack_user): Use uninitialized defn.
10771         * init.c (__pthread_initialize_minimal): Initialize it here.
10772
10773 2002-12-05  Roland McGrath  <roland@redhat.com>
10774
10775         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10776         string.
10777         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10778
10779         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10780         missing & here too.
10781
10782 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10783
10784         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10785         lowlevellock.
10786         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10787         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10788         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10789         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10790         for __libc_lock_* macros.
10791         * Makefile (routines): Add libc-lowlevellock.
10792
10793 2002-10-09  Roland McGrath  <roland@redhat.com>
10794
10795         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10796         Under [__PIC__], call the function via the pointer fetched for
10797         comparison rather than a call by name that uses the PLT.
10798         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10799         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10800         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10801         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10802         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10803
10804 2002-12-04  Roland McGrath  <roland@redhat.com>
10805
10806         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10807
10808         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10809         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10810
10811         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10812
10813 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10814
10815         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10816         a completely opaque, non-integer type.
10817         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10818
10819 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10820
10821         * sysdeps/i386/tls.h: Include stdlib.h.
10822         * sysdeps/x86_64/tls.h: Likewise.
10823
10824 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10825
10826         * Makefile (tests): Add tst-locale2.
10827         (tests-static): Likewise.
10828         * tst-locale2.c: New file.
10829
10830         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10831         volatile and add memory clobbers to lock operations.
10832
10833 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10834
10835         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10836         * sysdeps/i386/i486/bits/atomic.h: New file.
10837         * sysdeps/i386/i586/bits/atomic.h: New file.
10838         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10839         include i486 version.
10840         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10841         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10842         Patch by Marijn Ros <marijn@mad.scientist.com>.
10843
10844         * allocatestack.c (get_cached_stack): Don't crash if we first
10845         found a stack with a larger size then needed.
10846         Reported by Hui Huang <hui.huang@sun.com>.
10847
10848         * Makefile (tests): Add tst-sysconf.
10849         * tst-sysconf.c: New file.
10850
10851         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10852         PTHREAD_THREADS_MAX.
10853
10854 2002-12-02  Roland McGrath  <roland@redhat.com>
10855
10856         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10857         Declare using hidden_proto instead of attribute_hidden, so there are
10858         non-.hidden static symbols for gdb to find.
10859         (__pthread_keys): Likewise.
10860         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10861         * allocatestack.c (__stack_user): Likewise.
10862         * pthread_create.c (__pthread_keys): Likewise.
10863         (__nptl_threads_events, __nptl_last_event): Make these static instead
10864         of hidden.
10865         * pthread_key_create.c (__pthread_pthread_keys_max,
10866         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10867
10868 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10869
10870         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10871         statically.
10872         * tst-locale1.c: New file.
10873
10874         * pthread_cond_timedwait.c: Include <stdlib.h>.
10875
10876         * Makefile (tests): Add tst-fork2 and tst-fork3.
10877         * tst-fork2.c: New file.
10878         * tst-fork3.c: New file.
10879
10880 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10881
10882         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10883
10884         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10885         require it to 200112L.
10886
10887         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10888         instruction only if HAVE_CMOV is defined.
10889         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10890
10891         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10892
10893         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10894
10895         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10896
10897         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10898
10899 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10900
10901         * sysdeps/x86_64/bits/atomic.h: New file.
10902
10903         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10904         16-bit operations.
10905
10906         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10907         possible since gettid cannot fail.
10908
10909         * sysdeps/x86_64/pthreaddef.h: New file.
10910
10911         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10912
10913         * sysdeps/x86_64/pthread_spin_init.c: New file.
10914         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10915         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10916         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10917
10918         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10919         Add missing lock prefix.  Minute optimization.
10920
10921         * tst-spin2.c (main): Also check successful trylock call.
10922
10923         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10924         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10925
10926         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10927         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10928
10929         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10930         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10931         value in case of an error.  Add support for INTERNAL_SYSCALL.
10932
10933         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10934         value in case of an error.
10935
10936         * sysdeps/x86_64/tls.h: New file.
10937
10938 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10939
10940         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10941         takes the array member name and the index as parameters.
10942         (THREAD_SETMEM_NC): Likewise.
10943         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10944         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10945         interfaces.
10946
10947         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10948         to decide which code to use.
10949         (THREAD_SETMEM_NC): Likewise.
10950
10951         * allocatestack.c (queue_stack): Don't remove stack from list here.
10952         Do it in the caller.  Correct condition to prematurely terminate
10953         loop to free stacks.
10954         (__deallocate_stack): Remove stack from list here.
10955
10956 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10957
10958         * Makefile (tests): Add tst-stack1.
10959         * tst-stack1.c: New file.
10960
10961         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10962         provided stack.
10963
10964         * pthread_attr_getstack.c: Return bottom of the thread area.
10965
10966 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10967
10968         * Makefile (libpthread-routines): Add pt-allocrtsig and
10969         pthread_kill_other_threads.
10970         * pt-allocrtsig.c: New file.
10971         * pthread_kill_other_threads.c: New file.
10972         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10973         all three functions.
10974         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10975         allocrtsig.
10976         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10977         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10978         and __libc_allocate_rtsig_private.
10979         * Versions (libpthread): Export pthread_kill_other_threads_np,
10980         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10981
10982 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10983
10984         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10985         the end of the stack.  Adjust computations.
10986         When mprotect call fails dequeue stack and free it.
10987         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10988         attribute.
10989         * pthread_getattr_np.c: Likewise.
10990
10991         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10992         surprises.
10993
10994 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10995
10996         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10997         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10998
10999 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
11000
11001         * pthread_getspecific.c: Optimize access to first 2nd-level array.
11002         * pthread_setspecific.c: Likewise.
11003
11004 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
11005
11006         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
11007         definitions.  Get them from the official place.
11008         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
11009
11010         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
11011         Use new CLONE_ flags in clone() calls.
11012
11013         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
11014         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
11015
11016         * Versions: Add pthread_* functions for libc.
11017         * forward.c: New file.
11018
11019         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
11020         errno-loc.
11021         * herrno.c: New file.
11022         * res.c: New file.
11023
11024         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
11025         sem_trywait, and sem_timedwait.  Add herrno and res.
11026         * sem_init.c: Don't initialize lock and waiters members.
11027         * sem_open.c: Likewise.
11028         * sem_post.c: Removed.
11029         * sem_wait.c: Removed.
11030         * sem_trywait.c: Removed.
11031         * sem_timedwait.c: Removed.
11032         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
11033         Includes full implementations of sem_post, sem_wait, sem_trywait,
11034         and sem_timedwait.
11035         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
11036         for new implementation.
11037         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
11038         and waiters fields.
11039
11040         * tst-sem3.c: Improve error message.
11041         * tst-signal3.c: Likewise.
11042
11043         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
11044         to tell the kernel about the termination futex and to initialize tid
11045         member.  Don't initialize main_thread.
11046         * descr.h (struct pthread): Remove main_thread member.
11047         * cancelllation.c (__do_cancel): Remove code handling main thread.
11048         The main thread is not special anymore.
11049
11050         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
11051         size of the stacks to stack_cache_actsize.
11052
11053         * pt-readv.c: Add missing "defined".
11054         * pt-sigwait.c: Likewise.
11055         * pt-writev.c: Likewise.
11056
11057 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
11058
11059         * Versions: Export __connect from libpthread.
11060         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11061
11062         * Makefile (libpthread-routines): Add pt-raise.
11063         * sysdeps/unix/sysv/linux/raise.c: New file.
11064         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
11065         * sysdeps/generic/pt-raise.c: New file.
11066
11067         * pthread_cond_init.c: Initialize all data elements of the condvar
11068         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11069
11070         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
11071         * pthread_create.c: Likewise.
11072
11073         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
11074         * tst-key1.c: New file.
11075         * tst-key2.c: New file.
11076         * tst-key3.c: New file.
11077
11078         * Versions: Export pthread_detach for version GLIBC_2.0.
11079         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
11080
11081 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
11082
11083         * pthread_key_create.c: Terminate search after an unused key was found.
11084         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11085
11086         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
11087         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11088
11089 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
11090
11091         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
11092         dynamic lookup for errno in PIC.
11093
11094         * allocatestack.c (get_cached_stack): Rearrange code slightly to
11095         release the stack lock as soon as possible.
11096         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
11097         the static TLS block.
11098         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
11099
11100         * cancellation.c: Renamed from cancelation.c.
11101         * Makefile: Adjust accordingly.
11102         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
11103         * cleanup_defer.c: Use CANCELLATION_P.
11104         * pthread_testcancel.c: Likewise.
11105         * descr.h: Fix spelling in comments.
11106         * init.c: Likewise.
11107         * pthread_getattr_np.c: Likewise.
11108         * pthread_getschedparam.c: Likewise.
11109         * pthread_setschedparam.c: Likewise.
11110         * Versions: Likewise.
11111
11112         * pt-pselect.c: New file.
11113         * Makefile (libpthread-routines): Add pt-pselect.
11114         * Versions: Add pselect.
11115
11116         * tst-cancel4.c: New file.
11117         * Makefile (tests): Add tst-cancel4.
11118
11119 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
11120
11121         * pthread_mutex_lock.c: Always record lock ownership.
11122         * pthread_mutex_timedlock.c: Likewise.
11123         * pthread_mutex_trylock.c: Likewise.
11124
11125         * pt-readv.c: New file.
11126         * pt-writev.c: New file.
11127         * pt-creat.c: New file.
11128         * pt-msgrcv.c: New file.
11129         * pt-msgsnd.c: New file.
11130         * pt-poll.c: New file.
11131         * pt-select.c: New file.
11132         * pt-sigpause.c: New file.
11133         * pt-sigsuspend.c: New file.
11134         * pt-sigwait.c: New file.
11135         * pt-sigwaitinfo.c: New file.
11136         * pt-waitid.c: New file.
11137         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11138         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11139         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11140         * Versions: Add all the new functions.
11141
11142         * tst-exit1.c: New file.
11143         * Makefile (tests): Add tst-exit1.
11144
11145         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11146
11147 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11148
11149         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11150
11151         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11152         call.  pthread_join is an official cancellation point.
11153         * pthread_timedjoin.c: Likewise.
11154
11155         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11156         and the condvar's mutex are retrieved.
11157         * pthread_cond_timedwait.c: Likewise.
11158         Reported by dice@saros.East.Sun.COM.
11159
11160 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11161
11162         * pthreadP.h: Cut out all type definitions and move them...
11163         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11164         * pthreadP.h: Include <internaltypes.h>.
11165
11166         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11167         performance tweaks.
11168
11169         * sem_trywait.c: Shuffle #includes around to get right order.
11170         * sem_timedwait.c: Likewise.
11171         * sem_post.c: Likewise.
11172         * sem_wait.c: Likewise.
11173
11174         * nptl 0.3 released.
11175
11176         * Makefile (tests): Add tst-signal3.
11177         * tst-signal3.c: New file.
11178
11179 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11180
11181         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11182         the asms modify the sem object.
11183         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11184
11185         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11186         the actual members.
11187         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11188         * semaphoreP.h: Include pthreadP.h.
11189         * sem_getvalue.c: Adjust to sem_t change.
11190         * sem_init.c: Likewise.
11191         * sem_open.c: Likewise.
11192         * sem_post.c: Likewise.
11193         * sem_timedwait.c: Likewise.
11194         * sem_trywait.c: Likewise.
11195         * sem_wait.c: Likewise.
11196
11197 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11198
11199         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11200         * tst-basic2.c: New file.
11201         * tst-exec1.c: New file.
11202         * tst-exec2.c: New file.
11203         * tst-exec3.c: New file.
11204
11205         * tst-fork1.c: Remove extra */.
11206
11207         * nptl 0.2 released.  The API for IA-32 is complete.