NEWS udpate.
[glibc.git] / nptl / ChangeLog
blobd4a1deb22044e2623fca18ab68716802036c9e1b
1 2010-08-10  Dinakar Guniguntala  <dino@in.ibm.com>
2             Stefan Hajnoczi  <stefanha@linux.vnet.ibm.com>
4         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: If
5         FUTEX_WAKE_OP fails make sure to call FUTEX_WAKE instead.
7 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
9         * sysdeps/unix/sysv/linux/i386/Makefile: New file.
11 2010-05-01  Alan Modra  <amodra@gmail.com>
13         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
14         (PSEUDO): Use correct cr save.  Don't use wrong parm save area
15         to save temps.  Correct cfi for possible later frame manipulation.
16         (DOCARGS_1, UNDOCARGS_1): Use the correct parm save area.
17         (DOCARGS_2, UNDOCARGS_2, DOCARGS_3, UNDOCARGS_3): Likewise.
18         (DOCARGS_4, UNDOCARGS_4, DOCARGS_5, UNDOCARGS_5): Likewise.
19         (DOCARGS_6, UNDOCARGS_6): Likewise.
20         (CENABLE, CDISABLE): Add nops for non-shared calls.
22 2010-07-06  Andreas Schwab  <schwab@redhat.com>
24         * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np):
25         Fix type mismatch.
27 2010-07-03  Ulrich Drepper  <drepper@redhat.com>
29         * tst-abstime.c (do_test): Some more cleanups
31 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
33         * tst-abstime.c: Correct testing and add test for sem_timedwait.
35 2010-07-01  Andreas Schwab  <schwab@redhat.com>
36             Ulrich Drepper  <drepper@redhat.com>
38         * Makefile (tests): Add tst-abstime.
39         * tst-abstime.c: New file.
40         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
41         (__lll_timedlock_wait): Check for timestamp before the Epoch.
42         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
43         (__lll_timedlock_wait): Likewise.
44         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
45         (__lll_robust_timedlock_wait): Likewise.
46         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
47         (__pthread_cond_timedwait): Likewise.
48         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
49         (pthread_rwlock_timedrdlock): Likewise.
50         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
51         (pthread_rwlock_timedwrlock): Likewise.
52         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
53         Likewise.
55 2010-07-01  Ulrich Drepper  <drepper@redhat.com>
57         * Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
59 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
61         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
62         location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
64 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
66         [BZ #11390]
67         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
68         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
69         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
70         pthread_setname.
71         * Makefile (libpthread-routines): Add pthread_getname and
72         pthread_setname.
73         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
75 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
77         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
78         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
79         * sysdeps/pthread/Makefile: Remove csu section and rt section's
80         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
82 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
84         * pthread_cond_timedwait.c: Add check for
85         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
86         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
87         INTERNAL_SYSCALL.
89 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
91         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
92         and the call fails wake eventually waiting setxid threads.  Don't free
93         stack here if we try starting a thread.
94         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
95         if the clone call failed.
97 2010-03-08  Andreas Schwab  <schwab@redhat.com>
99         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
100         * allocatestack.c (get_cached_stack): Set setxid_futex.
101         (allocate_stack): Likewise.
103 2010-03-05  Andreas Schwab  <schwab@redhat.com>
104             Ulrich Drepper  <drepper@redhat.com>
106         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
107         it is creating a thread or it is just being created.
108         * pthread_create.c (start_thread): Wake setxid thread if it is
109         waiting.
110         (__pthread_create_2_1): Initialize setxid_futex.
111         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
112         is waiting.
114 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
116         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
117         Fix unwind info.
118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
120 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
122         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
123         Fix pthread_cond_timedwait with requeue-PI.
124         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
125         Fix pthread_cond_wait with requeue-PI.
127 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
129         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
130         and pthread_mutexattr_setrobust for GLIBC_2.12.
131         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
132         * pthread_mutexattr_getrobust.c: Define alias
133         pthread_mutexattr_getrobust.
134         * pthread_mutexattr_setrobust.c: Define alias
135         pthread_mutexattr_setrobust.
137 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
139         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
141 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
143         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
145 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
147         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
148         call __gmon_start__.
149         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
151 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
153         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
154         using memset.
156 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
158         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
159         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
160         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
161         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
162         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
163         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
164         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
165         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
167 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
169         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
170         Don't update nwaiters after invalid timeout is recognized.
172 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
174         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
175         __gmon_start__.
177 2009-11-27  Andreas Schwab  <schwab@redhat.com>
179         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
180         THREAD_SELF->cancelhandling after returning from futex call.
182 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
184         * tst-sem13.c: New file.
185         * Makefile (tests): Add tst-sem13.
187 2009-11-22  Roland McGrath  <roland@redhat.com>
189         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
190         instead of recapitulating its contents.
192 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
194         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
195         optimizations and cleanups.
197 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
199         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
200         Remove redundant code. Fix cfi offsets.
201         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
202         Fix cfi offsets.
204 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
206         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
207         reduce size of unwind info.
209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
210         cfi directives.
211         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
212         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
214 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
216         [BZ #4457]
217         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
218         LIBGCC_S_SO.
219         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
221 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
223         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
225         [BZ #3270]
226         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
227         steps to avoid races with creation and terminations.
228         * nptl-init.c (sighandler_setxid): Adjust.
229         Patch by Daniel Jacobowitz.
231 2009-09-07  Andreas Schwab  <schwab@redhat.com>
233         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
235 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
236             Joseph Myers  <joseph@codesourcery.com>
238         [BZ #7094]
239         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
240         Initialize the sigev_notify field for newly created timer to make sure
241         the timer gets deleted from the active timer's list upon timer_delete.
243 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
245         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
246         Correct a logic error.
248 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
250         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
251         of the field in local variables.
252         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
253         variable and don't unconditionally clear it.
255 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
257         * pthread_create.c (start_thread): Hint to the kernel that memory for
258         the stack can be reused.  We do not mark all the memory.  The part
259         still in use and some reserve are kept.
261 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
263         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
265 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
267         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
268         directives.
270 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
272         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
273         directives.
274         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
276 2009-08-10  Andreas Schwab  <schwab@redhat.com>
278         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
279         (__pthread_cond_signal): Don't clobber register used for syscall
280         number.
282 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
284         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
285         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
287         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
288         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
289         register.
291 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
293         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
294         enabled by the special *_asynccancel functions.
295         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
296         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
298         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
300 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
302         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
303         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
304         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
305         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
306         since we can assume the special __*_{en,dis}able_asynccancel
307         functions.
308         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
309         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
310         and PTHREAD_CANCELED.
312 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
314         * descr.h: Better definition of *_BITMASK macros for cancellation.
316 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
318         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
320         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
321         dynamic linker might have to save.
322         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
323         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
324         printing.
326         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
328 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
330         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
331         New function.
332         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
333         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
334         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
335         requeue_pi for robust mutexes.
336         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
337         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
338         Don't only skip __pthread_mutex_cond_lock.  Call instead
339         __pthread_mutex_cond_lock_adjust.
340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
342         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
343         optimization of PI mutex handling.
345 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
347         [BZ #10418]
348         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
349         instead of of _acq variants of cmpxchg.
351 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
353         * sysdeps/x86_64/configure.in: New file.
355         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
356         path when not using absolute timeout futex.
358 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
360         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
361         optimizations of last changes.
362         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
364 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
366         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
367         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
368         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
369         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
370         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
371         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
372         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
373         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
375         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
376         (__pthread_cond_timedwait): Make more robust.
378 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
380         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
381         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
382         directly use absolute timeout.
384         * tst-sem5.c (do_test): Add test for premature timeout.
385         * Makefile: Linu tst-sem5 with librt.
387         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
388         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
389         directly use absolute timeout.
390         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
391         (pthread_rwlock_timedrdlock): Likewise.
393         * tst-cond11.c (run_test): Add test to check that the timeout is
394         long enough.
396         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
397         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
398         directly use absolute timeout.
400         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
401         (__pthread_cond_wait): Convert to using exception handler instead of
402         registered unwind buffer.
403         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
404         (__pthread_cond_timedwait): Likewise.
406 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
408         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
409         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
410         use absolute timeout.
412         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
413         handling of uncontested semaphore.
415         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
416         (__condvar_cleanup): Rewrite to use cfi directives instead of
417         hand-coded unwind tables.
418         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
419         Likewise.
420         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
421         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
422         Likewise.
424 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
426         * Makefile (libpthread-routines): Add pthread_sigqueue.
427         * Versions: Add pthread_sigqueue for GLIBC_2.11.
428         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
429         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
431 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
433         [BZ #10262]
434         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
435         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
436         cannot be assumed.
437         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
439 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
441         * libc-cancellation.c: Move __libc_cleanup_routine to...
442         * libc-cleanup.c: ...here.  New file.
443         * Makefile (routines): Add libc-cleanup.
445         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
446         test.
447         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
448         * sysdeps/pthread/librt-cancellation.c: Likewise.
450         [BZ #9924]
451         * nptl-init.c: Renamed from init.c.
452         * Makefile: Change all occurences of init.c to nptl-init.c.
454 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
456         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
457         to test when deciding on the delay.
458         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
459         * pthread_cancel.c: Close race between deciding on sending a signal
460         and setting the CANCELING_BIT bit.
462         * cancellation.c (__pthread_disable_asynccancel): Don't return if
463         thread is canceled.
464         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
466 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
468         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
469         is available.
470         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
471         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
472         * sysdeps/i386/tls.h: Likewise.
473         (tcbhead_t): Add __private_tm member.
475 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
477         * sem_open.c (sem_open): Rewrite initialization of initsem to
478         avoid warnings.
480         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
481         Avoid warning by using may_alias attribute on ptrhack.
483 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
485         [BZ #10090]
486         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
487         Check policy and priority for validity.
488         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
490 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
492         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
493         (__pthread_cond_timedwait): Change to use cfi directives instead of
494         hand-coded unwind sections.
496 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
498         * init.c (nptl_freeres): Compile only for SHARED.
500 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
502         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
503         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
504         FUTEX_BITSET_MATCH_ANY.
506 2009-02-27  Roland McGrath  <roland@redhat.com>
508         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
509         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
511 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
513         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
514         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
515         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
516         200112L to 200809L.
518 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
520         * sysdeps/pthread/pthread.h: The robust mutex functions are in
521         POSIX 2008.
523 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
525         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
526         Unify name of include protector macro.
528 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
530         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
531         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
533 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
535         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
536         pointer variables.
538         * allocatestack.c (__free_stacks): Renamed from free_stacks.
539         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
540         * init.c (nptl_freeres): New function.
541         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
542         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
543         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
544         variable.
545         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
546         load DSO.  Assign last.
547         (__unwind_freeres): New function.
549         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
550         for better debugging.  No need to use stack_list_add here.
552 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
554         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
555         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
556         instead of computing relative timeout.
557         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
558         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
560 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
562         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
564 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
566         * sysdeps/pthread/list.h (list_add): Initialize new element first.
567         (list_add_tail): Removed.
569 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
571         * (in_flight_stack): New variable.
572         (stack_list_del): New function.  Use instead of list_del.
573         (stack_list_add): New function.  Use instead of list_add when adding to
574         stack_cache and stack_used lists.
575         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
576         when the fork call interrupted another thread.
578 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
580         * init.c (__pthread_initialize_minimal_internal): Optimize test
581         FUTEX_CLOCK_REALTIME a bit.
583 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
585         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
586         only passing five parameters to FUTEX_WAIT_BITSET call.
588         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
589         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
590         instead of computing relative timeout.
592 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
594         * init.c (__pthread_initialize_minimal_internal): Check for
595         FUTEX_CLOCK_REALTIME flag.
596         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
597         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
598         relative timeout.
600         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
601         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
602         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
603         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
604         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
605         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
607 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
609         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
610         loop body instead of ; to avoid gcc warnings.
611         (pthread_cleanup_pop_restore_np): Likewise.
612         Patch by Caolán McNamara <caolanm@redhat.com>.
614 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
616         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
617         fast path here, for robust/PI/PP mutexes call
618         __pthread_mutex_lock_full.  Don't use switch, instead use a series
619         of ifs according to their probability.
620         (__pthread_mutex_lock_full): New function.
621         * pthread_mutex_unlock.c: Include assert.h.
622         (__pthread_mutex_unlock_usercnt): Handle only the
623         fast path here, for robust/PI/PP mutexes call
624         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
625         of ifs according to their probability.
626         (__pthread_mutex_unlock_full): New function.
627         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
628         (__pthread_mutex_lock_full): Define.
630 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
632         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
633         implementation.  Add necessary padding and.
634         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
635         words.
637 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
639         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
640         and FUTEX_WAKE_BITSET.
642 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
644         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
645         and FUTEX_WAKE_BITSET.
646         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
647         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
648         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
649         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
651 2008-11-25  Roland McGrath  <roland@redhat.com>
653         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
654         Subdirectories moved to ports repository as
655         sysdeps/.../nptl subdirectories.
657 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
659         [BZ #7008]
660         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
661         of old value.
662         * pthread_cond_init.c (__pthread_cond_init): Fix
663         cond->__data.__nwaiters initialization.
664         * Makefile (tests): Add tst-cond23.
665         * tst-cond23.c: New test.
667 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
669         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
670         arguments.
671         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
672         arguments.
674 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
676         [BZ #6955]
677         * pthread_mutex_lock.c: Add support for private PI mutexes.
678         * pthread_mutex_timedlock.c: Likewise.
679         * pthread_mutex_trylock.c: Likewise.
680         * pthread_mutex_unlock.c: Likewise.
681         Patch mostly by Ben Jackson <ben@ben.com>.
683 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
685         [BZ #6843]
686         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
687         Increase stack size for helper thread.
689 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
691         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
692         assembly with a clobber list for access registers a0 and a1.
694 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
696         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
697         to force runp->refcntr to be read from memory.
699 2008-09-08  Richard Guenther  <rguenther@suse.de>
701         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
702         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
703         lll_timedlock, lll_robust_timedlock, lll_unlock,
704         lll_robust_unlock): Promote private to int.
706 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
708         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
709         ARCH_RETRY_MMAP definitions.
710         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
711         Define MAP_STACK when not defined.
712         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
713         handling of ARCH_RETRY_MMAP.
715 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
717         * tst-align2.c (f): Print message that f is reached.
719 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
721         [BZ #6740]
722         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
723         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
725 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
727         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
728         SOCK_CLOEXEC if possible.
730 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
732         * Makefile (tests): Add tst-rwlock2a.
733         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
734         * tst-rwlock2a.c: New file.
736 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
738         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
740 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
742         * sysdeps/pthread/pthread.h: Fix typo in comment.
744 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
746         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
747         of CPU set to the kernel.
749 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
751         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
752         cfi directives.
753         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
754         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
755         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
756         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
757         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
758         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
760 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
762         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
763         cfi directives.
764         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
765         Likewise.
766         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
767         Likewise.
768         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
769         Likewise.
771 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
773         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
775 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
777         David S. Miller  <davem@davemloft.net>
779         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
781 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
783         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
784         __pshared correctly.
785         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
786         Likewise.
787         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
788         Likewise.
789         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
790         Likewise.
791         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
792         Likewise.
793         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
795 2008-04-14  David S. Miller  <davem@davemloft.net>
797         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
798         (__old_sem_wait): Fix argument to lll_futex_wait().
800 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
802         * pthread_create.c: Require pthread_mutex_trylock and
803         pthread_key_delete for libgcc.
805 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
807         [BZ #6020]
808         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
809         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
810         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
812 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
814         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
815         <linux/limits.h> has defined it.
816         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
817         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
818         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
819         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
821 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
823         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
824         of ASSEMBLER.
825         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
826         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
828 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
830         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
831         HAVE_DL_DISCOVER_OSVERSION.
832         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
833         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
835 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
837         [BZ #5778]
838         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
839         _POSIX_CHOWN_RESTRICTED value to zero.
841 2008-01-31  Roland McGrath  <roland@redhat.com>
843         * Makefile (omit-deps): Variable removed.
845 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
847         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
848         unnecessary addr32 prefix.
850 2008-01-29  Roland McGrath  <roland@redhat.com>
852         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
854 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
856         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
858 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
860         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
861         a scratch register.
862         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
863         (__lll_lock_wait_private): Fix typo.
864         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
865         (pthread_barrier_wait): Likewise.  Adjust XADD use.
866         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
867         Adjust XADD use.
868         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
869         (pthread_rwlock_timedrdlock): Return correct return value.
870         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
871         (pthread_rwlock_timedwrlock): Likewise.
873 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
875         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
876         thread returns the program exits with an error code.
878 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
880         * pthread-errnos.sym: Add EOVERFLOW.
881         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
882         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
883         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
884         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
886 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
888         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
889         parameter.  Passed it as permission to mmap.
890         * allocatestack.c (allocate_stack): Pass prot as second parameter
891         to ARCH_RETRY_MMAP.
893 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
895         * tst-basic7.c: Allocate memory for the stack.
897         [BZ #5465]
898         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
899         (__pthread_cond_timedwait): Don't use VDSO.
900         Patch by Michal Januszewski.
902 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
904         [BZ #5455]
905         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
906         Allow label before pthread_cleanup_pop.
907         (pthread_cleanup_pop_restore_np): Likewise.
909 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
911         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
912         Store 2 before returning ETIMEDOUT.
914 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
916         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
917         Store 2 before returning ETIMEDOUT.
918         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
919         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
920         (__lll_lock_wait_private): Optimize.
921         (__lll_lock_wait): Likewise.
923 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
925         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
926         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
927         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
929 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
931         [BZ #5240]
932         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
933         If we time out, try one last time to lock the futex to avoid
934         losing a wakeup signal.
935         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
936         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
938         [BZ #5245]
939         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
940         if necessary.
942 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
944         [BZ #5245]
945         * allocatestack.c (allocate_stack): Change ENOMEM error in case
946         mmap failed to EAGAIN.
947         * Makefile (tests): Add tst-basic7.
948         * tst-basic7.c: New file.
950 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
952         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
953         Use __linkin_atfork.
955 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
957         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
958         missing line continuations.
959         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
960         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
962 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
964         [BZ #5220]
965         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
966         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
967         (struct timer): Add next element.
968         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
969         enqueue timer structure into __active_timer_sigev_thread list.
970         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
971         remove timer struct from __active_timer_sigev_thread.
972         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
973         Before using timer structure make sure it is still on the
974         __active_timer_sigev_thread list.  Keep lock until done.
975         Define __active_timer_sigev_thread and
976         __active_timer_sigev_thread_lock.
978 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
980         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
981         Redefine thread_atfork for use of ATFORK_MEM.
982         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
983         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
984         function.
985         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
986         Use atomic operation when removing first element of list.
988 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
990         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
991         routine instead of an alias to __new_sem_post.
993 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
995         * init.c (__pthread_initialize_minimal): Initialize word to appease
996         valgrind.
998 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
1000         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
1001         libc.so just clear NAME.
1002         (__libc_rwlock_fini): Nop inside of libc.so.
1003         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
1004         all zeros.
1006 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
1008         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1009         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
1010         unlocking failed.
1011         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
1013 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
1015         [BZ #4938]
1016         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
1017         reclaimed stack if necessary.
1018         * Makefile (tests): Add tst-tsd6.
1019         * tst-tsd6.c: New file.
1021 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1023         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
1024         Add private argument.
1026 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
1028         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1029         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
1031 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
1033         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
1034         (__lll_robust_timedlock): Pass private as last argument to
1035         __lll_robust_timedlock_wait.
1036         (__lll_unlock): Fix a pasto.
1038 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1040         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
1041         sparc_old_sem): New structs.
1042         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
1043         (__sem_wait_cleanup): New function.
1044         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
1045         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1046         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1047         lll_futex_wait.
1048         (__old_sem_wait): New function.
1049         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
1050         nptl/sysdeps/unix/sysv/linux/sparc version.
1051         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
1052         Likewise.
1053         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
1054         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
1055         (__new_sem_trywait): Use sparc_old_sem structure.
1056         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
1057         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
1058         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1059         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1060         lll_futex_timed_wait.
1061         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
1062         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
1063         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1064         lll_futex_wake.
1065         (__old_sem_post): New function.
1066         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
1067         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
1068         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
1069         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
1070         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
1071         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
1073 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1075         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1076         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1077         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1078         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1079         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
1080         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1081         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1082         Use FUTEX_WAKE_OP.
1083         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1084         kernel-features.h and tcb-offsets.h.
1085         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1086         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1087         process private.
1088         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1089         tcb-offsets.h.
1090         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
1091         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1092         process private.
1093         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
1094         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1095         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1096         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1097         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1098         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1099         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1101 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
1103         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
1104         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1105         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
1106         lll_futex_timed_wait.
1108         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
1109         __lll_robust_unlock): Rewrite as macros instead of inline functions.
1110         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
1111         __lll_robust_unlock, __lll_wait_tid): Likewise.
1113 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1115         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1116         Fix a pasto.
1117         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1118         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1119         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1120         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1121         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1122         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1123         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1124         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
1125         kernel-features.h.
1126         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1127         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1128         process private.  Switch DW_CFA_advance_loc1 and some
1129         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1130         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1131         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
1132         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1133         process private.  Switch DW_CFA_advance_loc{1,2} and some
1134         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1135         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
1136         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1137         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1138         Likewise.
1139         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1140         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1141         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1142         Likewise.
1143         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1144         (__pthread_cond_broadcast): Compare %r8 instead of
1145         dep_mutex-cond_*(%rdi) with $-1.
1146         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1147         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1148         of oring.
1150 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1152         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1154 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1156         * allocatestack.c: Include kernel-features.h.
1157         * pthread_create.c: Likewise.
1158         * pthread_mutex_init.c: Likewise.
1159         * init.c: Likewise.
1160         * pthread_cond_timedwait.c: Likewise.
1161         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1162         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1163         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1164         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1165         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1166         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1167         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1168         Likewise.
1169         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1170         Likewise.
1171         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1172         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1173         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1174         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1176 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1178         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1179         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1180         byte elements.  One of them is the new __shared element.
1181         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1182         adjust names of other padding elements.
1183         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1184         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1185         byte elements.  One of them is the new __shared element.
1186         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1187         adjust names of other padding elements.
1188         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1189         Renamed __pad1 element to __shared, adjust names of other padding
1190         elements.
1191         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1192         (pthread_rwlock_t): Likewise.
1193         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1194         typo.
1196 2007-08-09  Anton Blanchard  <anton@samba.org>
1198         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1200 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1202         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1203         <kernel-features.h>.
1204         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1206 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1208         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1209         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1210         dealing with robust mutexes.
1211         * pthread_mutex_timedlock.c: Likewise.
1212         * pthread_mutex_trylock.c: Likewise.
1213         * pthread_mutex_unlock.c: Likewise.
1214         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1216 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1218         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1219         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1220         (PTHREAD_MUTEX_PSHARED): Define.
1221         * pthread_mutex_init.c (__pthread_mutex_init): Set
1222         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1223         mutexes.
1224         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1225         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1226         as second argument to lll_lock.
1227         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1228         instead of its __data.__lock field.
1229         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1230         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1231         to lll_robust_lock.
1232         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1233         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1234         instead of mutex->__data.__kind directly, pass
1235         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1236         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1237         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1238         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1239         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1240         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1241         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1242         of mutex->__data.__kind directly.
1243         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1244         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1245         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1246         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1247         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1248         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1249         and lll_futex_wake.
1250         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1251         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1252         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1253         directly.
1254         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1255         Take mutex as argument instead of its __data.__lock field, pass
1256         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1257         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1258         __data.__lock field.
1259         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1260         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1261         to lll_robust_cond_lock.
1262         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1263         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1264         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1265         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1266         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1267         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1268         lll_futex_wait.
1269         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1270         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1271         lll_futex_wake.
1272         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1273         pshared variable, pass it to lll_lock, lll_unlock,
1274         lll_futex_timedwait and lll_futex_wake.
1275         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1276         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1277         and lll_futex_wake.
1278         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1279         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1280         macro.
1281         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1282         lll_futex_wake_unlock): Likewise.
1283         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1284         Likewise.
1285         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1286         lll_futex_wake_unlock): Likewise.
1287         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1288         Likewise.
1289         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1290         lll_futex_wake_unlock): Likewise.
1291         (lll_futex_wake): Fix a typo.
1292         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1293         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1294         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1295         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1296         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1297         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1298         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1299         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1300         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1301         (__pthread_cond_timedwait): Likewise.
1302         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1303         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1305 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1307         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1308         Don't use CGOTSETUP and CGOTRESTORE macros.
1309         (CGOTSETUP, CGOTRESTORE): Remove.
1310         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1311         @local symbol.
1313 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1315         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1316         definitions for private futexes.
1317         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1318         kernel-features.h and lowlevellock.h.  Use private futexes if
1319         they are available.
1320         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1321         (__lll_mutex_lock_wait): Rename to
1322         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1323         (__lll_mutex_timedlock_wait): Rename to ...
1324         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1325         Don't compile in for libc.so.
1326         (__lll_mutex_unlock_wake): Rename to ...
1327         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1328         (__lll_timedwait_tid): Use __NR_gettimeofday.
1329         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1330         the header from assembler.  Renamed all lll_mutex_* resp.
1331         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1332         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1333         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1334         Define.
1335         (__lll_lock_wait_private): Add prototype.
1336         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1337         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1338         __lll_unlock_wake): Likewise.
1339         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1340         if private is constant LLL_PRIVATE.
1341         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1342         lll_timedlock, lll_robust_timedlock): Add private argument.
1343         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1344         if private is constant LLL_PRIVATE.
1345         (lll_robust_unlock, lll_robust_dead): Add private argument.
1346         (lll_lock_t): Remove.
1347         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1348         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1349         lll_cond_wake, lll_cond_broadcast): Remove.
1350         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1351         kernel-features.h and lowlevellock.h.
1352         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1353         (LOAD_FUTEX_WAIT): Define.
1354         (__lll_robust_mutex_lock_wait): Rename to ...
1355         (__lll_robust_lock_wait): ... this.  Add private argument.
1356         Use LOAD_FUTEX_WAIT macro.
1357         (__lll_robust_mutex_timedlock_wait): Rename to ...
1358         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1359         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1360         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1361         lowlevellock.h.
1362         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1363         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1364         __lll_mutex_{lock,unlock}_*.
1365         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1366         lowlevellock.h and pthread-errnos.h.
1367         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1368         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1369         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1370         __lll_mutex_{lock,unlock}_*.
1371         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1372         lowlevellock.h and pthread-errnos.h.
1373         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1374         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1375         __lll_mutex_{lock,unlock}_*.
1376         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1377         lowlevellock.h.
1378         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1379         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1380         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1381         (__condvar_tw_cleanup): Likewise.
1382         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1383         lowlevellock.h.
1384         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1385         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1386         __lll_mutex_{lock,unlock}_*.
1387         ( __condvar_w_cleanup): Likewise.
1388         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1389         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1390         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1391         lowlevellock.h.
1392         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1393         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1394         __lll_mutex_{lock,unlock}_*.
1395         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1396         lowlevellock.h.
1397         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1398         FUTEX_PRIVATE_FLAG): Remove.
1399         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1400         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1401         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1402         lowlevellock.h.
1403         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1404         FUTEX_PRIVATE_FLAG): Remove.
1405         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1406         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1407         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1408         lowlevellock.h.
1409         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1410         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1411         __lll_mutex_{lock,unlock}_*.
1412         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1413         lowlevellock.h.
1414         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1415         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1416         __lll_mutex_{lock,unlock}_*.
1417         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1418         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1419         (__new_sem_post): Use standard initial exec code sequences.
1420         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1421         lowlevellock.h.
1422         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1423         FUTEX_PRIVATE_FLAG): Remove.
1424         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1425         exec code sequences.
1426         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1427         (__new_sem_trywait): Use standard initial exec code sequences.
1428         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1429         (__new_sem_wait): Use standard initial exec code sequences.
1431 2007-07-31  Anton Blanchard  <anton@samba.org>
1433         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1434         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1435         atomic_full_barrier.
1437 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1439         * allocatestack.c (stack_cache_lock): Change type to int.
1440         (get_cached_stack, allocate_stack, __deallocate_stack,
1441         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1442         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1443         as second argument to lll_lock and lll_unlock macros on
1444         stack_cache_lock.
1445         * pthread_create.c (__find_in_stack_list): Likewise.
1446         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1447         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1448         as second argument.
1449         * descr.h (struct pthread): Change lock and setxid_futex field
1450         type to int.
1451         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1452         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1453         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1454         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1455         Likewise.
1456         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1457         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1458         * pthreadP.h (__attr_list_lock): Change type to int.
1459         * pthread_attr_init.c (__attr_list_lock): Likewise.
1460         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1461         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1462         lll_{,un}lock.
1463         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1464         also for lll_futex_{wake,wait}.
1465         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1466         a pointer to const.
1467         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1468         LLL_SHARED as second argument to lll_{,un}lock.
1469         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1470         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1471         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1472         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1473         Likewise.
1474         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1475         as second argument to lll_{,un}lock macros on pd->lock.
1476         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1477         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1478         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1479         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1480         Likewise.
1481         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1482         Likewise.
1483         * pthread_once.c (once_lock): Change type to int.
1484         (__pthread_once): Pass LLL_PRIVATE as second argument to
1485         lll_{,un}lock macros on once_lock.
1486         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1487         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1488         rwlock->__data.__shared as second argument to them and similarly
1489         for lll_futex_w*.
1490         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1491         Likewise.
1492         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1493         Likewise.
1494         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1495         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1496         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1497         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1498         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1499         to lll_{,un}lock macros on __sem_mappings_lock.
1500         * sem_open.c (check_add_mapping): Likewise.
1501         (__sem_mappings_lock): Change type to int.
1502         * semaphoreP.h (__sem_mappings_lock): Likewise.
1503         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1504         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1505         instead of lll_*mutex_*, pass LLL_SHARED as last
1506         argument.
1507         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1508         pass LLL_SHARED as last argument.
1509         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1510         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1511         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1512         pass LLL_SHARED as last argument.
1513         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1514         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1515         LLL_SHARED as last argument.
1516         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1517         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1518         Similarly.
1519         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1520         __libc_lock_lock_recursive, __libc_lock_unlock,
1521         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1522         argument to lll_{,un}lock.
1523         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1524         _IO_lock_unlock): Likewise.
1525         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1526         compound literal.
1527         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1528         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1529         __fork_lock.
1530         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1531         free_mem): Likewise.
1532         (__fork_lock): Change type to int.
1533         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1534         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1535         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1536         lll_futex_wake.
1537         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1538         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1539         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1540         New function.
1541         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1542         pass it through to lll_futex_*wait, only compile in when
1543         IS_IN_libpthread.
1544         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1545         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1546         argument and pass it through to lll_futex_*wait.
1547         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1548         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1549         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1550         inline functions to __lll_* resp. __lll_robust_*.
1551         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1552         (lll_mutex_dead): Add private argument.
1553         (__lll_lock_wait_private): New prototype.
1554         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1555         __lll_robust_lock_timedwait): Add private argument to prototypes.
1556         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1557         call __lll_lock_wait_private, otherwise pass private to
1558         __lll_lock_wait.
1559         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1560         __lll_robust_timedlock): Add private argument, pass it to
1561         __lll_*wait functions.
1562         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1563         call __lll_unlock_wake_private, otherwise pass private to
1564         __lll_unlock_wake.
1565         (__lll_robust_unlock): Add private argument, pass it to
1566         __lll_robust_unlock_wake.
1567         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1568         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1569         argument, pass it through to __lll_* inline function.
1570         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1571         (lll_lock_t): Remove.
1572         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1573         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1574         lll_cond_wake, lll_cond_broadcast): Remove.
1575         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1576         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1577         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1578         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1579         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1580         the header from assembler.  Renamed all lll_mutex_* resp.
1581         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1582         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1583         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1584         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1585         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1586         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1587         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1588         Remove prototype.
1589         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1590         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1591         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1592         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1593         MULTIPLE_THREADS_OFFSET as another asm operand.
1594         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1595         MULTIPLE_THREADS_OFFSET as last asm operand, call
1596         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1597         otherwise pass private as another argument to __lll_lock_wait.
1598         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1599         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1600         private as another argument to __lll_*lock_wait call.
1601         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1602         MULTIPLE_THREADS_OFFSET as another asm operand, call
1603         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1604         otherwise pass private as another argument to __lll_unlock_wake.
1605         (lll_robust_unlock): Add private argument, pass private as another
1606         argument to __lll_unlock_wake.
1607         (lll_robust_dead): Add private argument, use __lll_private_flag
1608         macro.
1609         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1610         LLL_MUTEX_LOCK_INITIALIZER.
1611         (lll_lock_t): Remove.
1612         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1613         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1614         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1615         lll_cond_wake, lll_cond_broadcast): Remove.
1616         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1617         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1618         2007-05-2{3,9} changes.
1619         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1620         kernel-features.h and lowlevellock.h.
1621         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1622         (LOAD_FUTEX_WAIT): Rewritten.
1623         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1624         define.
1625         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1626         (__lll_mutex_lock_wait): Rename to ...
1627         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1628         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1629         (__lll_mutex_timedlock_wait): Rename to ...
1630         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1631         contains private argument.  Don't compile in for libc.so.
1632         (__lll_mutex_unlock_wake): Rename to ...
1633         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1634         Don't compile in for libc.so.
1635         (__lll_timedwait_tid): Use __NR_gettimeofday.
1636         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1637         kernel-features.h and lowlevellock.h.
1638         (LOAD_FUTEX_WAIT): Define.
1639         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1640         define.
1641         (__lll_robust_mutex_lock_wait): Rename to ...
1642         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1643         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1644         macro.
1645         (__lll_robust_mutex_timedlock_wait): Rename to ...
1646         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1647         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1648         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1649         lowlevellock.h.
1650         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1651         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1652         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1653         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1654         to __lll_lock_wait in %edx.
1655         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1656         Include lowlevellock.h and pthread-errnos.h.
1657         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1658         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1659         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1660         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1661         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1662         __lll_unlock_wake.
1663         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1664         Include lowlevellock.h and pthread-errnos.h.
1665         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1666         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1667         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1668         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1669         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1670         __lll_unlock_wake.
1671         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1672         Include lowlevellock.h.
1673         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1674         Don't define.
1675         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1676         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1677         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1678         __lll_unlock_wake.  Use __NR_gettimeofday.
1679         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1680         Include lowlevellock.h.
1681         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1682         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1683         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1684         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1685         and __lll_unlock_wake.
1686         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1687         Include lowlevellock.h.
1688         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1689         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1690         MUTEX(%ebx) address in %edx rather than %ecx to
1691         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1692         and __lll_unlock_wake.  Move return value from %ecx to %edx
1693         register.
1694         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1695         Include lowlevellock.h.
1696         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1697         Don't define.
1698         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1699         MUTEX(%ebp) address in %edx rather than %ecx to
1700         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1701         and __lll_unlock_wake.  Move return value from %ecx to %edx
1702         register.  Use __NR_gettimeofday.
1703         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1704         Include lowlevellock.h.
1705         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1706         Don't define.
1707         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1708         MUTEX(%ebp) address in %edx rather than %ecx to
1709         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1710         and __lll_unlock_wake.  Move return value from %ecx to %edx
1711         register.  Use __NR_gettimeofday.
1712         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1713         Include lowlevellock.h.
1714         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1715         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1716         MUTEX(%edi) address in %edx rather than %ecx to
1717         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1718         and __lll_unlock_wake.
1719         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1720         Include lowlevellock.h.
1721         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1722         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1723         MUTEX(%ebx) address in %edx rather than %ecx to
1724         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1725         and __lll_unlock_wake.  Move return value from %ecx to %edx
1726         register.
1727         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1728         lowlevellock.h.
1729         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1730         define.
1731         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1732         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1733         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1734         lowlevellock.h.
1735         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1736         (sem_timedwait): Use __NR_gettimeofday.
1737         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1738         lowlevellock.h.
1739         (LOCK): Don't define.
1740         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1741         lowlevellock.h.
1742         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1743         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1744         are waiters.
1745         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1746         2007-05-2{3,9} changes.
1747         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1748         kernel-features.h and lowlevellock.h.
1749         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1750         (LOAD_FUTEX_WAIT): Rewritten.
1751         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1752         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1753         (__lll_mutex_lock_wait): Rename to ...
1754         (__lll_lock_wait): ... this.  %esi is now private argument.
1755         Don't compile in for libc.so.
1756         (__lll_mutex_timedlock_wait): Rename to ...
1757         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1758         Don't compile in for libc.so.
1759         (__lll_mutex_unlock_wake): Rename to ...
1760         (__lll_unlock_wake): ... this.  %esi contains private argument.
1761         Don't compile in for libc.so.
1762         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1763         kernel-features.h and lowlevellock.h.
1764         (LOAD_FUTEX_WAIT): Define.
1765         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1766         (__lll_robust_mutex_lock_wait): Rename to ...
1767         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1768         Use LOAD_FUTEX_WAIT macro.
1769         (__lll_robust_mutex_timedlock_wait): Rename to ...
1770         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1771         private, use LOAD_FUTEX_WAIT macro.
1772         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1773         lowlevellock.h.
1774         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1775         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1776         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1777         __lll_lock_wait and __lll_unlock_wake.
1778         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1779         Include lowlevellock.h and pthread-errnos.h.
1780         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1781         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1782         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1783         pass LLL_SHARED in %esi to both __lll_lock_wait and
1784         __lll_unlock_wake.
1785         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1786         Include lowlevellock.h and pthread-errnos.h.
1787         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1788         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1789         (__pthread_cond_signal): 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_timedwait.S:
1793         Include lowlevellock.h.
1794         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1795         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1796         pass LLL_SHARED in %esi to both __lll_lock_wait and
1797         __lll_unlock_wake.
1798         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1799         Include lowlevellock.h.
1800         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1801         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1802         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1803         and __lll_unlock_wake.
1804         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1805         Include lowlevellock.h.
1806         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1807         Don't define.
1808         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1809         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1810         and __lll_unlock_wake.
1811         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1812         Include lowlevellock.h.
1813         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1814         Don't define.
1815         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1816         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1817         and __lll_unlock_wake.
1818         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1819         Include lowlevellock.h.
1820         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1821         Don't define.
1822         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1823         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1824         and __lll_unlock_wake.
1825         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1826         Include lowlevellock.h.
1827         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1828         Don't define.
1829         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1830         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1831         and __lll_unlock_wake.
1832         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1833         Include lowlevellock.h.
1834         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1835         Don't define.
1836         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1837         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1838         and __lll_unlock_wake.
1839         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1840         lowlevellock.h.
1841         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1842         define.
1843         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1844         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1845         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1846         lowlevellock.h.
1847         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1848         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1849         lowlevellock.h.
1850         (LOCK): Don't define.
1851         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1852         lowlevellock.h.
1853         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1854         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1855         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1856         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1857         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1858         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1859         (__lll_lock_wait_private): New function.
1860         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1861         it to lll_futex_*wait.  Don't compile in for libc.so.
1862         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1863         Remove.
1864         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1865         (struct sparc_pthread_barrier): Remove.
1866         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1867         struct sparc_pthread_barrier.  Pass
1868         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1869         and lll_futex_wait macros.
1870         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1871         Remove.
1872         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1873         Include sparc pthread_barrier_wait.c instead of generic one.
1875 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1877         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1879         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1880         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1881         %ecx.
1882         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1883         (pthread_rwlock_timedwrlock): Likewise.
1884         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1885         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1887 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1889         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1891 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1893         * tst-locale2.c (useless): Add return statement.
1895 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1897         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1898         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1899         * pthread_create.c (start_thread): Likewise.
1900         * init.c (sighandler_setxid): Likewise.
1901         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1902         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1903         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1904         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1905         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1906         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1907         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1908         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1909         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1910         Likewise.
1911         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1912         Likewise.
1913         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1914         Likewise.
1915         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1916         __rtld_notify): Likewise.
1917         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1918         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1919         __pthread_once): Likewise.
1920         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1921         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1922         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1923         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1924         (lll_futex_wait): Add private argument, define as wrapper around
1925         lll_futex_timed_wait.
1926         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1927         use __lll_private_flag macro.
1928         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1929         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1930         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1931         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1932         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1933         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1934         (lll_futex_wait): Add private argument, define as wrapper around
1935         lll_futex_timed_wait.
1936         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1937         use __lll_private_flag macro.
1938         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1939         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1940         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1941         Define.
1942         (lll_futex_timed_wait, lll_futex_wake): Use it.
1943         (lll_private_futex_wait, lll_private_futex_timed_wait,
1944         lll_private_futex_wake): Removed.
1945         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1946         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1947         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1948         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1949         (lll_futex_wait): Add private argument, define as wrapper around
1950         lll_futex_timed_wait.
1951         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1952         use __lll_private_flag macro.
1953         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1954         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1955         to lll_futex_*.
1956         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1957         (lll_private_futex_wait, lll_private_futex_timed_wait,
1958         lll_private_futex_wake): Removed.
1959         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1960         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1961         (lll_private_futex_wait, lll_private_futex_timed_wait,
1962         lll_private_futex_wake): Removed.
1963         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1964         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1965         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1966         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1967         (lll_futex_wait): Add private argument, define as wrapper around
1968         lll_futex_timed_wait.
1969         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1970         use __lll_private_flag macro.
1971         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1972         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1973         to lll_futex_*.
1974         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1975         Define.
1976         (lll_futex_timed_wait, lll_futex_wake): Use it.
1977         (lll_private_futex_wait, lll_private_futex_timed_wait,
1978         lll_private_futex_wake): Removed.
1980 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1982         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1983         of the structure for sparc32.
1985 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1987         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1989 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1991         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1992         code used when private futexes are assumed.
1993         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1994         Likewise.
1996 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1998         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1999         (__lll_private_flag): Define.
2000         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
2001         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
2002         __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         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2007         (__lll_private_flag): Define.
2008         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
2009         (lll_private_futex_wait, lll_private_futex_timedwait,
2010         lll_private_futex_wake): Define as wrapper around non-_private
2011         macros.
2013 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
2015         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
2016         parameter to lll_futex_wait call.
2017         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
2019         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2020         Replace lll_futex_wait with lll_private_futex_wait.
2021         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
2022         Add LLL_SHARED parameter to lll_futex_wake().
2024         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
2025         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
2026         lll_private_futex_wake.
2027         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
2028         bit from private parm before syscall.
2029         (lll_futex_timed_wait): Likewise.
2030         (lll_futex_wake): Likewise.
2031         (lll_futex_wake_unlock): Likewise.
2032         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
2033         (lll_robust_mutex_unlock): Likewise.
2034         (lll_mutex_unlock_force): Likewise.
2035         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
2037 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
2039         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
2040         compilation when unconditionally using private futexes.
2041         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2042         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2043         Likewise.
2044         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2045         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2047 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
2049         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
2050         Define.
2052 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2054         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
2055         kernel-features.h.
2057 2007-05-16  Roland McGrath  <roland@redhat.com>
2059         * init.c (__nptl_initial_report_events): New variable.
2060         (__pthread_initialize_minimal_internal): Initialize pd->report_events
2061         to that.
2063 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
2065         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
2066         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2068 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
2070         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
2071         implementation.
2073 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
2075         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
2076         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
2077         * pthread_mutex_timedlock.c: Likewise.
2078         * pthread_mutex_trylock.c: Likewise.
2079         * pthread_mutex_unlock.c: Likewise.
2081 2007-06-17  Andreas Schwab  <schwab@suse.de>
2083         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
2084         sections.
2086 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
2088         * allocatestack.c (allocate_stack): Make code compile if
2089         __ASSUME_PRIVATE_FUTEX is set.
2091 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2093         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
2094         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
2095         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
2096         (__pthread_rwlock_wrlock): Likewise.
2097         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2098         (pthread_rwlock_timedrdlock): Likewise.
2099         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2100         (pthread_rwlock_timedwrlock): Likewise.
2101         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
2102         (__pthread_rwlock_unlock): Likewise.
2104 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2106         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
2107         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
2108         Split __flags into __flags, __shared, __pad1 and __pad2.
2109         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
2110         futexes if they are available.
2111         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
2112         in libc-lowlevellock.S allow using private futexes.
2113         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2114         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
2115         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
2116         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
2117         lll_private_futex_timed_wait and lll_private_futex_wake.
2118         (lll_robust_mutex_unlock): Fix typo.
2119         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
2120         field in futex command setup.
2121         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
2122         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
2123         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2124         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
2125         if they are available.  Remove clear_once_control.
2126         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
2127         futexes if they are available.
2128         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2129         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2130         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2131         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2132         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
2133         Wake only when there are waiters.
2134         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
2135         support.  Indicate that there are waiters.  Remove unnecessary
2136         extra cancellation test.
2137         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
2138         left-over duplication of __sem_wait_cleanup.
2140 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2142         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2143         parameter to lll_futex_wait, lll_futex_timed_wait, and
2144         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2145         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2146         lll_private_futex_wake.
2147         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2148         * allocatestack.c: Adjust use of lll_futex_* macros.
2149         * init.c: Likewise.
2150         * lowlevellock.h: Likewise.
2151         * pthread_barrier_wait.c: Likewise.
2152         * pthread_cond_broadcast.c: Likewise.
2153         * pthread_cond_destroy.c: Likewise.
2154         * pthread_cond_signal.c: Likewise.
2155         * pthread_cond_timedwait.c: Likewise.
2156         * pthread_cond_wait.c: Likewise.
2157         * pthread_create.c: Likewise.
2158         * pthread_mutex_lock.c: Likewise.
2159         * pthread_mutex_setprioceiling.c: Likewise.
2160         * pthread_mutex_timedlock.c: Likewise.
2161         * pthread_mutex_unlock.c: Likewise.
2162         * pthread_rwlock_timedrdlock.c: Likewise.
2163         * pthread_rwlock_timedwrlock.c: Likewise.
2164         * pthread_rwlock_unlock.c: Likewise.
2165         * sysdeps/alpha/tls.h: Likewise.
2166         * sysdeps/i386/tls.h: Likewise.
2167         * sysdeps/ia64/tls.h: Likewise.
2168         * sysdeps/powerpc/tls.h: Likewise.
2169         * sysdeps/pthread/aio_misc.h: Likewise.
2170         * sysdeps/pthread/gai_misc.h: Likewise.
2171         * sysdeps/s390/tls.h: Likewise.
2172         * sysdeps/sh/tls.h: Likewise.
2173         * sysdeps/sparc/tls.h: Likewise.
2174         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2175         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2176         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2177         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2178         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2179         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2180         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2181         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2182         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2183         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2184         Likewise.
2185         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2186         * sysdeps/x86_64/tls.h: Likewise.
2188 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2190         * pthread_getattr_np.c: No need to install a cancellation handler,
2191         this is no cancellation point.
2192         * pthread_getschedparam.c: Likewise.
2193         * pthread_setschedparam.c: Likewise.
2194         * pthread_setschedprio.c: Likewise.
2195         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2196         lll_unlock_wake_cb.
2197         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2198         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2199         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2200         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2201         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2202         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2203         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2204         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2205         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2206         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2207         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2208         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2210         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2211         whether there are more than one thread makes no sense here since
2212         we only call the slow path if the locks are taken.
2213         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2215         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2216         COND_NWAITERS_SHIFT.
2217         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2218         COND_CLOCK_BITS.
2219         * pthread_cond_init.c: Likewise.
2220         * pthread_cond_timedwait.c: Likewise.
2221         * pthread_cond_wait.c: Likewise.
2222         * pthread_condattr_getclock.c: Likewise.
2223         * pthread_condattr_setclock.c: Likewise.
2224         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2225         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2226         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2227         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2228         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2230 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2232         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2233         unistd.h.
2235         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2236         insn suffix.
2237         (THREAD_GSCOPE_GET_FLAG): Remove.
2238         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2239         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2240         changes.
2241         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2242         (THREAD_GSCOPE_GET_FLAG): Remove.
2243         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2244         instead of THREAD_GSCOPE_GET_FLAG.
2245         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2246         it.
2247         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2248         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2249         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2250         THREAD_GSCOPE_WAIT): Define.
2251         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2252         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2253         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2254         THREAD_GSCOPE_WAIT): Define.
2255         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2256         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2257         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2258         THREAD_GSCOPE_WAIT): Define.
2259         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2260         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2261         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2262         THREAD_GSCOPE_WAIT): Define.
2264 2007-05-24  Richard Henderson  <rth@redhat.com>
2266         * descr.h (struct pthread): Add header.gscope_flag.
2267         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2268         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2269         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2270         THREAD_GSCOPE_WAIT): Define.
2272 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2274         * init.c: Make it compile with older kernel headers.
2276         * tst-initializers1.c: Show through exit code which test failed.
2278         * pthread_rwlock_init.c: Also initialize __shared field.
2279         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2280         element in rwlock structure into four byte elements.  One of them is
2281         the new __shared element.
2282         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2283         Likewise.
2284         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2285         __shared, adjust names of other padding elements.
2286         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2287         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2288         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2289         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2290         FUTEX_PRIVATE_FLAG.
2291         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2292         futex to use private operations if possible.
2293         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2294         Likewise.
2295         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2296         Likewise.
2297         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2298         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2299         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2300         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2301         Likewise.
2302         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2303         Likewise.
2304         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2305         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2307 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2309         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2310         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2311         * pthread_rwlock_timedrdlock.c: Likewise.
2312         * pthread_rwlock_tryrdlock.c: Likewise.
2314         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2315         optimization.
2317         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2318         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2319         duplication of __sem_wait_cleanup.
2321         * allocatestack.c: Revert last change.
2322         * init.c: Likewise.
2323         * sysdeps/i386/tls.h: Likewise.
2324         * sysdeps/x86_64/tls.h: Likewise.
2325         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2326         header structure.
2327         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2329         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2330         Add private field.
2331         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2332         * pthread_barrier_init.c: Set private flag if pshared and private
2333         futexes are supported.
2334         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2335         private field in futex command setup.
2336         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2338 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2340         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2341         support.
2342         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2343         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2344         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2345         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2346         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2348         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2349         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2350         fields in the structure.
2351         (__old_sem_init): New function.
2352         * sem_open.c: Initialize all fields of the structure.
2353         * sem_getvalue.c: Adjust for renamed element.
2354         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2355         (gen-as-const-headers): Add structsem.sym.
2356         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2357         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2358         struct new_sem.  Add struct old_sem.
2359         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2360         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2361         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2362         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2363         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2364         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2365         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2366         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2367         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2368         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2369         * tst-sem10.c: New file.
2370         * tst-sem11.c: New file.
2371         * tst-sem12.c: New file.
2372         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2373         of struct sem.
2375 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2376             Jakub Jelinek  <jakub@redhat.com>
2378         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2379         Move __pthread_enable_asynccancel right before futex syscall.
2380         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2381         Likewise.
2383 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2385         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2386         THREAD_COPY_PRIVATE_FUTEX): Define.
2387         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2388         THREAD_COPY_PRIVATE_FUTEX): Define.
2389         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2390         * init.c (__pthread_initialize_minimal_internal): Use
2391         THREAD_SET_PRIVATE_FUTEX.
2393         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2394         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2395         THREAD_GSCOPE_FLAG_WAIT): Define.
2396         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2397         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2398         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2399         PTR_DEMANGLE.
2400         (THREAD_GSCOPE_GET_FLAG): Define.
2401         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2402         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2403         instead of ->header.gscope_flag directly.
2405 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2407         * init.c (__pthread_initialize_minimal_internal): Check whether
2408         private futexes are available.
2409         * allocatestack.c (allocate_stack): Copy private_futex field from
2410         current thread into the new stack.
2411         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2412         futexes if they are available.
2413         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2414         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2415         in libc-lowlevellock.S allow using private futexes.
2416         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2417         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2418         FUTEX_PRIVATE_FLAG.
2419         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2420         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2421         if they are available.
2422         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2423         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2424         * sysdeps/i386/tcb-offsets.sym: Likewise.
2425         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2426         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2428 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2430         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2431         Remove ptr_wait_lookup_done again.
2432         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2433         (__pthread_initialize_minimal_internal): Initialize
2434         _dl_wait_lookup_done pointer in _rtld_global directly.
2435         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2436         Remove code to code _dl_wait_lookup_done.
2437         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2438         encrypted for now.
2440 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2442         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2443         pthread_mutex_init failed with ENOTSUP.
2445 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2447         * allocatestack.c (__wait_lookup_done): New function.
2448         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2449         Add ptr_wait_lookup_done.
2450         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2451         * pthreadP.h: Declare __wait_lookup_done.
2452         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2453         Define macros to implement reference handling of global scope.
2454         * sysdeps/x86_64/tls.h: Likewise.
2455         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2456         Initialize GL(dl_wait_lookup_done).
2458 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2460         [BZ #4512]
2461         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2462         is detected.
2463         * pthread_mutex_timedlock.c: Likewise.
2464         * pthread_mutex_trylock.c: Likewise.
2465         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2467         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2468         * tst-robust9.c: New file.
2469         * tst-robustpi9.c: New file.
2471         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2472         unnecessary extra cancellation test.
2474 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2476         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2477         extra cancellation test.
2478         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2480 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2482         * descr.h (struct pthread): Rearrange members to fill hole in
2483         64-bit layout.
2485         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2486         (__pthread_setaffinity_new): If syscall was successful and
2487         RESET_VGETCPU_CACHE is defined, use it before returning.
2488         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2490 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2492         [BZ #4455]
2493         * tst-align2.c: Include stackinfo.h.
2494         * tst-getpid1.c: Likewise.
2496 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2498         [BZ #4455]
2499         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2500         * tst-getpid1.c (do_test): Likewise.
2502         [BZ #4456]
2503         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2504         (allocate_stack): Likewise.
2506 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2508         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2509         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2510         (__lll_robust_timedlock_wait): Likewise.
2511         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2513 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2515         [BZ #4465]
2516         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2517         * tst-cancel4.c (tf_fdatasync): New test.
2519 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2521         [BZ #4392]
2522         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2523         check mutexes like normal mutexes.
2525         [BZ #4306]
2526         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2527         Initialize the whole sigevent structure to appease valgrind.
2529 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2531         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2532         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2534 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2536         * tst-locale1.c: Avoid warnings.
2537         * tst-locale2.c: Likewise.
2539 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2541         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2542         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2544 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2546         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2547         __extern_always_inline where appropriate.
2548         * sysdeps/pthread/pthread.h: Likewise.
2550 2007-03-13  Richard Henderson  <rth@redhat.com>
2552         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2553         separate cfi regions for the two subsections.
2555 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2557         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2558         new thread, don't just decrement it.
2559         Patch by Suzuki K P <suzuki@in.ibm.com>.
2561 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2563         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2564         PTHFCT_CALL definition.
2566 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2568         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2569         available, don't use it.
2571 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2573         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2574         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2575         call into the kernel to delay.
2577 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2579         * tst-initializers1.c: We want to test the initializers as seen
2580         outside of libc, so undefined _LIBC.
2582         * pthread_join.c (cleanup): Avoid warning.
2584 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2586         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2587         (__lll_timedwait_tid): Add unwind info.
2589         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2590         function table, mangle the pointers.
2591         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2592         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2593         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2594         demangle pointers before use.
2595         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2596         demangle pointer.
2597         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2598         * sysdeps/pthread/setxid.h: Likewise.
2600 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2602         * tst-rwlock7.c: Show some more information in case of correct
2603         behavior.
2605 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2607         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2608         (lll_futex_timed_wait): Undo part of last change, don't negate
2609         return value.
2611 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2613         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2614         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2616 2006-12-28  David S. Miller  <davem@davemloft.net>
2618         * shlib-versions: Fix sparc64 linux target specification.
2620 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2622         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2623         Adjust include path for pthread_barrier_wait.c move.
2625 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2627         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2628         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2630 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2632         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2633         6 argument cancellable syscalls.
2634         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2635         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2636         6 argument cancellable syscalls.
2637         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2639 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2641         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2642         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2644 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2646         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2647         __sync_lock_release instead of __sync_lock_release_si.
2649 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2651         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2652         Define.
2653         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2654         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2655         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2656         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2657         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2658         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2659         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2660         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2661         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2662         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2663         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2665 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2667         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2668         * pthread_barrier_wait.c: ...here.
2669         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2670         * pthread_cond_broadcast.c: ...here.
2671         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2672         * pthread_cond_signal.c: ...here.
2673         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2674         * pthread_cond_timedwait.c: ...here.
2675         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2676         * pthread_cond_wait.c: ...here.
2677         * sysdeps/pthread/pthread_once.c: Move to...
2678         * pthread_once.c: ...here.
2679         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2680         * pthread_rwlock_rdlock.c: ...here.
2681         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2682         * pthread_rwlock_timedrdlock.c: ...here.
2683         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2684         * pthread_rwlock_timedwrlock.c: ...here.
2685         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2686         * pthread_rwlock_unlock.c: ...here.
2687         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2688         * pthread_rwlock_wrlock.c: ...here.
2689         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2690         * pthread_spin_destroy.c: ...here.
2691         * sysdeps/pthread/pthread_spin_init.c: Move to...
2692         * pthread_spin_init.c: ...here.
2693         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2694         * pthread_spin_unlock.c: ...here.
2695         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2696         * pthread_getcpuclockid.c: ...here.
2698         * init.c: USE_TLS support is now always enabled.
2699         * tst-tls5.h: Likewise.
2700         * sysdeps/alpha/tls.h: Likewise.
2701         * sysdeps/i386/tls.h: Likewise.
2702         * sysdeps/ia64/tls.h: Likewise.
2703         * sysdeps/powerpc/tls.h: Likewise.
2704         * sysdeps/s390/tls.h: Likewise.
2705         * sysdeps/sh/tls.h: Likewise.
2706         * sysdeps/sparc/tls.h: Likewise.
2707         * sysdeps/x86_64/tls.h: Likewise.
2709 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2711         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2712         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2713         failed.
2715         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2716         Define to THREAD_SELF->header.multiple_threads.
2717         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2718         Likewise.
2719         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2720         Likewise.
2721         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2722         (SINGLE_THREAD_P): Likewise.
2723         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2724         (SINGLE_THREAD_P): Likewise.
2725         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2726         (SINGLE_THREAD_P): Likewise.
2727         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2728         (SINGLE_THREAD_P): Likewise.
2729         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2730         Likewise.
2731         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2732         (SINGLE_THREAD_P): Likewise.
2733         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2734         (SINGLE_THREAD_P): Likewise.
2735         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2736         Likewise.
2738 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2740         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2741         by default rather than 2_3_3.
2743 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2745         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2746         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2747         atomic_* instead of catomic_* macros.
2749 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2751         [BZ #3285]
2752         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2753         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2754         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2755         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2756         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2757         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2758         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2759         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2760         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2761         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2762         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2763         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2764         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2766 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2768         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2769         cancelable syscalls with six parameters.
2771         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2772         operations instead of atomic_*.
2774 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2776         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2778 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2780         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2781         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2782         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2783         New file.
2784         * pthread_attr_setstack.c: Allow overwriting the version number of the
2785         new symbol.
2786         * pthread_attr_setstacksize.c: Likewise.
2787         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2788         it.
2789         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2790         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2792 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2794         [BZ #3251]
2795         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2796         Patch by Petr Baudis.
2798 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2800         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2802         * tst-cancel2.c (tf): Loop as long as something was written.
2804 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2806         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2807         mutexes wake all mutexes.
2808         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2809         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2810         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2812 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2814         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2815         to guarantee the thread is always canceled.
2817 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2819         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2820         Include stdlib.h.
2821         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2822         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2823         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2824         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2825         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2827 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2829         [BZ #3123]
2830         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2831         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2832         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2833         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2834         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2835         * Makefile (tests): Add tst-cond22.
2836         * tst-cond22.c: New file.
2838 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2840         [BZ #3124]
2841         * descr.h (struct pthread): Add parent_cancelhandling.
2842         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2843         cancelhandling value to child.
2844         * pthread_create.c (start_thread): If parent thread was canceled
2845         reset the SIGCANCEL mask.
2846         * Makefile (tests): Add tst-cancel25.
2847         * tst-cancel25.c: New file.
2849 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2850             Ulrich Drepper  <drepper@redhat.com>
2852         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2853         counterp if it is already zero.
2854         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2856 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2857             Roland McGrath  <roland@redhat.com>
2859         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2860         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2861         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2862         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2863         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2864         lll_robust_mutex_timedlock, lll_mutex_unlock,
2865         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2866         Add _L_*_ symbols around the subsection.
2867         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2868         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2870 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2871             Roland McGrath  <roland@redhat.com>
2873         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2874         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2875         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2876         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2877         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2878         lll_robust_mutex_timedlock, lll_mutex_unlock,
2879         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2880         Add _L_*_ symbols around the subsection.
2881         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2882         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2884 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2886         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2887         change because it can disturb too much existing code.  If real hard
2888         reader preference is needed we'll introduce another type.
2889         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2890         (pthread_rwlock_timedwrlock): Likewise.
2891         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2892         Likewise.
2894 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2896         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2897         reader preference.
2898         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2899         (pthread_rwlock_timedwrlock): Likewise.
2900         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2901         Likewise.
2903 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2905         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2906         Only define ifdef SHARED.
2908 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2910         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2911         (free_stacks): ...here.
2912         (__free_stack_cache): New function.
2913         * pthreadP.h: Declare __free_stack_cache.
2914         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2915         ptr_freeres.
2916         * init.c (pthread_functions): Initialize ptr_freeres.
2917         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2918         New freeres function.
2920 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2922         [BZ #3018]
2923         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2925 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2927         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2928         _XOPEN_REALTIME_THREADS.
2930 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2932         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2933         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2934         HAVE_CLOCK_GETTIME_VSYSCALL.
2935         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2937 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2939         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2940         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2941         * descr.h (struct priority_protection_data): New type.
2942         (struct pthread): Add tpp field.
2943         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2944         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2945         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2946         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2947         TPP mutexes.
2948         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2949         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2950         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2951         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2952         * tpp.c: New file.
2953         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2954         boosted by TPP.
2955         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2956         * pthread_mutexattr_getprioceiling.c
2957         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2958         in the SCHED_FIFO priority range.
2959         * pthread_mutexattr_setprioceiling.c
2960         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2961         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2962         if mutex is not TPP.  Ceiling is now in __data.__lock.
2963         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2964         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2965         is now in __data.__lock.  Add locking.
2966         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2967         * Makefile (libpthread-routines): Add tpp.
2968         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2969         * tst-tpp.h: New file.
2970         * tst-mutexpp1.c: New file.
2971         * tst-mutexpp6.c: New file.
2972         * tst-mutexpp10.c: New file.
2973         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2974         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2976 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2978         [BZ #2843]
2979         * pthread_join.c (pthread_join): Account for self being canceled
2980         when checking for deadlocks.
2981         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2982         (tf1): Don't print anything after pthread_join returns, this would be
2983         another cancellation point.
2984         (tf2): Likewise.
2985         * tst-join6.c: New file.
2986         * Makefile (tests): Add tst-join6.
2988 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2990         [BZ #2892]
2991         * pthread_setspecific.c (__pthread_setspecific): Check
2992         out-of-range index before checking for unused key.
2994         * sysdeps/pthread/gai_misc.h: New file.
2996 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2998         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2999         file.  Don't use sysctl.
3000         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
3001         overwrite the file if this is likely not true.
3003 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
3005         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
3006         * Makefile (tests): Add tst-getpid3.
3007         * tst-getpid3.c: New file.
3009 2006-07-30  Roland McGrath  <roland@redhat.com>
3011         * Makefile (libpthread-routines): Add ptw-sigsuspend.
3013         * sysdeps/unix/sysv/linux/i386/not-cancel.h
3014         (pause_not_cancel): New macro.
3015         (nanosleep_not_cancel): New macro.
3016         (sigsuspend_not_cancel): New macro.
3017         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
3018         nanosleep_not_cancel macro from <not-cancel.h>.
3019         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
3020         macro from <not-cancel.h>.
3022 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
3023             Jakub Jelinek  <jakub@redhat.com>
3025         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
3026         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
3027         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
3028         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
3029         * pthread_mutex_init.c: Add support for priority inheritance mutex.
3030         * pthread_mutex_lock.c: Likewise.
3031         * pthread_mutex_timedlock.c: Likewise.
3032         * pthread_mutex_trylock.c: Likewise.
3033         * pthread_mutex_unlock.c: Likewise.
3034         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
3035         all mutexes.
3036         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
3037         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
3038         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
3039         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
3040         pthread-pi-defines.sym.
3041         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
3042         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
3043         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3044         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
3045         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3046         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3047         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3048         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
3049         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
3050         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3051         _POSIX_THREAD_PRIO_INHERIT to 200112L.
3052         * tst-mutex1.c: Adjust to allow use in PI mutex test.
3053         * tst-mutex2.c: Likewise.
3054         * tst-mutex3.c: Likewise.
3055         * tst-mutex4.c: Likewise.
3056         * tst-mutex5.c: Likewise.
3057         * tst-mutex6.c: Likewise.
3058         * tst-mutex7.c: Likewise.
3059         * tst-mutex7a.c: Likewise.
3060         * tst-mutex8.c: Likewise.
3061         * tst-mutex9.c: Likewise.
3062         * tst-robust1.c: Likewise.
3063         * tst-robust7.c: Likewise.
3064         * tst-robust8.c: Likewise.
3065         * tst-mutexpi1.c: New file.
3066         * tst-mutexpi2.c: New file.
3067         * tst-mutexpi3.c: New file.
3068         * tst-mutexpi4.c: New file.
3069         * tst-mutexpi5.c: New file.
3070         * tst-mutexpi6.c: New file.
3071         * tst-mutexpi7.c: New file.
3072         * tst-mutexpi7a.c: New file.
3073         * tst-mutexpi8.c: New file.
3074         * tst-mutexpi9.c: New file.
3075         * tst-robust1.c: New file.
3076         * tst-robust2.c: New file.
3077         * tst-robust3.c: New file.
3078         * tst-robust4.c: New file.
3079         * tst-robust5.c: New file.
3080         * tst-robust6.c: New file.
3081         * tst-robust7.c: New file.
3082         * tst-robust8.c: New file.
3083         * Makefile (tests): Add the new tests.
3085         * pthread_create.c (start_thread): Add some casts to avoid warnings.
3086         * pthread_mutex_destroy.c: Remove unneeded label.
3088 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
3090         * pthread_mutex_init.c (__pthread_mutex_init): Move some
3091         computations to compile time.
3093 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
3095         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
3097 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
3099         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
3101 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
3103         * pthread_key_create.c (__pthread_key_create): Do away with
3104         __pthread_keys_lock.
3106         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3107         (__kernel_cpumask_size): Mark as hidden.
3108         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3110         * sem_open.c (__sem_mappings_lock): Mark as hidden.
3111         * semaphoreP.h (__sem_mappings_lock): Likewise.
3113 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
3115         * pthread_atfork.c: Mark __dso_handle as hidden.
3117 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
3119         [BZ #2644]
3120         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
3121         the reload problem.  Change the one path in pthread_cancel_init
3122         which causes the problem.  Force gcc to reload.  Simplify callers.
3123         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
3124         (_Unwind_GetBSP): Undo last patch.
3126 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3128         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
3129         function pointer is reloaded after pthread_cancel_init calls.
3131         [BZ #2644]
3132         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
3133         pointers are reloaded after pthread_cancel_init calls.
3135 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
3137         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
3138         __always_inline.
3140 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3142         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3143         Allocate new object which is passed to timer_sigev_thread so that
3144         the timer can be deleted before the new thread is scheduled.
3146 2006-04-26  Roland McGrath  <roland@redhat.com>
3148         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3150 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3152         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3153         suffix for conditional jumps.
3154         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3155         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3156         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3157         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3158         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3159         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3161         * init.c (sigcancel_handler): Compare with correct PID even if the
3162         thread is in the middle of a fork call.
3163         (sighandler_setxid): Likewise.
3164         Reported by Suzuki K P <suzuki@in.ibm.com> .
3166 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3168         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3170 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3172         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3173         fails [Coverity CID 105].
3175 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3177         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3179 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3181         [BZ #2505]
3182         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3183         Define __lll_rel_instr using lwsync.
3185 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3187         * allocatestack.c (allocate_stack): Always initialize robust_head.
3188         * descr.h: Define struct robust_list_head.
3189         (struct pthread): Use robust_list_head in robust mutex list definition.
3190         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3191         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3192         (__pthread_initialize_minimal_internal): Register robust_list with
3193         the kernel.
3194         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3195         Declare __set_robust_list_avail.
3196         * pthread_create.c (start_thread): Register robust_list of new thread.
3197         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3198         waiters.
3199         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3200         number of users, it's unreliable.
3201         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3202         set_robust_list syscall is available.
3203         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3204         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3205         Set robust_head.list_op_pending before trying to lock a robust mutex.
3206         * pthread_mutex_timedlock.c: Likewise.
3207         * pthread_mutex_trylock.c: Likewise.
3208         * pthread_mutex_unlock.c: Likewise for unlocking.
3209         * Makefile (tests): Add tst-robust8.
3210         * tst-robust8.c: New file.
3212 2006-03-08  Andreas Schwab  <schwab@suse.de>
3214         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3215         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3217 2006-03-05  Roland McGrath  <roland@redhat.com>
3219         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3220         and $config_os doesn't match *linux*.
3222 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3224         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3225         Use __syscall_error.
3226         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3227         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3228         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3229         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3230         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3231         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3233 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3235         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3237 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3239         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3240         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3241         mutex.
3242         (__lll_robust_timedlock_wait): Likewise.
3243         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3244         (__lll_robust_lock_wait): Likewise.
3245         (__lll_robust_timedlock_wait): Likewise.
3246         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3247         (__lll_robust_lock_wait): Likewise.
3248         (__lll_robust_timedlock_wait): Likewise.
3250 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3252         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3253         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3254         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3255         lll_robust_mutex_unlock): Define.
3256         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3258 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3260         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3261         instead of <clone.S>.
3263 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3265         * Makefile (libpthread-routines): Add
3266         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3267         and pthread_mutex_[sg]etprioceiling.
3268         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3269         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3270         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3271         pthread_mutex_setprioceiling.
3272         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3273         PTHREAD_PRIO_PROTECT): New enum values.
3274         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3275         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3276         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3277         prototypes.
3278         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3279         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3280         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3281         Define.
3282         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3283         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3284         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3285         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3286         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3287         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3288         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3289         protocol mutexes.
3290         * pthread_mutex_getprioceiling.c: New file.
3291         * pthread_mutex_setprioceiling.c: New file.
3292         * pthread_mutexattr_getprioceiling.c: New file.
3293         * pthread_mutexattr_setprioceiling.c: New file.
3294         * pthread_mutexattr_getprotocol.c: New file.
3295         * pthread_mutexattr_setprotocol.c: New file.
3297 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3299         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3301 2006-02-27  Roland McGrath  <roland@redhat.com>
3303         * sysdeps/pthread/Subdirs: List nptl here too.
3304         * configure (libc_add_on_canonical): New variable.
3306         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3308         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3309         self to get main source tree's file.
3310         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3311         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3312         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3313         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3314         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3315         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3316         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3317         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3318         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3319         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3320         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3321         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3322         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3324         * Makefile: Use $(sysdirs) in vpath directive.
3326         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3327         (CPPFLAGS-timer_routines.c): Likewise.
3329         * Makeconfig (includes): Variable removed.
3331 2006-02-26  Roland McGrath  <roland@redhat.com>
3333         * sysdeps/generic/pt-raise.c: Moved to ...
3334         * pt-raise.c: ... here.
3335         * sysdeps/generic/lowlevellock.h: Moved to ...
3336         * lowlevellock.h: ... here.
3338 2006-02-23  Roland McGrath  <roland@redhat.com>
3340         * descr.h (struct pthread): Add final member `end_padding'.
3341         (PTHREAD_STRUCT_END_PADDING): Use it.
3343 2006-02-20  Roland McGrath  <roland@redhat.com>
3345         * sysdeps/mips: Directory removed, saved in ports repository.
3346         * sysdeps/unix/sysv/linux/mips: Likewise.
3348 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3350         * tst-robust1.c: Add second mutex to check that the mutex list is
3351         handled correctly.
3353 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3355         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3356         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3357         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3358         lll_robust_mutex_unlock): New macros.
3359         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3360         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3361         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3362         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3363         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3365 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3367         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3368         definitions.
3369         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3371 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3373         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3374         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3375         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3376         (lll_robust_mutex_unlock): Likewise.
3378 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3380         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3381         Set robust_list.__next rather than robust_list.
3382         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3383         (__pthread_list_t): New typedef.
3384         (pthread_mutex_t): Replace __next and __prev fields with __list.
3385         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3386         (__pthread_list_t): New typedef.
3387         (pthread_mutex_t): Replace __next and __prev fields with __list.
3388         * sysdeps/unix/sysv/linux/powerpc/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/s390/bits/pthreadtypes.h
3392         (__pthread_list_t, __pthread_slist_t): New typedefs.
3393         (pthread_mutex_t): Replace __next and __prev fields with __list.
3394         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3395         (__pthread_list_t, __pthread_slist_t): New typedefs.
3396         (pthread_mutex_t): Replace __next and __prev fields with __list.
3397         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3398         (__pthread_slist_t): New typedef.
3399         (pthread_mutex_t): Replace __next field with __list.
3401 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3403         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3404         PTHREAD_MUTEX_OWNERDEAD.
3405         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3406         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3407         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3408         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3409         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3410         to PTHREAD_MUTEX_INCONSISTENT.
3411         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3412         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3413         * pthread_mutex_trylock.c: Likewise.
3414         * pthread_mutex_timedlock.c: Likewise.
3415         * pthread_mutex_unlock.c: Likewise.
3416         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3417         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3418         lowlevelrobustlock.sym.
3419         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3420         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3421         definitions.
3422         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3423         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3424         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3425         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3426         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3428 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3430         * allocatestack.c (allocate_stack): Initialize robust_list.
3431         * init.c (__pthread_initialize_minimal_internal): Likewise.
3432         * descr.h (struct xid_command): Pretty printing.
3433         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3434         robust_list.  Adjust macros.
3435         * pthread_create.c (start_thread): Adjust robust_list handling.
3436         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3437         but the owner for all robust mutex types.
3438         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3439         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3440         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3441         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3443         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3444         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3446 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3448         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3449         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3451 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3453         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3454         Return status.
3455         (lll_futex_timed_wait): Define.
3457 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3459         * tst-cancel4.c: Test ppoll.
3461 2006-01-18  Andreas Jaeger  <aj@suse.de>
3463         [BZ #2167]
3464         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3465         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3466         by Jim Gifford <patches@jg555.com>.
3468 2006-01-13  Richard Henderson  <rth@redhat.com>
3470         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3472 2006-01-10  Roland McGrath  <roland@redhat.com>
3474         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3475         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3476         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3477         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3478         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3479         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3480         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3481         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3482         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3483         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3485 2006-01-09  Roland McGrath  <roland@redhat.com>
3487         * tst-initializers1-c89.c: New file.
3488         * tst-initializers1-c99.c: New file.
3489         * tst-initializers1-gnu89.c: New file.
3490         * tst-initializers1-gnu99.c: New file.
3491         * Makefile (tests): Add them.
3492         (CFLAGS-tst-initializers1-c89.c): New variable.
3493         (CFLAGS-tst-initializers1-c99.c): New variable.
3494         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3495         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3497         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3498         Use __extension__ on anonymous union definition.
3499         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3500         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3501         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3502         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3503         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3505 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3507         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3508         Don't give the union a name because it changes the mangled name.
3509         Instead name the struct for __data.
3510         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3511         Likewise.
3512         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3513         Likewise.
3515 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3517         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3518         stack bias to mc_ftp field.
3520 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3522         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3523         being too clever and reloading the futex value where it shouldn't.
3525 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3527         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3528         correct type.
3530 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3532         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3533         Add cfi directives.
3535 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3537         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3538         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3539         rename in tcbhead_t.
3541         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3542         Don't give the union a name because it changes the mangled name.
3543         Instead name the struct for __data.
3544         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3545         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3546         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3547         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3548         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3549         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3551 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3553         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3554         Return status.
3555         (lll_futex_timed_wait): Define.
3556         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3557         * sysdeps/pthread/aio_misc.h: New file.
3559 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3561         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3563 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3565         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3566         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3567         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3569 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3571         * tst-cancel24.cc: Use C headers instead of C++ headers.
3573 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3575         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3576         sparc-linux configured glibc.
3577         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3578         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3579         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3580         atomic_compare_and_exchange_val_24_acq instead of
3581         atomic_compare_and_exchange_val_acq.
3582         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3583         instead of atomic_exchange_rel.
3584         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3585         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3586         file.
3587         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3588         file.
3589         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3590         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3591         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3592         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3593         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3594         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3595         New file.
3596         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3597         New file.
3598         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3599         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3600         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3601         file.
3602         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3603         file.
3604         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3606 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3608         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3609         mutex initializers.
3611 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3613         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3614         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3615         THREAD_COPY_POINTER_GUARD): Define.
3616         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3617         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3619 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3621         * version.c: Update copyright year.
3623 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3625         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3626         .eh_frame section, use cfi_* directives.
3627         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3629 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3631         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3632         now.
3634 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3636         * sysdeps/pthread/sigaction.c: Removed.
3637         * sigaction.c: New file.
3638         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3640 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3642         * Makefile (tests): Add tst-signal7.
3643         * tst-signal7.c: New file.
3645 2005-12-27  Roland McGrath  <roland@redhat.com>
3647         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3648         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3649         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3650         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3651         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3652         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3653         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3654         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3655         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3656         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3657         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3659 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3661         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3662         and __prev field to pthread_mutex_t.
3663         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3664         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3665         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3666         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3667         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3668         to pthread_mutex_t.
3670 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3672         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3673         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3674         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3675         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3676         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3677         and PTHREAD_MUTEXATTR_FLAG_BITS.
3678         * descr.h (struct pthread): Add robust_list field and define
3679         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3680         * pthread_mutexattr_getrobust.c: New file.
3681         * pthread_mutexattr_setrobust.c: New file.
3682         * pthread_mutex_consistent.c: New file.
3683         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3684         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3685         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3686         Adjust pthread_mutex_t initializers.
3687         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3688         field to pthread_mutex_t.
3689         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3690         and __prev field to pthread_mutex_t.
3691         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3692         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3693         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3694         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3695         * pthread_mutexattr_gettype.c: Likewise.
3696         * pthread_mutexattr_setpshared.c: Likewise.
3697         * pthread_mutexattr_settype.c: Likewise.
3698         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3699         Initialize mutex kind according to robust flag.
3700         * pthread_mutex_lock.c: Implement local robust mutex.
3701         * pthread_mutex_timedlock.c: Likewise.
3702         * pthread_mutex_trylock.c: Likewise.
3703         * pthread_mutex_unlock.c: Likewise.
3704         * pthread_create.c (start_thread): Mark robust mutexes which remained
3705         locked as dead.
3706         * tst-robust1.c: New file.
3707         * tst-robust2.c: New file.
3708         * tst-robust3.c: New file.
3709         * tst-robust4.c: New file.
3710         * tst-robust5.c: New file.
3711         * tst-robust6.c: New file.
3712         * tst-robust7.c: New file.
3713         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3714         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3715         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3716         tst-robust5, tst-robust6, and tst-robust7.
3718         * tst-typesizes.c: New file.
3719         * Makefile (tests): Add tst-typesizes.
3721         * tst-once3.c: More debug output.
3723 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3725         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3726         missing after last change.
3728         * version.c: Update copyright year.
3730 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3732         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3733         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3734         * pthread_mutex_trylock.c: Likewise.
3735         * pthread_mutex_timedlock.c: Likewise.
3736         * pthread_mutex_unlock.c: Likewise.
3738 2005-12-22  Roland McGrath  <roland@redhat.com>
3740         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3741         so that #include_next's search location is not reset to the -I..
3742         directory where <nptl/...> can be found.
3744 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3746         [BZ #1913]
3747         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3748         Fix unwind info.  Remove useless branch prediction prefix.
3749         * tst-cancel24.cc: New file.
3750         * Makefile: Add rules to build and run tst-cancel24.
3752 2005-12-21  Roland McGrath  <roland@redhat.com>
3754         * libc-cancellation.c: Use <> rather than "" #includes.
3755         * pt-cleanup.c: Likewise.
3756         * pthread_create.c: Likewise.
3757         * pthread_join.c: Likewise.
3758         * pthread_timedjoin.c: Likewise.
3759         * pthread_tryjoin.c: Likewise.
3760         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3761         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3762         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3763         * unwind.c: Likewise.
3765 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3767         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3768         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3769         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3770         THREAD_COPY_POINTER_GUARD): Define.
3772 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3774         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3775         rather than one.
3776         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3777         THREAD_COPY_POINTER_GUARD): Define.
3778         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3779         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3780         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3781         THREAD_COPY_POINTER_GUARD): Define.
3782         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3783         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3784         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3785         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3786         Use PTR_DEMANGLE for B0 if defined.
3788 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3790         * pthread_create.c (__pthread_create_2_1): Use
3791         THREAD_COPY_POINTER_GUARD if available.
3792         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3793         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3794         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3795         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3796         * sysdeps/x86_64/tls.h: Likewise.
3798 2005-12-15  Roland McGrath  <roland@redhat.com>
3800         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3802 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3804         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3805         sysdeps/generic.
3806         * errno-loc.c: New file.
3808 2005-12-12  Roland McGrath  <roland@redhat.com>
3810         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3811         adjustments before choosing stack size.  Update minimum stack size
3812         calculation to match allocate_stack change.
3814 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3816         * allocatestack.c (allocate_stack): Don't demand that there is an
3817         additional full page available on the stack beside guard, TLS, the
3818         minimum stack.
3820 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3822         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3823         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3825         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3826         compiling 32-bit code we must define __cleanup_fct_attribute.
3828 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3830         [BZ #1920]
3831         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3832         __attribute__ instead of __attribute.
3833         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3834         (__cleanup_fct_attribute): Likewise.
3836 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3838         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3839         a write barrier before writing libgcc_s_getcfa.
3841 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3843         * sysdeps/unix/sysv/linux/configure: Removed.
3845 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3847         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3848         optional init_array/fini_array support.
3850 2005-10-24  Roland McGrath  <roland@redhat.com>
3852         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3853         versioned_symbol use.
3855 2005-10-16  Roland McGrath  <roland@redhat.com>
3857         * init.c (__pthread_initialize_minimal_internal): Even when using a
3858         compile-time default stack size, apply the minimum that allocate_stack
3859         will require, and round up to page size.
3861 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3863         * Makefile ($(test-modules)): Remove static pattern rule.
3865 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3866             Ulrich Drepper  <drepper@redhat.com>
3868         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3869         alignment in callback function.
3870         * Makefile: Add rules to build and run tst-align3.
3871         * tst-align3.c: New file.
3873 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3875         * allocatestack.c (setxid_signal_thread): Add
3876         INTERNAL_SYSCALL_DECL (err).
3878 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3880         * allocatestack.c (setxid_signal_thread): Need to use
3881         atomic_compare_and_exchange_bool_acq.
3883 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3884             Jakub Jelinek  <jakub@redhat.com>
3886         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3887         CANCEL_RESTMASK.
3888         (struct pthread): Move specific_used field to avoid padding.
3889         Add setxid_futex field.
3890         * init.c (sighandler_setxid): Reset setxid flag and release the
3891         setxid futex.
3892         * allocatestack.c (setxid_signal_thread): New function.  Broken
3893         out of the bodies of the two loops in __nptl_setxid.  For undetached
3894         threads check whether they are exiting and if yes, don't send a signal.
3895         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3896         * pthread_create.c (start_thread): For undetached threads, check
3897         whether setxid bit is set.  If yes, wait until signal has been
3898         processed.
3900         * allocatestack.c (STACK_VARIABLES): Initialize them.
3901         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3903 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3905         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3906         waiters, awake all waiters on the associated mutex.
3908 2005-09-22  Roland McGrath  <roland@redhat.com>
3910         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3911         ../sysdeps/x86_64/hp-timing.h).
3913 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3915         * sysdeps/unix/sysv/linux/powerpc/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/alpha/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/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3922         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3923         (lll_futex_wake_unlock): Define.
3924         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3925         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3926         (lll_futex_wake_unlock): Define.
3927         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3928         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3929         (lll_futex_wake_unlock): Define.
3930         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3931         lll_futex_wake_unlock.
3932         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3933         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3934         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3935         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3936         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3937         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3939 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3941         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3942         Fix typo in register name.
3944 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3946         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3947         Use __sigfillset.  Document that sigfillset does the right thing wrt
3948         to SIGSETXID.
3950 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3952         [BZ #1102]
3953         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3954         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3955         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3956         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3957         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3958         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3959         in the structure.
3960         * Makefile (tests): Add tst-initializers1.
3961         (CFLAGS-tst-initializers1.c): Set.
3962         * tst-initializers1.c: New test.
3964 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3966         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3967         Make sure __flags are located at offset 48 from the start of the
3968         structure.
3970 2005-07-02  Roland McGrath  <roland@redhat.com>
3972         * Makeconfig: Comment fix.
3974 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3976         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3977         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3978         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3979         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3980         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3981         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3982         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3983         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3984         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3985         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3987 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3989         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3990         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3991         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3992         fields.
3993         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3994         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3995         field.  Put in sysinfo field unconditionally.
3996         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3997         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3998         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3999         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
4000         fields.
4001         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
4002         * pthread_create.c (__pthread_create_2_1): Use
4003         THREAD_COPY_STACK_GUARD macro.
4004         * Makefile: Add rules to build and run tst-stackguard1{,-static}
4005         tests.
4006         * tst-stackguard1.c: New file.
4007         * tst-stackguard1-static.c: New file.
4009 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
4011         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
4012         Invoke CGOTSETUP and CGOTRESTORE.
4013         (CGOTSETUP, CGOTRESTORE): Define.
4015 2005-05-29  Richard Henderson  <rth@redhat.com>
4017         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
4018         (tf_write, tf_writev): Use it.
4019         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
4020         the system minimum.
4022 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
4024         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
4025         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
4026         __librt_*_asynccancel@local.
4028 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
4030         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
4031         all occurrences of JUMPTARGET.  Instead append @local to labels.
4033 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
4035         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
4036         size/alignment of struct pthread rather than tcbhead_t.
4037         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4038         Likewise.
4039         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4040         Likewise.
4041         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
4042         Likewise.
4044 2005-05-19  Richard Henderson  <rth@redhat.com>
4046         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
4047         __sync_val_compare_and_swap, not explicit _si variant.
4048         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
4050 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
4052         [BZ #915]
4053         * sysdeps/pthread/pthread.h: Avoid empty initializers.
4055 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
4057         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
4058         .eh_frame section, use cfi_* directives.
4060 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
4062         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
4063         of "" includes.
4065 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
4067         [BZ #1075]
4068         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
4069         aio_write blocks.
4071 2005-04-27  Roland McGrath  <roland@redhat.com>
4073         * Makefile (tests): Remove tst-clock2.
4075         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4076         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
4077         translating to the kernel clockid_t for our own process/thread clock.
4079         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
4081 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
4083         * old_pthread_cond_init.c: Include <errno.h>.
4084         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
4085         process shared or uses clock other than CLOCK_REALTIME.
4086         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
4088 2005-04-13  David S. Miller  <davem@davemloft.net>
4090         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
4091         * sysdeps/sparc/sparc64/clone.S: New file.
4093 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4095         [BZ #1102]
4096         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
4097         __inline instead of inline.
4098         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
4100 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
4102         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
4103         functionally equivalent, but shorter instructions.
4104         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4105         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4106         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4107         Likewise.
4108         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
4109         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4110         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4111         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4112         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4113         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4114         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4115         Likewise.
4116         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4117         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4118         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4119         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4120         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4122 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
4124         * sysdeps/mips/Makefile: New file.
4125         * sysdeps/mips/nptl-sysdep.S: New file.
4126         * sysdeps/mips/tcb-offsets.sym: New file.
4127         * sysdeps/mips/pthread_spin_lock.S: New file.
4128         * sysdeps/mips/pthread_spin_trylock.S: New file.
4129         * sysdeps/mips/pthreaddef.h: New file.
4130         * sysdeps/mips/tls.h: New file.
4131         * sysdeps/mips/jmpbuf-unwind.h: New file.
4132         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
4133         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
4134         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
4135         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
4136         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
4137         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
4138         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
4139         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4140         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4141         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4143 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4145         [BZ #1112]
4146         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4147         variable to scerr.
4149 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4151         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4153 2005-02-25  Roland McGrath  <roland@redhat.com>
4155         * alloca_cutoff.c: Correct license text.
4156         * tst-unload.c: Likewise.
4157         * sysdeps/pthread/allocalim.h: Likewise.
4158         * sysdeps/pthread/pt-initfini.c: Likewise.
4159         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4160         * sysdeps/pthread/bits/sigthread.h: Likewise.
4161         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4162         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4164 2005-02-16  Roland McGrath  <roland@redhat.com>
4166         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4167         Use unsigned int * for ptr_nthreads.
4169 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4171         [BZ #721]
4172         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4173         gcc4.
4175 2005-02-07  Richard Henderson  <rth@redhat.com>
4177         [BZ #787]
4178         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4179         argument.
4181 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4183         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4184         order of arguments in invocation of atomic_add_zero.
4186 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4188         [BZ #737]
4189         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4190         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4191         at least gotntpoff relocation and addition.
4192         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4193         Likewise.
4194         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4195         Likewise.
4196         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4197         Likewise.
4199 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4201         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4202         entry for static tls deallocation fix.
4203         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4204         also contains information whether the memory pointed to is static
4205         TLS or not.
4206         * sysdeps/i386/tls.h: Likewise.
4207         * sysdeps/ia64/tls.h: Likewise.
4208         * sysdeps/powerpc/tls.h: Likewise.
4209         * sysdeps/s390/tls.h: Likewise.
4210         * sysdeps/sh/tls.h: Likewise.
4211         * sysdeps/sparc/tls.h: Likewise.
4212         * sysdeps/x86_64/tls.h: Likewise.
4214 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4216         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4218 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4220         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4221         %esp.
4222         * Makefile (tests): Add tst-align2.
4223         * tst-align2.c: New test.
4224         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4225         -mpreferred-stack-boundary=4.
4227 2004-12-18  Roland McGrath  <roland@redhat.com>
4229         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4230         New file removed withdrawn for the moment.
4232 2004-12-17  Richard Henderson  <rth@redhat.com>
4234         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4235         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4237 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4239         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4240         Increased PTHREAD_STACK_MIN.
4242         * tst-context1.c (stacks): Use bigger stack size.
4244 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4246         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4247         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4249 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4251         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4252         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4253         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4255 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4257         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4259 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4261         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4262         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4264         * tst-getpid1.c: If child crashes, report this first.  Print which
4265         signal.
4267 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4269         * init.c (__pthread_initialize_minimal_internal): Also unblock
4270         SIGSETXID.
4272 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4274         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4275         _POSIX_THREAD_CPUTIME): Define to 0.
4276         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4277         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4278         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4279         __timer_signal_thread_tclk): Remove.
4280         (init_module): Remove their initialization.
4281         (thread_cleanup): Remove their cleanup assertions.
4282         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4283         __timer_signal_thread_tclk): Remove.
4284         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4285         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4286         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4288 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4290         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4291         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4293         * Makefile (tests): Add tst-getpid2.
4294         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4295         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4296         * tst-getpid2.c: New test.
4298 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4300         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4302 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4304         * Makefile (tests): Add tst-getpid1.
4305         * tst-getpid1.c: New file.
4306         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4307         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4309 2004-12-02  Roland McGrath  <roland@redhat.com>
4311         * Makefile (libpthread-nonshared): Variable removed.
4312         ($(objpfx)libpthread_nonshared.a): Target removed.
4313         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4314         These are now handled by generic magic from
4315         libpthread-static-only-routines being set.
4317 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4319         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4320         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4321         _POSIX_THREAD_PRIO_PROTECT): Define.
4322         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4323         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4324         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4326 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4328         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4329         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4330         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4331         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4332         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4333         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4334         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4336 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4338         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4340         * Makefile (libpthread-routines): Add pthread_setschedprio.
4341         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4342         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4343         * pthread_setschedprio.c: New file.
4345 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4347         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4348         * pthread_cancel.c (pthread_create): Likewise.
4350         * Makefile (libpthread-routines): Add vars.
4351         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4352         * init.c (__default_stacksize, __is_smp): Remove.
4353         * vars.c: New file.
4354         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4355         and define a wrapper macro.
4356         (PTHREAD_STATIC_FN_REQUIRE): Define.
4357         * allocatestack.c (__find_thread_by_id): Undefine.
4358         * pthread_create (__pthread_keys): Remove.
4359         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4360         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4361         PTHREAD_STATIC_FN_REQUIRE.
4363 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4365         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4366         parameter to REGISTER macro.
4368 2004-11-17  Roland McGrath  <roland@redhat.com>
4370         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4371         Make sure SIGCANCEL is blocked as well.
4373 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4375         * sysdeps/pthread/setxid.h: New file.
4376         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4377         (struct xid_command): Add forward decl.
4378         (struct pthread_functions): Change return type of __nptl_setxid hook
4379         to int.
4380         * pthreadP.h (__nptl_setxid): Change return type to int.
4381         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4382         calling thread, return its return value and set errno on failure.
4383         * descr.h (struct xid_command): Change id type to long array.
4385         * Makefile: Add rules to build and test tst-setuid1 and
4386         tst-setuid1-static.
4387         * tst-setuid1.c: New test.
4388         * tst-setuid1-static.c: New test.
4390 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4392         * Makefile (tests): Add tst-exit3.
4393         * tst-exit3.c: New test.
4395 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4397         * Makefile (tests): Add tst-exit2.
4398         * tst-exit2.c: New file.
4400 2004-11-09  Roland McGrath  <roland@redhat.com>
4402         [BZ #530]
4403         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4404         here, before calling clone.
4405         * pthread_create.c (start_thread): Don't do it here.
4407 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4409         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4411 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4413         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4414         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4415         assembler warning.
4417 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4419         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4420         if sched_priority is not between minprio and maxprio.
4422 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4424         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4425         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4427         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4428         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4430 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4432         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4433         not-cancelable I/O functions.
4435 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4437         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4438         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4439         make sure 2 is stored in the futex and we looked at the old value.
4440         Fix a few other problems to return the correct value.
4442 2004-10-14  Richard Henderson  <rth@redhat.com>
4444         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4445         make gcc4 happy.
4447 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4449         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4450         of pthread-functions.h and pthreaddef.h.
4451         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4453         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4454         Change __data.__nwaiters from int to unsigned int.
4456         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4457         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4459         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4460         before return type.
4462         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4463         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4465 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4467         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4468         test fails, remove message queue.
4469         (tf_msgsnd): Likewise.
4471 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4473         * tst-clock1.c: Change #ifdef to #if defined.
4474         * tst-clock2.c: Likewise.
4475         * tst-cond11.c: Likewise.
4477         * sysdeps/pthread/timer_create.c (timer_create): Use
4478         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4479         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4480         THREAD_CPUTIME.
4482 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4484         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4485         _POSIX_THREAD_CPUTIME): Define to 0.
4487 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4489         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4490         and _POSIX_THREAD_CPUTIME to zero.
4491         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4492         * tst-barrier2.c: Fix testing for POSIX feature.
4493         * tst-clock1.c: Likewise.
4494         * tst-clock2.c: Likewise.
4495         * tst-cond11.c: Likewise.
4496         * tst-cond4.c: Likewise.
4497         * tst-cond6.c: Likewise.
4498         * tst-flock2.c: Likewise.
4499         * tst-mutex4.c: Likewise.
4500         * tst-mutex9.c: Likewise.
4501         * tst-rwlock12.c: Likewise.
4502         * tst-rwlock4.c: Likewise.
4503         * tst-signal1.c: Likewise.
4504         * tst-spin2.c: Likewise.
4505         * sysdeps/pthread/posix-timer.h: Likewise.
4506         * sysdeps/pthread/timer_create.c: Likewise.
4507         * sysdeps/pthread/timer_routines.c: Likewise.
4509 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4511         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4512         (__lll_mutex_timedlock_wait): Address futex correctly.
4514         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4515         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4516         make sure 2 is stored in the futex and we looked at the old value.
4517         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4518         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4519         which might very well made the code not working at all before.
4520         [BZ #417]
4522 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4524         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4525         allow SIGSETXID to be sent.
4526         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4527         for SIGSETXID to be defined.
4528         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4529         SIGSETXID cannot be blocked.
4531         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4532         Add __extension__ to long long types.
4533         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4534         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4535         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4536         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4537         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4538         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4539         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4541 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4543         * descr.h (struct pthread): Add stopped_start field.
4544         * sysdeps/pthread/createthread.c (create_thread): Set
4545         start_stopped flag in descriptor for new thread appropriately.
4546         * pthread_create.c (start_thread): Only take lock to be stopped on
4547         startup if stopped_start flag says so.
4549 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4551         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4552         is created detached and if yes, do not try to free the stack in case
4553         the thread creation failed.
4554         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4555         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4556         case there has been no error.  [BZ #405]
4558         * pthread_create.c (start_thread): Don't wait for scheduler data
4559         etc to be set at the beginning of the function.  The cancellation
4560         infrastructure must have been set up.  And enable async
4561         cancellation before potentially going to sleep.  [BZ #401]
4563 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4565         * Versions: Remove exports for pthread_set*id_np functions.
4566         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4567         for now.
4568         * Makefile: Don't build pthread_set*id code for now.
4570 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4572         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4573         internal use.
4574         * allocatestack.c (__nptl_setxid): New function.
4575         * descr.h (struct xid_command): Define type.
4576         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4577         (sighandler_setxid): New function.
4578         (__pthread_initialize_minimal): Register sighandler_setxid for
4579         SIGCANCEL.
4580         * pt-allocrtsig.c: Update comment.
4581         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4582         Declare __nptl_setxid.
4583         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4584         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4585         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4586         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4587         and pthread_setresuid_np.
4588         * pthread_setgid_np.c: New file.
4589         * pthread_setuid_np.c: New file.
4590         * pthread_setegid_np.c: New file.
4591         * pthread_seteuid_np.c: New file.
4592         * pthread_setregid_np.c: New file.
4593         * pthread_setreuid_np.c: New file.
4594         * pthread_setresgid_np.c: New file.
4595         * pthread_setresuid_np.c: New file.
4596         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4597         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4598         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4599         and pthread_setresuid_np.
4600         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4601         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4602         pthread_setregid, and pthread_setresgid.
4604 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4606         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4607         ENOMEM when out of memory.
4609 2004-09-10  Roland McGrath  <roland@redhat.com>
4611         [BZ #379]
4612         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4613         code, since we don't try to use the broken CLONE_STOPPED any more.
4614         * pthread_create.c (start_thread): Likewise.
4616 2004-09-15  Richard Henderson  <rth@redhat.com>
4618         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4620 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4622         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4623         (__libc_unwind_longjmp): Delete macro and declare as function.
4624         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4625         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4626         nptl directory.
4627         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4628         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4629         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4631 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4633         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4634         for __USE_XOPEN2K.
4635         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4636         types also for __USE_XOPEN2K.
4637         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4638         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4639         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4640         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4641         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4642         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4643         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4644         [BZ #320]
4646 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4648         * sysdeps/pthread/pthread.h
4649         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4650         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4651         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4652         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4653         [BZ #375]
4655 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4657         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4658         PSEUDO to be used with . prefix.
4660         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4661         Use atomic_increment instead of atomic_exchange_and_add.
4662         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4663         Likewise.
4664         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4665         Likewise.
4666         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4667         Likewise.
4669         * allocatestack.c (allocate_stack): Use atomic_increment_val
4670         instead of atomic_exchange_and_add.
4671         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4672         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4673         Likewise.
4674         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4675         Likewise.
4677         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4678         the initialization function might throw.
4680 2005-09-05  Richard Henderson  <rth@redhat.com>
4682         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4683         Move definition inside libpthread, libc, librt check.  Provide
4684         definition for rtld.
4686 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4688         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4689         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4690         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4691         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4692         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4693         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4694         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4695         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4696         * unwind.c: Use it.
4698         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4699         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4700         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4701         Likewise.
4702         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4703         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4704         this is the last waiter, signal pthread_cond_destroy caller and
4705         avoid using the pthread_cond_t structure after unlock.
4706         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4707         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4708         Read clock type from the least significant bits of __nwaiters instead
4709         of __clock.
4710         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4711         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4713 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4715         [BZ #342]
4716         * Makefile (tests): Add tst-cond20 and tst-cond21.
4717         * tst-cond20.c: New test.
4718         * tst-cond21.c: New test.
4719         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4720         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4721         it unsigned int.
4722         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4723         Likewise.
4724         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4725         (pthread_cond_t): Likewise.
4726         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4727         Likewise.
4728         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4729         Likewise.
4730         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4731         Likewise.
4732         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4733         (cond_nwaiters): New.
4734         (clock_bits): New.
4735         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4736         if there are waiters not signalled yet.
4737         Wait until all already signalled waiters wake up.
4738         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4739         __nwaiters.  If pthread_cond_destroy has been called and this is the
4740         last waiter, signal pthread_cond_destroy caller and avoid using
4741         the pthread_cond_t structure after unlock.
4742         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4743         decrement it when leaving.  If pthread_cond_destroy has been called
4744         and this is the last waiter, signal pthread_cond_destroy caller.
4745         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4746         Likewise.  Read clock type from the least significant bits of
4747         __nwaiters instead of __clock.
4748         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4749         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4750         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4751         clock type just from the last COND_CLOCK_BITS bits of value.
4752         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4753         instead of __clock, just from second bit of condattr's value.
4755 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4757         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4758         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4759         != 64.
4760         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4762 2004-08-15  Roland McGrath  <roland@frob.com>
4764         * pthread_atfork.c: Update copyright terms including special exception
4765         for these trivial files, which are statically linked into executables
4766         that use dynamic linking for the significant library code.
4768 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4770         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4771         pthread_rwlock_rdlock.
4772         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4773         Decrease __nr_readers_queued after reacquiring lock.
4774         * sysdeps/pthread/pthread_rwlock_timedrdlock
4775         (pthread_rwlock_timedrdlock): Likewise.
4776         Reported by Bob Cook <bobcook47@hotmail.com>.
4778 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4780         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4781         before pthread_barrier_wait.
4783 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4786         Remove unnecessary exception handling data.
4788 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4790         [BZ #284]
4791         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4792         instead of clockid_t.
4794 2004-07-21  Roland McGrath  <roland@redhat.com>
4796         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4798 2004-07-19  Roland McGrath  <roland@redhat.com>
4800         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4802 2004-07-02  Roland McGrath  <roland@redhat.com>
4804         * configure: Don't exit.
4806 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4808         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4809         (__pthread_cond_timedwait): Check for invalid nanosecond in
4810         timeout value.
4812 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4814         * Makefile: Add rules to build and run tst-fini1.
4815         * tst-fini1.c: New file.
4816         * tst-fini1mod.c: New file.
4818 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4820         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4821         if no cancellation support is needed.
4822         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4823         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4824         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4825         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4826         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4827         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4828         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4829         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4830         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4832         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4833         only if not already defined.
4835 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4837         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4838         constraint "m" instead of "0" for futex.
4840         * shlib-versions: Add powerpc64-.*-linux.*.
4842 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4844         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4845         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4846         for valid tv_nsec.
4847         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4848         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4849         bits.
4851 2004-06-29  Roland McGrath  <roland@redhat.com>
4853         * Banner: NPTL no longer has its own version number.
4854         * Makefile (nptl-version): Variable removed.
4855         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4856         using $(version), the glibc version number.
4858 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4860         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4861         Fix branch offset for a PLT entry.
4862         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4863         Likewise.
4864         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4865         Likewise.
4866         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4867         Likewise.
4868         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4869         Likewise.
4871 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4873         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4874         unconditionally.
4876 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4878         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4879         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4880         instead of tv_sec.
4881         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4882         (pthread_rwlock_timedrdlock): Likewise.
4884 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4886         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4887         Set __r7 to val, not mutex.
4889 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4891         * Makefile: Add rules to build tst-rwlock14.
4892         * tst-rwlock14.c: New file.
4894 2004-06-24  Boris Hu  <boris.hu@intel.com>
4896         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4897         check.
4898         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4900 2004-06-19  Andreas Jaeger  <aj@suse.de>
4902         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4903         assembler in last patch.
4905 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4907         * sysdeps/pthread/pthread_cond_timedwait.c
4908         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4909         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4910         (__pthread_cond_timedwait): Check for invalid nanosecond in
4911         timeout value.
4912         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4913         * tst-cond19.c: New file.
4914         * Makefile: Add rules to build and run tst-cond19.
4916 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4918         * tst-context1.c (GUARD_PATTERN): Defined.
4919         (tst_context_t): Define struct containing ucontext_t & guard words.
4920         (ctx): Declare as an array of tst_context_t.
4921         (fct): Verify uc_link & guard words are still valid.
4922         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4924 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4926         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4927         Add __data.__futex field, reshuffle __data.__clock.
4928         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4929         (__pthread_cond_signal): Increment __futex at the same time as
4930         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4931         address of low 32-bits of __wakeup_seq to futex syscall.
4932         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4933         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4934         releasing internal lock to FUTEX_WAIT.
4935         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4936         (__pthread_cond_timedwait): Likewise.
4937         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4938         (FUTEX_CMP_REQUEUE): Define.
4939         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4940         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4941         Pass __futex value from before the unlock and __futex address instead
4942         of address of low 32-bits of __wakeup_seq to futex syscall.
4943         Fallback to FUTEX_WAKE all on any errors.
4945 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4947         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4948         comment typo.
4949         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4950         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4951         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4952         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4953         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4955 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4957         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4958         Add memory clobber to inline assembly.
4959         (__lll_mutex_trylock): Likewise.
4960         (__lll_mutex_cond_trylock): Likewise.
4962 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4964         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4965         Pass val argument as 6th system call argument in %r7.
4967 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4969         * Makefile (tests): Add tst-cond16.
4970         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4971         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4972         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4973         Add __data.__futex field, reshuffle __data.__clock.
4974         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4975         (__pthread_cond_signal): Increment __futex at the same time as
4976         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4977         address of low 32-bits of __wakeup_seq to futex syscall.
4978         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4979         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4980         releasing internal lock to FUTEX_WAIT.
4981         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4982         (__pthread_cond_timedwait): Likewise.
4983         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4984         (FUTEX_CMP_REQUEUE): Define.
4985         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4986         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4987         Pass __futex value from before the unlock and __futex address instead
4988         of address of low 32-bits of __wakeup_seq to futex syscall.
4989         Fallback to FUTEX_WAKE all on any errors.
4990         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4991         Define.
4992         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4993         internally.  Return non-zero if error, zero if success.
4994         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4995         Add __data.__futex field, reshuffle __data.__clock.
4996         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4997         Define.
4998         (lll_futex_requeue): Add val argument, return 1 unconditionally
4999         for the time being.
5000         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5001         Add __data.__futex field, reshuffle __data.__clock.
5002         * sysdeps/unix/sysv/linux/powerpc/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/powerpc/bits/pthreadtypes.h
5007         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
5008         * sysdeps/unix/sysv/linux/sparc/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/sparc/bits/pthreadtypes.h (pthread_cond_t):
5013         Add __data.__futex field, reshuffle __data.__clock.
5014         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
5015         Define.
5016         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
5017         internally.  Return non-zero if error, zero if success.
5018         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
5019         Add __data.__futex field, reshuffle __data.__clock.
5020         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
5021         Add __data.__futex field, reshuffle __data.__clock.
5022         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
5023         Increment __futex at the same time as __wakeup_seq or __total_seq.
5024         Pass address of __futex instead of address of low 32-bits of
5025         __wakeup_seq to futex syscall.
5026         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5027         Pass __futex value from before releasing internal lock
5028         to FUTEX_WAIT.
5029         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5030         Likewise.  Avoid unnecessary shadowing of variables.
5031         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
5032         Set __futex to 2 * __total_seq.  Pass __futex value from before the
5033         unlock and __futex address instead of address of low 32-bits of
5034         __wakeup_seq to futex_requeue macro, adjust for new return value
5035         meaning.
5036         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
5037         (__pthread_cond_signal): Increment __futex at the same time as
5038         __wakeup_seq or __total_seq.  Pass address of __futex instead of
5039         address of low 32-bits of __wakeup_seq to futex syscall.
5040         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5041         (__pthread_cond_wait): Likewise.  Pass __futex value from before
5042         releasing internal lock to FUTEX_WAIT.
5043         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5044         (__pthread_cond_timedwait): Likewise.
5045         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5046         (FUTEX_CMP_REQUEUE): Define.
5047         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
5048         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
5049         Pass __futex value from before the unlock and __futex address instead
5050         of address of low 32-bits of __wakeup_seq to futex syscall.
5051         Fallback to FUTEX_WAKE all on any errors.
5053 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5055         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
5056         Add nop to align the end of critical section.
5057         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
5059 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5061         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5062         Add __broadcast_seq field.
5063         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
5064         all waiters as woken with woken_seq and bump broadcast counter.
5065         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
5066         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
5067         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5068         Comment typo fixes.  Avoid returning -ETIMEDOUT.
5070 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
5072         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5073         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
5074         Reported by Kaz Kojima.
5076 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
5078         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
5080 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5082         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
5083         __broadcast_seq with bc_seq after acquiring internal lock instead of
5084         before it.
5086 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
5088         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
5089         compilation.
5090         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5091         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
5092         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5093         (pthread_cond_t): Add __data.__broadcast_seq field.
5094         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5095         (FRAME_SIZE): Define.
5096         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
5097         Comment typo fixes.
5098         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
5099         Define.
5100         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
5101         typo fixes.
5102         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5103         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
5104         fixes.
5106 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
5108         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
5109         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5110         Add __broadcast_seq field.
5111         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5112         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5113         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5114         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5115         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5116         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
5117         all waiters as woken with woken_seq and bump broadcast counter.
5118         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
5119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
5120         __broadcast_seq field.
5121         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5122         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5123         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5124         * pthread_cond_init.c: Initialize __broadcast_seq field.
5125         * Makefile (tests): Add tst-cond17 and tst-cond18.
5126         Add .NOTPARALLEL goal.
5127         * tst-cond16.c: New file.  From Jakub.
5128         * tst-cond17.c: New file.  From Jakub.
5129         * tst-cond18.c: New file.  From Jakub.
5131 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
5133         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
5134         unwind info.
5136         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5137         Parametrize frame size.  Correct some unwind info.
5138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5140 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5142         * tst-stack3.c: Note testing functionality beyond POSIX.
5144 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5146         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5147         Change conditional from ifdef to if.
5149 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5151         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5152         SYSDEP_CANCEL_ERROR): Define.
5153         (PSEUDO): Use it.
5155 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5157         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5159 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5161         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5163 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5165         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5166         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5167         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5168         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5170 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5172         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5173         thread has all signals blocked.
5175 2004-04-18  Andreas Jaeger  <aj@suse.de>
5177         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5178         (SEM_VALUE_MAX): Add missing brace.
5180 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5182         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5183         in rt subdir.
5184         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5185         * sysdeps/pthread/tst-mqueue8x.c: New test.
5186         * tst-cancel4.c: Update comment about message queues.
5188         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5189         return it_value { 0, 0 }.
5190         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5191         like SIGEV_SIGNAL.
5192         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5193         assertion for SIGEV_NONE.
5194         (thread_attr_compare): Compare all attributes, not just a partial
5195         subset.
5197 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5199         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5201 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5203         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5204         Just use a plain number.
5205         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5206         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5207         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5208         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5209         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5210         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5211         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5213 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5215         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5216         frame info.
5217         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5219 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5221         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5222         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5223         of calling sigwaitinfo.
5225 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5227         * allocatestack.c (allocate_stack): Set reported_guardsize
5228         unconditionally.
5229         * pthread_getattr_np.c (pthread_getattr_np): Use
5230         reported_guardsize instead of guardsize.
5231         * descr.h (struct pthread): Add reported_guardsize field.
5233 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5235         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5237 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5239         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5241 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5243         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5244         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5245         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5246         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5247         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5248         Define.
5249         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5250         (_POSIX_MESSAGE_PASSING): Define.
5251         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5252         (_POSIX_MESSAGE_PASSING): Define.
5253         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5254         (_POSIX_MESSAGE_PASSING): Define.
5256 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5258         * tst-context1.c (fct): Check whether correct stack is used.
5260 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5262         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5263         matching constraints for asm mem parameters.
5265         * tst-clock2.c (tf): Don't define unless needed.
5267 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5269         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5270         $(gnulib).
5272 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5274         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5275         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5276         * pthreadP.h: Declare __nptl_deallocate_tsd.
5277         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5278         Adjust caller.
5280         * Makefile (tests): Add tst-tsd5.
5281         * tst-tsd5.c: New file.
5283 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5285         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5286         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5287         is SHLIB_COMPAT check.
5288         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5289         (__pthread_attr_getaffinity_old): Likewise.
5290         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5291         (__pthread_getaffinity_old): Likewise.
5292         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5293         (__pthread_setaffinity_old): Likewise.
5295 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5297         * allocatestack.c (_make_stacks_executable): Call
5298         _dl_make_stack_executable first.
5300 2004-03-24  Roland McGrath  <roland@redhat.com>
5302         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5303         constraint instead of "0".
5305 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5307         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5308         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5310         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5311         code to avoid warning.
5313 2004-03-24  Andreas Jaeger  <aj@suse.de>
5315         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5316         (__pthread_attr_setaffinity_old): Remove const.
5318 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5320         * sysdeps/unix/sysv/linux/smp.h: New file.
5321         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5322         * init.c: Define __is_smp.
5323         (__pthread_initialize_minimal_internal): Call is_smp_system to
5324         initialize __is_smp.
5325         * pthreadP.h: Declare __is_smp.
5326         Define MAX_ADAPTIVE_COUNT is necessary.
5327         * pthread_mutex_init.c: Add comment regarding __spins field.
5328         * pthread_mutex_lock.c: Implement adaptive mutex type.
5329         * pthread_mutex_timedlock.c: Likewise.
5330         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5331         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5332         Add __spins field.
5333         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5334         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5335         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5336         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5337         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5338         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5339         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5340         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5341         lll_mutex_cond_trylock.
5342         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5343         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5344         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5345         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5346         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5347         Define BUSY_WAIT_NOP.
5348         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5349         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5351         * tst-mutex5.c: Add support for testing adaptive mutexes.
5352         * tst-mutex7.c: Likewise.
5353         * tst-mutex5a.c: New file.
5354         * tst-mutex7a.c: New file.
5355         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5357         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5358         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5359         vgettimeofday call might destroy the content.
5361         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5362         @pause in the loop.
5364         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5365         No need to restrict type of ret.  Make it int.  Add comment.
5367         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5368         Remove unnecessary setne instruction.
5370 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5372         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5373         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5374         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5375         If realloc fails, break out of the loop.
5377 2004-03-20  Andreas Jaeger  <aj@suse.de>
5379         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5380         (__pthread_setaffinity_old): Fix interface.
5381         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5382         (__pthread_getaffinity_old): Likewise.
5384         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5385         (__pthread_setaffinity_new): Remove duplicate declaration.
5387 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5389         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5390         the return value to a safe register.
5391         (CDISABLE): Set the function argument correctly.
5393 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5395         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5396         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5397         Rewrite so that only one locked memory operation per round is needed.
5398         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5399         (pthread_barrier_wait): After wakeup, release lock only when the
5400         last thread stopped using the barrier object.
5401         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5402         (__pthread_cond_wait): Don't store mutex address if the current
5403         value is ~0l.  Add correct cleanup support and unwind info.
5404         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5405         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5406         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5407         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5408         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5409         Add correct cleanup support and unwind info.
5410         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5411         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5412         information for syscall wrappers.
5414 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5416         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5417         cpusetsize field, remove next.
5418         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5419         parameter for size of the CPU set.
5420         (pthread_setaffinity_np): Likewise.
5421         (pthread_attr_getaffinity_np): Likewise.
5422         (pthread_attr_setaffinity_np): Likewise.
5423         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5424         interface change, keep compatibility code.
5425         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5426         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5427         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5428         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5429         __pthread_getaffinity_np.
5430         * Versions: Add version for changed interfaces.
5431         * tst-attr3.c: Adjust test for interface change.
5432         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5433         increasing buffer sizes.
5434         * pthread_attr_destroy.c: Remove unused list handling.
5435         * pthread_attr_init.c: Likewise.
5437 2004-03-17  Roland McGrath  <roland@redhat.com>
5439         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5440         first argument to clock_getres so we ever enable kernel timers.
5442 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5444         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5446 2004-03-12  Richard Henderson  <rth@redhat.com>
5448         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5449         oldvalue from CENABLE to CDISABLE.
5451 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5453         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5454         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5455         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5456         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5458 2004-03-11  Richard Henderson  <rth@redhat.com>
5460         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5461         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5462         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5464 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5466         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5467         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5468         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5470 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5472         * forward.c (__pthread_cond_broadcast_2_0,
5473         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5474         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5475         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5477 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5479         * sysdeps/sh/tcb-offsets.sym: Add PID.
5480         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5481         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5483 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5485         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5486         include <sysdep-cancel.h>, vfork is no cancellation point.
5487         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5488         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5489         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5491 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5493         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5494         libc_hidden_def.
5495         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5496         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5497         Likewise.
5498         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5499         Likewise.
5500         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5501         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5502         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5503         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5504         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5506         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5507         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5508         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5509         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5510         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5511         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5513         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5514         a local register for saving old PID.  Negate PID in parent upon exit.
5516         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5517         tcb-offsets.h.
5518         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5519         before syscall, set to the old value in the parent afterwards.
5520         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5521         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5522         tcb-offsets.h.
5523         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5524         before syscall, set to the old value in the parent afterwards.
5525         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5526         * sysdeps/s390/tcb-offsets.sym: Add PID.
5528         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5529         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5530         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5531         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5532         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5533         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5535 2004-03-10  Andreas Schwab  <schwab@suse.de>
5537         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5538         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5539         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5541 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5543         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5544         * tst-cancel21.c (do_one_test): Likewise.
5545         Reported by Gordon Jin <gordon.jin@intel.com>.
5547 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5549         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5550         if non-zero and set to INT_MIN if zero.
5551         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5552         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5553         (SAVE_PID, RESTORE_PID): Define.
5554         (__vfork): Use it.
5555         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5556         Use relative path to avoid including NPTL i386/vfork.S.
5557         (SAVE_PID, RESTORE_PID): Define.
5558         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5559         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5560         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5561         tst-vfork2x.
5562         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5563         * tst-vfork1.c: New test.
5564         * tst-vfork2.c: New test.
5565         * tst-vfork1x.c: New test.
5566         * tst-vfork2x.c: New test.
5568 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5570         * sysdeps/i386/tcb-offsets.sym: Add PID.
5571         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5572         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5573         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5575 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5577         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5579 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5581         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5582         _rtld_global_ro.
5584 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5586         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5587         _rtld_global_ro.
5589         * tst-once4.c: Remove unnecessary macro definition.
5591         * tst-mutex7.c (do_test): Limit thread stack size.
5592         * tst-once2.c (do_test): Likewise.
5593         * tst-tls3.c (do_test): Likewise.
5594         * tst-tls1.c (do_test): Likewise.
5595         * tst-signal3.c (do_test): Likewise.
5596         * tst-kill6.c (do_test): Likewise.
5597         * tst-key4.c (do_test): Likewise.
5598         * tst-join4.c (do_test): Likewise.
5599         * tst-fork1.c (do_test): Likewise.
5600         * tst-context1.c (do_test): Likewise.
5601         * tst-cond2.c (do_test): Likewise.
5602         * tst-cond10.c (do_test): Likewise.
5603         * tst-clock2.c (do_test): Likewise.
5604         * tst-cancel10.c (do_test): Likewise.
5605         * tst-basic2.c (do_test): Likewise.
5606         * tst-barrier4.c (do_test): Likewise.
5608 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5610         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5612 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5615         (__pthread_cond_timedwait): Optimize wakeup test.
5616         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5617         (__pthread_cond_wait): Likewise.
5618         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5619         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5620         Likewise.
5622 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5624         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5625         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5626         the atomic instruction needed.
5627         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5628         (__lll_mutex_lock_wait): Likewise.
5630 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5632         * Makefile (tests): Add tst-cond14 and tst-cond15.
5633         * tst-cond14.c: New file.
5634         * tst-cond15.c: New file.
5636 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5638         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5639         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5640         needs to be implemented differently to be useful.
5642 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5644         * pthread_attr_setschedparam.c: Don't test priority against limits
5645         here.  Set ATTR_FLAG_SCHED_SET flag.
5646         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5647         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5648         from parent thread to child.  If attribute is used and scheduling
5649         parameters are not inherited, copy parameters from attribute or
5650         compute them.  Check priority value.
5651         * pthread_getschedparam.c: If the parameters aren't known yet get
5652         them from the kernel.
5653         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5654         ATTR_FLAG_POLICY_SET flag for thread.
5655         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5656         and ATTR_FLAG_POLICY_SET.
5658         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5660         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5661         fail if stack address hasn't been set.  Just return 0.
5663 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5665         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5666         libpthread for the files in this list.
5667         (CFLAGS-tst-unload): Removed.
5668         * tst-unload.c (do_test): Don't use complete path for
5669         LIBPHREAD_SO.
5671         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5672         tst-_res1mod2.
5674 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5676         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5677         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5678         operation per round is needed.
5679         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5680         (__lll_mutex_lock_wait): Likewise.
5682 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5684         * tst-cancel9.c (cleanup): Don't print to stderr.
5686 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5688         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5690 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5692         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5693         (__syscall_error_handler2): Call CDISABLE.
5694         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5695         (__syscall_error_handler2): Call CDISABLE.
5697         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5698         Release lock before the loop, don't reacquire it.
5700         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5702 2004-02-19  Andreas Schwab  <schwab@suse.de>
5704         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5705         Fix last change.
5707 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5709         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5710         (pthread_barrier_wait): After wakeup, release lock only when the
5711         last thread stopped using the barrier object.
5712         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5713         (pthread_barrier_wait): Likewise.
5714         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5715         Likewise.
5716         * Makefile (tests): Add tst-barrier4.
5717         * tst-barrier4.c: New file.
5719         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5720         (__pthread_cond_timedwait): Perform timeout test while holding
5721         internal lock to prevent wakeup race.
5722         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5723         * sysdeps/pthread/pthread_cond_timedwait.c
5724         (__pthread_cond_timedwait): Likewise.
5725         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5726         (__pthread_cond_timedwait): Likewise.
5728 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5730         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5731         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5732         * Makefile (tests): Add tst-rwlock13.
5733         * tst-rwlock13.c: New test.
5735 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5737         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5738         (__condvar_tw_cleanup): Little optimization.
5739         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5741 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5743         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5744         libpthread as "lib" parameter to SHLIB_COMPAT.
5745         (__novmx_siglongjmp): Fix typo in function name.
5746         (__novmx_longjmp): Fix typo in function name.
5748 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5750         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5751         __builtin_expect.
5753         * sysdeps/generic/pt-longjmp.c: Moved to...
5754         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5756 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5758         * Makefile (libpthread-routines): Add pt-cleanup.
5759         * pt-longjmp.c: Removed.
5760         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5761         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5762         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5763         Version longjmp, siglongjmp for GLIBC_2.3.4.
5764         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5766 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5768         * sysdeps/pthread/pthread_cond_timedwait.c
5769         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5770         Reuse code.  Add __builtin_expects.
5772         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5773         (__pthread_cond_timedwait): Get internal lock in case timeout has
5774         passed before the futex syscall.
5775         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5777 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5779         * allocatestack.c: Pretty printing.
5781         * sysdeps/pthread/createthread.c (create_thread): Don't add
5782         CLONE_DETACHED bit if it is not necessary.
5784 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5786         * pthread_getattr_np.c: Include ldsodefs.h.
5788 2004-01-16  Richard Henderson  <rth@redhat.com>
5790         * allocatestack.c: Don't declare __libc_stack_end.
5791         * init.c (__pthread_initialize_minimal_internal): Likewise.
5792         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5794 2004-01-15  Richard Henderson  <rth@redhat.com>
5796         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5797         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5798         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5799         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5800         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5801         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5802         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5803         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5805 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5807         * init.c (pthread_functions): Make array const.
5809 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5811         * allocatestack.c (__make_stacks_executable): Change interface.
5812         Check parameters.  Pass parameter on to libc counterpart.
5813         * pthreadP.h: Change declaration.
5815 2004-01-13  Richard Henderson  <rth@redhat.com>
5817         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5818         prototype form.
5819         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5820         Likewise.
5822         * sysdeps/alpha/Makefile: New file.
5823         * sysdeps/alpha/tcb-offsets.sym: New file.
5824         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5825         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5827         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5828         on powerpc version.
5830 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5832         * Makefile (tests): Add tst-backtrace1.
5833         * tst-backtrace1.c: New test.
5835 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5837         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5838         register as second parameter to the REGISTER macro.
5839         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5840         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5841         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5842         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5843         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5844         of thread register as second parameter to REGISTER macro in 64 case.
5846 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5848         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5849         (CFLAGS-getpid.o): Defined.
5850         (CFLAGS-getpid.os): Defined.
5852 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5854         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5855         returned for main thread does not overlap with any other VMA.
5856         Patch by Jakub Jelinek.
5858 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5860         * tst-raise1.c: Include stdio.h.
5862 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5864         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5865         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5866         If pid is 0, set it to selftid.
5867         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5868         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5869         != 0, return self->tid without doing a syscall.
5870         * descr.h (struct pthread): Move pid field after tid.
5872         * Makefile (tests): Add tst-raise1.
5873         * tst-raise1.c: New file.
5875 2003-12-23  Roland McGrath  <roland@redhat.com>
5877         * tst-oddstacklimit.c: New file.
5878         * Makefile (tests): Add it.
5879         (tst-oddstacklimit-ENV): New variable.
5881         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5882         value up to page size for __default_stacksize.
5884 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5886         * Makefile (tests): Add tst-eintr5.
5887         * tst-eintr5.c: New file.
5889         * eintr.c (eintr_source): Prevent sending signal to self.
5891         * tst-eintr2.c (tf1): Improve error message.
5893 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5895         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5896         * sysdeps/unix/sysv/linux/getpid.c: New file.
5897         * pthread_cancel.c: Add comment explaining use of PID field.
5898         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5899         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5900         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5901         temporarily to signal the field must not be relied on and updated
5902         by getpid().
5903         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5904         temporarily negative.
5905         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5907 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5909         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5910         (eintr_source): If ARG != NULL, use pthread_kill.
5911         * tst-eintr1.c: Adjust for this change.
5912         * tst-eintr2.c: Likewise.
5913         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5914         * tst-eintr3.c: New file.
5915         * tst-eintr4.c: New file.
5917 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5919         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5920         if CANCELSTATE_BITMASK is set.
5921         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5922         Likewise.
5924         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5925         (tests-reverse): Add tst-cancel23.
5926         * tst-cancel22.c: New test.
5927         * tst-cancel23.c: New test.
5929 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5931         * tst-eintr1.c: Better error messages.
5933         * Makefile (tests): Add tst-eintr2.
5934         * tst-eintr2.c: New file.
5936 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5938         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5939         (CFLAGS-tst-cancelx21.c): Set.
5940         * tst-cancel21.c: New test.
5941         * tst-cancelx21.c: New test.
5943         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5944         comparison operand.
5945         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5946         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5947         * pt-longjmp.c: Include jmpbuf-unwind.h.
5948         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5949         _JMPBUF_UNWINDS.  Adjust compared pointers.
5950         * init.c (__pthread_initialize_minimal_internal): Initialize
5951         pd->stackblock_size.
5952         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5953         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5954         * sysdeps/i386/jmpbuf-unwind.h: New file.
5955         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5956         * sysdeps/s390/jmpbuf-unwind.h: New file.
5957         * sysdeps/sh/jmpbuf-unwind.h: New file.
5958         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5959         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5960         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5961         (_JMPBUF_CFA_UNWINDS): Remove.
5962         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5964 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5966         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5967         (CFLAGS-tst-cancelx20.c): Set.
5968         * tst-cancel20.c: New test.
5969         * tst-cancelx20.c: New test.
5971 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5973         * init.c (__pthread_initialize_minimal_internal): Don't treat
5974         architectures with separate register stack special here when
5975         computing default stack size.
5977 2003-12-17  Roland McGrath  <roland@redhat.com>
5979         * Makefile (tst-cancelx7-ARGS): New variable.
5980         Reportd by Greg Schafer <gschafer@zip.com.au>.
5982 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5984         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5985         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5986         (tst-stack3-ENV): Set.
5987         ($(objpfx)tst-stack3-mem): New.
5988         * tst-stack3.c: New test.
5990 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5992         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5993         Add unwind directives.  Drop unused .regstk directive.
5994         (_fini_EPILOG_BEGINS): Add unwind directives.
5996 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5998         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5999         Assume parameter is a pointer.
6000         (lll_futex_wake): Likewise.
6001         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
6002         Likewise.
6003         (lll_futex_wake): Likewise.
6004         Reported by Boris Hu.
6005         * sysdeps/unix/sysv/linux/unregister-atfork.c
6006         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
6008         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
6010 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
6012         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
6013         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
6014         __rtld_lock_initialize for ld.so lock.
6015         Patch in part by Adam Li <adam.li@intel.com>.
6017 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
6019         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
6020         in $(gnulib).  Also, remove stale comment.
6022 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
6024         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
6025         advantage of new syscall stub and optimize accordingly.
6027         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
6028         from SYS_futex, to match expectations of
6029         sysdep.h:DO_INLINE_SYSCALL.
6030         (lll_futex_clobbers): Remove.
6031         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
6032         (lll_futex_wake): Likewise.
6033         (lll_futex_requeue): Likewise.
6034         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
6035         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
6036         Jelinek).
6037         (__lll_mutex_lock): Likewise.
6038         (__lll_mutex_cond_lock): Likewise.
6039         (__lll_mutex_timed_lock): Likewise.
6040         (__lll_mutex_unlock): Likewise.
6041         (__lll_mutex_unlock_force): Likewise.
6043         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
6044         comes before the include of <sysdep.h>.
6045         (THREAD_SELF_SYSINFO): New macro.
6046         (THREAD_SYSINFO): Likewise.
6047         (INIT_SYSINFO): New macro.
6048         (TLS_INIT_TP): Call INIT_SYSINFO.
6050         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
6052         * sysdeps/pthread/createthread.c (create_thread): Use
6053         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
6054         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
6055         THREAD_SELF_SYSINFO instead of open code.
6056         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
6057         (THREAD_SYSINFO): Likewise.
6059         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
6061         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
6063 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
6065         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
6066         instead of .init.  Patch by David Mosberger.
6068 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
6070         * sysdeps/pthread/configure.in: Remove broken declaration in C
6071         cleanup handling check.
6073 2003-11-30  Andreas Jaeger  <aj@suse.de>
6075         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
6076         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
6077         Likewise.
6079 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
6081         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
6082         * pthread_attr_destroy.c: Include shlib-compat.h.
6083         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
6084         is set in iattr->flags.
6085         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
6087 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
6089         * Makefile (distribute): Add tst-cleanup4aux.c.
6091         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
6092         include.
6094 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
6096         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
6097         pthread_cond_signal.
6099         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
6100         store mutex address if the current value is ~0l.
6101         * sysdeps/pthread/pthread_cond_timedwait.c
6102         (__pthread_cond_timedwait): Likewise.
6103         * sysdeps/pthread/pthread_cond_broadcast.c
6104         (__pthread_cond_broadcast): Don't use requeue for pshared
6105         condvars.
6107         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6108         (__pthread_cond_wait): Don't store mutex address if the current
6109         value is ~0l.
6110         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6111         (__pthread_cond_timedwait): Likewise.
6112         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6113         (__pthread_cond_broadcast): Don't use requeue for pshared
6114         condvars.
6116         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
6117         element with ~0l for pshared condvars, with NULL otherwise.
6119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6120         (__pthread_cond_wait): Don't store mutex address if the current
6121         value is ~0l.
6122         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6123         (__pthread_cond_timedwait): Likewise.
6124         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6125         (__pthread_cond_broadcast): Don't use requeue for pshared
6126         condvars.
6128         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
6129         * tst-cond12.c: New file.
6130         * tst-cond13.c: New file.
6132 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
6134         * sysdeps/pthread/configure.in: Make missing forced unwind support
6135         fatal.
6137 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
6139         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6141 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6143         * Makefile: Add magic to clean up correctly.
6145 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6147         * unwind.c (FRAME_LEFT): Define.
6148         (unwind_stop): Handle old style cleanups here.
6149         (__pthread_unwind): Handle old style cleanups only if
6150         !HAVE_FORCED_UNWIND.
6151         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6152         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6153         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6154         ($(objpfx)tst-cleanupx4): Likewise.
6155         * tst-cleanup4.c: New test.
6156         * tst-cleanup4aux.c: New.
6157         * tst-cleanupx4.c: New test.
6159 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6161         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6162         lll_mutex_*lock macros to skip atomic operations on some archs.
6164 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6166         * sysdeps/pthread/tst-timer.c (main): Initialize
6167         sigev2.sigev_value as well.
6169 2003-10-15  Roland McGrath  <roland@redhat.com>
6171         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6172         is missing.
6173         * sysdeps/pthread/configure: Regenerated.
6175 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6177         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6178         locking macros.  No distinction between normal and mutex locking
6179         anymore.
6180         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6181         Merge bits from lowlevelmutex.S we still need.
6182         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6183         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6184         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6185         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6186         new mutex implementation.
6187         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6188         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6189         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6190         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6191         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6192         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6193         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6194         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6195         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6196         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6197         symbol for entry point to avoid cancellation.
6199 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6201         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6202         changes.
6203         (SAVE_OLDTYPE_0): Fix a typo.
6205 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6207         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6208         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6210 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6212         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6213         correct offset.
6215 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6217         * Makefile (tests): Add tst-cancel19.
6218         * tst-cancel19.c: New test.
6220 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6222         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6223         restoring of the old cancellation type.
6225 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6227         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6229 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6231         * sysdeps/pthread/malloc-machine.h: New file
6233 2003-09-24  Roland McGrath  <roland@redhat.com>
6235         * allocatestack.c (__make_stacks_executable): Don't ignore return
6236         value from _dl_make_stack_executable.
6238 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6240         * allocatestack.c (__make_stacks_executable): Also change
6241         permission of the currently unused stacks.
6243         * allocatestack.c (change_stack_perm): Split out from
6244         __make_stacks_executable.
6245         (allocate_stack): If the required permission changed between the time
6246         we started preparing the stack and queueing it, change the permission.
6247         (__make_stacks_executable): Call change_stack_perm.
6249         * Makefile: Build tst-execstack-mod locally.
6250         * tst-execstack-mod.c: New file.
6252 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6254         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6256 2003-09-23  Roland McGrath  <roland@redhat.com>
6258         * tst-execstack.c: New file.
6259         * Makefile (tests): Add it.
6260         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6261         (LDFLAGS-tst-execstack): New variable.
6263         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6264         whether to use PROT_EXEC for stack mmap.
6265         (__make_stacks_executable): New function.
6266         * pthreadP.h: Declare it.
6267         * init.c (__pthread_initialize_minimal_internal): Set
6268         GL(dl_make_stack_executable_hook) to that.
6270 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6272         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6273         recommendation from AMD re avoidance of lock prefix.
6275 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6277         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6278         lll_futex_timed_wait instead of lll_futex_wait.
6279         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6280         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6281         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6282         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6283         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6284         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6285         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6286         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6287         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6288         Completely revamp the locking macros.  No distinction between
6289         normal and mutex locking anymore.
6290         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6291         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6292         __lll_lock_timedwait): Fix prototypes.
6293         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6294         __lll_lock_timedwait): Likewise.
6295         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6296         macros, add __builtin_expect.
6297         (lll_mutex_timedlock): Likewise.  Fix return value.
6298         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6299         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6300         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6301         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6302         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6303         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6304         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6305         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6307 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6309         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6310         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6311         operation if possible.
6313         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6314         like jumping over the lock prefix.
6316 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6318         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6319         locking macros.  No distinction between normal and mutex locking
6320         anymore.
6321         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6322         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6323         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6324         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6325         locking.  Merge bits from lowlevelmutex.S we still need.
6326         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6327         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6328         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6329         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6330         * Makefile (routines): Remove libc-lowlevelmutex.
6331         (libpthread-rountines): Remove lowlevelmutex.
6332         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6333         for new mutex implementation.
6334         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6335         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6336         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6337         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6338         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6339         Likewise.
6340         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6341         Likewise.
6342         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6343         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6344         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6345         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6346         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6347         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6348         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6349         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6350         Likewise.
6351         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6352         Likewise.
6353         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6354         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6355         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6356         Don't use requeue.
6357         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6358         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6360 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6362         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6363         in parameters of asm with output parameters.
6365         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6366         type of DECR parameter to int.
6367         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6369 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6371         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6372         guardsize for each thread.
6374 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6376         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6377         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6378         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6380         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6381         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6382         NULL.
6383         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6384         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6385         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6386         (pthread_getaffinity_np): Add hidden_def.
6388         * Makefile (tests): Add tst-attr3.
6389         * tst-attr3.c: New test.
6391         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6393 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6395         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6396         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6398 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6400         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6401         * tst-align.c: Include tst-stack-align.h.
6402         (tf, do_test): Use TEST_STACK_ALIGN macro.
6404 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6406         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6407         variable.
6409 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6411         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6412         stack-related values for the initial thread.
6414 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6416         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6418 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6420         * pthread_mutex_lock.c: Minor code rearrangements.
6422 2003-09-05  Roland McGrath  <roland@redhat.com>
6424         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6425         Instead, include ../nptl_db/db_info.c to do its magic.
6426         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6427         (__pthread_pthread_key_2ndlevel_size): Likewise.
6428         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6429         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6430         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6431         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6432         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6433         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6434         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6435         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6436         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6437         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6438         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6439         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6440         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6441         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6442         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6443         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6444         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6446 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6448         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6449         of pthread_t to be compatible with LT.
6450         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6451         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6452         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6453         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6454         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6455         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6456         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6458 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6460         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6462 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6464         * unwind-forcedunwind.c: Move to...
6465         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6466         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6467         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6468         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6469         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6470         * unwind.c: Include jmpbuf-unwind.h.
6471         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6473 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6475         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6476         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6477         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6478         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6479         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6480         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6481         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6482         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6483         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6484         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6485         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6486         function.
6487         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6488         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6489         * Makefile (tests): Add tst-stack2.
6490         * tst-stack2.c: New test.
6491         * tst-stack1.c: Include limits.h and sys/param.h.
6492         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6494         * pthread_condattr_setpshared.c: Include errno.h.
6495         (pthread_condattr_setpshared): Return EINVAL if pshared
6496         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6498         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6499         defined symbol for entry point to avoid cancellation.
6500         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6501         Likewise.
6502         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6503         Likewise.
6504         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6505         Likewise.
6506         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6507         Likewise.
6508         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6509         Likewise.
6510         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6511         __close_nocancel, __read_nocancel, __write_nocancel,
6512         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6513         libpthread.so or librt.so, define to corresponding function
6514         without _nocancel suffix.
6515         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6516         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6517         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6519         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6521 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6523         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6524         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6526         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6527         in subsections has a symbol associated with it.
6529         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6530         defined symbol for entry point to avoid cancellation.
6531         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6533 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6535         * Makefile (tests): Add tst-tls5.
6536         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6537         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6538         ($(objpfx)tst-tls5): New.
6539         ($(objpfx)tst-tls6.out): Likewise.
6540         (tests): Depend on $(objpfx)tst-tls6.out.
6541         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6542         (do_test): Check pthread_self () return value alignment.
6543         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6544         (tf): Check pthread_self () return value alignment.
6545         * tst-tls5.c: New test.
6546         * tst-tls5.h: New.
6547         * tst-tls5mod.c: New.
6548         * tst-tls5moda.c: New.
6549         * tst-tls5modb.c: New.
6550         * tst-tls5modc.c: New.
6551         * tst-tls5modd.c: New.
6552         * tst-tls5mode.c: New.
6553         * tst-tls5modf.c: New.
6554         * tst-tls6.sh: New test.
6556         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6557         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6558         * init.c (pthread_functions): Initialize them.
6559         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6560         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6561         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6562         pthread_cond_timedwait@@GLIBC_2.3.2.
6564 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6566         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6567         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6568         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6569         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6570         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6571         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6573         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6575         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6576         _POSIX_THREAD_PRIORITY_SCHEDULING.
6577         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6579 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6581         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6582         nested function, use static inline function from libio.h.
6583         Code by Richard Henderson.
6585         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6586         weak.
6588 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6590         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6591         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6592         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6593         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6594         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6595         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6596         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6597         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6598         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6599         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6600         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6601         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6602         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6603         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6604         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6605         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6606         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6607         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6608         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6609         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6610         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6611         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6612         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6613         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6614         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6615         * sysdeps/sparc/tls.h: New file.
6616         * sysdeps/sparc/tcb-offsets.sym: New file.
6617         * sysdeps/sparc/Makefile: New file.
6618         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6619         * init.c [__sparc__] (__NR_set_tid_address): Define.
6621 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6623         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6624         _IO_release_lock): Define.
6626 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6628         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6629         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6631 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6633         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6634         (__pthread_cleanup_class): Add missing return types of member
6635         functions.
6637 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6639         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6640         (lll_mutex_unlock_force): Add memory barrier between store and futex
6641         syscall.
6643 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6645         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6646         tempmsg in first loop.
6648 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6650         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6651         _POSIX_THREAD_PRIORITY_SCHEDULING.
6652         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6654 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6656         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6657         (__rtld_lock_default_lock_recursive,
6658         __rtld_lock_default_unlock_recursive): Define.
6659         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6660         __rtld_lock_unlock_recursive): Define using
6661         GL(_dl_rtld_*lock_recursive).
6662         * init.c (__pthread_initialize_minimal_internal): Initialize
6663         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6664         Lock GL(_dl_load_lock) the same number of times as
6665         GL(_dl_load_lock) using non-mt implementation was nested.
6667         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6668         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6670 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6672         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6673         PIPE_BUF.
6675 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6677         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6679 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6681         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6682         to first syscall error check.  Move syscall error check for tkill
6683         into __ASSUME_CLONE_STOPPED #ifdef.
6685 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6687         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6688         is not defined, do explicit synchronization.
6689         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6690         is not defined also unlock pd->lock for non-debugging case in case
6691         it is necessary.
6692         * pthread_create.c (start_thread): Always get and release pd->lock
6693         if __ASSUME_CLONE_STOPPED is not defined.
6694         (start_thread_debug): Removed.  Adjust users.
6695         * allocatestack.c (allocate_stack): Always initialize lock if
6696         __ASSUME_CLONE_STOPPED is not defined.
6697         * Makefile (tests): Add tst-sched1.
6698         * tst-sched1.c: New file.
6700         * sysdeps/pthread/createthread.c (do_clone): Only use
6701         sched_setschduler and pass correct parameters.
6703 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6705         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6706         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6707         PTHREAD_STACK_MIN in comments.
6709 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6711         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6712         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6713         argument.
6714         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6715         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6716         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6717         (__pthread_cleanup_upto): Fix prototype.
6718         (_longjmp_unwind): Adjust caller.
6719         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6720         Change second argument to const struct pointer.
6721         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6722         * tst-sem9.c (main): Likewise.
6723         * unwind.c: Include string.h for strlen prototype.
6725 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6727         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6728         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6729         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6730         Define HAVE_CMOV.
6731         Patch by Nicholas Miell <nmiell@attbi.com>.
6733 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6735         * init.c (__pthread_initialize_minimal_internal): Initialize
6736         GL(dl_init_static_tls).
6737         * pthreadP.h (__pthread_init_static_tls): New prototype.
6738         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6739         New functions.
6740         * Makefile (tests): Add tst-tls4.
6741         (modules-names): Add tst-tls4moda and tst-tls4modb.
6742         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6743         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6744         tst-tls4modb.so.
6745         * tst-tls4.c: New file.
6746         * tst-tls4moda.c: New file.
6747         * tst-tls4modb.c: New file.
6749 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6751         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6752         before __timer_dealloc.
6753         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6754         Don't call list_unlink.
6756 2003-07-29  Roland McGrath  <roland@redhat.com>
6758         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6760 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6762         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6763         Don't reuse struct aiocb A if it failed.
6764         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6765         not just one byte, as that does not block.
6767 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6769         * sysdeps/pthread/unwind-resume.c: New file.
6770         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6771         unwind-resume in csu subdir.
6772         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6773         exceptions.
6774         (librt-sysdep_routines, librt-shared-only-routines): Add
6775         rt-unwind-resume.
6776         * sysdeps/pthread/rt-unwind-resume.c: New file.
6777         * unwind-forcedunwind.c: New file.
6778         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6779         (libpthread-shared-only-routines): Likewise.
6780         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6781         * pthreadP.h (pthread_cancel_init): New prototype.
6782         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6784         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6785         attr argument const struct pthread_attr *.
6787         * res.c (__res_state): Return __resp.
6788         * descr.h: Include resolv.h.
6789         (struct pthread): Add res field.
6790         * pthread_create.c: Include resolv.h.
6791         (start_thread): Initialize __resp.
6792         * Makefile (tests): Add tst-_res1.
6793         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6794         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6795         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6796         libpthread.
6797         * tst-_res1.c: New file.
6798         * tst-_res1mod1.c: New file.
6799         * tst-_res1mod2.c: New file.
6801 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6803         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6805         * Makefile: Define various *-no-z-defs variables for test DSOs
6806         which has undefined symbols.
6808 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6810         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6811         Retry if the stwcx fails to store once_control.
6813 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6815         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6816         pthread_attr_setaffinity.
6817         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6818         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6819         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6820         * pthread_attr_destroy.c: Free cpuset element if allocated.
6821         * pthread_create.c: Pass iattr as additional parameter to
6822         create_thread.
6823         * sysdeps/pthread/createthread.c: If attribute is provided and
6824         a new thread is created with affinity set or scheduling parameters,
6825         start thread with CLONE_STOPPED.
6826         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6827         pthread_attr_setaffinity.
6828         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6829         cpuset element.
6831 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6833         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6835 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6837         * sysdeps/pthread/configure.in: Require CFI directives also for
6838         ppc and s390.
6840 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6842         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6843         Add cfi directives.
6845 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6847         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6848         CLEANUP_JMP_BUF.
6849         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6850         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6851         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6852         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6853         not self pointer in __writer.  Compare with TID to determine
6854         deadlocks.
6855         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6856         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6857         Likewise.
6858         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6859         Likewise.
6860         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6861         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6862         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6863         macros also when compiling librt.
6865 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6867         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6868         -fasynchronous-unwind-tables.
6869         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6870         (PSEUDO): Add cfi directives.
6871         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6872         Likewise.
6873         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6874         Likewise.
6876 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6878         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6879         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6880         * unwind.c (__pthread_unwind_next): Add hidden_def.
6881         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6882         Likewise.
6883         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6884         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6885         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6886         Likewise.
6887         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6888         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6889         Likewise.
6890         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6891         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6892         __pthread_unregister_cancel and __pthread_unwind_next.
6894 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6896         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6897         different symbol for the cancellation syscall wrapper and
6898         non-cancellation syscall wrapper.
6899         (PSEUDO_END): Define.
6901 2003-07-05  Richard Henderson  <rth@redhat.com>
6903         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6904         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6905         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6906         return actual return value from the syscall, not 0.
6908 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6910         * descr.h (struct pthread): Add pid field.
6911         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6912         (__reclaim_stacks): Likewise.
6913         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6914         also check for PID of the signal source.
6915         (__pthread_initialize_minimal_internal): Also initialize pid field
6916         of initial thread's descriptor.
6917         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6918         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6919         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6920         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6921         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6923 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6925         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6926         Fix use of parameter.
6927         (__libc_cleanup_pop): Likewise.
6929 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6931         * init.c (sigcancel_handler): Change parameters to match handler
6932         for SA_SIGACTION.  Check signal number and code to recognize
6933         invalid invocations.
6935 2003-07-03  Roland McGrath  <roland@redhat.com>
6937         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6938         Apply sizeof (struct pthread) bias to r13 value.
6940 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6942         * sysdeps/pthread/configure.in: Require CFI directives.
6944         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6945         definition.
6946         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6947         libpthread compilation.
6948         * unwind.c (__pthread_unwind): Add hidden_def.
6949         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6951 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6953         * libc-cancellation.c (__libc_cleanup_routine): Define.
6954         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6955         (__pthread_cleanup_pop): Define.
6957 2003-07-01  Richard Henderson  <rth@redhat.com>
6959         * sysdeps/alpha/elf/pt-initfini.c: New file.
6960         * sysdeps/alpha/pthread_spin_lock.S: New file.
6961         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6962         * sysdeps/alpha/pthreaddef.h: New file.
6963         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6964         * sysdeps/alpha/tls.h: New file.
6965         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6966         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6967         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6968         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6969         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6970         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6971         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6972         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6973         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6974         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6976 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6978         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6979         cleanup support and unwind info.
6981 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6983         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6984         Use correct cleanup handler registration.  Add unwind info.
6985         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6986         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6987         * tst-once3.c: Add cleanup handler and check it is called.
6988         * tst-once4.c: Likewise.
6989         * tst-oncex3.c: New file.
6990         * tst-oncex4.c: New file.
6991         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6993 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6995         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6997 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6999         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
7000         (tf_msgsnd): Likewise.
7002         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
7003         premature returns a bit more.
7005 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
7007         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
7008         definition to the front.
7010         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
7011         the cleanup functions to make the names unique.  Fix dwarf opcode
7012         un unwind table.
7013         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
7014         functions to make the names unique.  Fix CFA offset for two blocks.
7016 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
7018         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
7019         missing closing braces.
7020         Patch by Christophe Saout <christophe@saout.de>.
7022 2003-06-24  Roland McGrath  <roland@redhat.com>
7024         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
7026 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
7028         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
7029         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
7031         * pthreadP.h: Declare __find_thread_by_id.
7032         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
7033         * pthread_clock_gettime.c: Allow using other thread's clock.
7034         * pthread_clock_settime.c: Likewise.
7035         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
7036         * Makefile: Add rules to build and run tst-clock2.
7037         * tst-clock2.c: New file.
7039 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
7041         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
7042         to use exception-based cleanup handler.
7043         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7045         * tst-cond8.c (ch): Announce that we are done.
7047         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
7049         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
7050         Also test aio_suspend with timeout value.
7052 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
7054         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
7055         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
7056         attribute_hidden.
7058         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
7059         (__pthread_mutex_lock_internal): Likewise.
7060         (__pthread_mutex_unlock_internal): Likewise.
7061         (__pthread_mutex_unlock_usercnt): Declare.
7062         * pthread_mutex_destroy.c: Always fail if used in any way.
7063         * pthread_mutex_init.c: Update comment.
7064         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
7065         * pthread_mutex_timedlock.c: Adjust __nusers.
7066         * pthread_mutex_trylock.c: Adjust __nusers.
7067         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
7068         and public interfaces are wrapper with pass additional parameter.
7069         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
7070         parameter zero.
7071         * tst-mutex8.c: New file.
7072         * Makefile (tests): Add tst-mutex8.
7073         * sysdeps/pthread/pthread_cond_timedwait.c: Call
7074         __pthread_mutex_unlock_usercnt.
7075         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7076         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7077         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7078         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7079         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7080         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
7081         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7082         Add __nusers.
7083         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7084         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7085         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7086         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7087         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7089         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
7090         * pthread_mutex_timedlock.c: Likewise.
7091         * pthread_mutex_trylock.c: Adjust __nusers.
7092         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
7093         * tst-mutex9.c: New file.
7094         * Makefile (tests): Add tst-mutex9.
7095         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
7096         * sysdeps/ia64/tls.h: Likewise.
7097         * sysdeps/powerpc/tls.h: Likewise.
7098         * sysdeps/s390/tls.h: Likewise.
7099         * sysdeps/sh/tls.h: Likewise.
7100         * sysdeps/x86_64/tls.h: Likewise.
7101         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7102         Change type of __owner.
7103         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7104         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7105         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7106         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7107         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7109 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
7111         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
7112         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
7114         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
7115         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
7116         instead of nr to lll_futex_wake.  Only set errno and return -1
7117         if err < 0.
7119         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
7120         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7121         return actual return value from the syscall, not 0.
7123 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
7125         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
7126         find a random value.
7127         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
7128         errno==EIDRM.
7130         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
7131         compat_timer_settime.
7132         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
7133         compat_timer_gettime.
7134         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
7135         compat_timer_getoverrun.
7136         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
7137         compat_timer_delete.
7139         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7140         error-checking mutex detect busy mutexes.
7142 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7144         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7145         Add ax to clobber list.
7146         (lll_mutex_cond_lock): Likewise.
7147         (lll_mutex_unlock): Likewise.
7148         (lll_lock): Likewise.
7149         (lll_unlock): Likewise.
7151         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7152         * tst-cancel18.c: New file.
7153         * tst-cancelx18.c: New file.
7155         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7156         and tcdrain.
7158         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7159         * tst-cancel17.c: New file.
7160         * tst-cancelx17.c: New file.
7162         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7163         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7164         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7166         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7168 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7170         * sysdeps/pthread/createthread.c (create_thread): Set
7171         header.multiple_threads unconditionally.
7172         * allocatestack.c (allocate_stack): Likewise.
7173         * descr.h (struct pthread): Add header.multiple_threads
7174         unconditionally.
7175         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7176         Define for librt.  #error if neither libpthread, libc nor librt.
7177         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7178         Likewise.
7179         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7180         CDISABLE): Likewise.
7181         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7182         CDISABLE): Likewise.
7183         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7184         CDISABLE): Likewise.
7185         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7186         CDISABLE): Likewise.  Access header.multiple_threads outside of
7187         libc and libpthread.
7188         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7189         Likewise.
7190         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7191         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7193 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7195         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7196         Also test early cancellation before the thread reaches the cancellation
7197         point.
7199         * Makefile: Compile forward.c with exceptions.
7201         * sysdeps/unix/sysv/linux/sleep.c: New file.
7203 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7205         * Makefile: Add CFLAGS definition to compile function wrappers
7206         duplicated from libc with exceptions.
7207         * tst-cancel4.c: Also check cancellation handlers.
7209         * Makefile: Add rules to build and run tst-cancel16 and
7210         tst-cancelx16.  Add missing CFLAGS definitions.
7211         * tst-cancel16.c: New file.
7212         * tst-cancelx16.c: New file.
7214 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7216         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7217         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7218         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7219         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7221         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7222         (LIBC_CANCEL_RESET): Likewise.
7223         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7224         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7225         librt-cancellation.
7226         (CFLAGS-libcrt-cancellation.c): Define.
7227         * sysdeps/pthread/librt-cancellation.c: New file.
7228         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7229         macros also when compiling librt.
7230         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7231         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7232         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7233         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7234         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7235         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7236         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7238         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7239         compat_timer_create.
7241 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7243         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7245         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7246         __register_atfork.
7247         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7248         Add libc_hidden_def.
7250 2003-06-13  Roland McGrath  <roland@redhat.com>
7252         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7253         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7255 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7257         * allocatestack.c (queue_stack): Always inline.
7258         * ptreadhP.h (__do_cancel): Likewise.
7260 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7262         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7263         a typo.
7265 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7267         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7268         (__pthread_cond_signal): Remove incorrect second addition for
7269         cond_lock!=0.
7271 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7273         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7274         (__pthread_cond_signal): Use correct futex pointer in
7275         __lll_mutex_lock_wait call.
7277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7278         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7280 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7282         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7283         cancelable.
7284         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7285         Likewise.
7287         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7288         hand-written CFI generation code.  Since ENTRY/END also initiated
7289         CFI frames this caused two CFI sets to be generated.
7291 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7293         * cleanup_routine.c: New file.
7294         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7295         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7296         cleanup handling.
7297         * Makefile (libpthread-routines): Add cleanup_routine.
7298         Add more CFLAGS variables to compile with exceptions.  Add comments
7299         why which file needs unwind tables.
7300         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7301         tests.
7302         * tst-cancelx1.c: New file.
7303         * tst-cancelx2.c: New file.
7304         * tst-cancelx3.c: New file.
7305         * tst-cancelx4.c: New file.
7306         * tst-cancelx5.c: New file.
7307         * tst-cancelx6.c: New file.
7308         * tst-cancelx7.c: New file.
7309         * tst-cancelx8.c: New file.
7310         * tst-cancelx9.c: New file.
7311         * tst-cancelx10.c: New file.
7312         * tst-cancelx11.c: New file.
7313         * tst-cancelx12.c: New file.
7314         * tst-cancelx13.c: New file.
7315         * tst-cancelx14.c: New file.
7316         * tst-cancelx15.c: New file.
7317         * tst-cleanupx0.c: New file.
7318         * tst-cleanupx0.expect: New file.
7319         * tst-cleanupx1.c: New file.
7320         * tst-cleanupx2.c: New file.
7321         * tst-cleanupx3.c: New file.
7323         * tst-cleanup0.c: Make standard compliant.
7324         * tst-cleanup1.c: Likewise.
7326         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7327         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7328         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7329         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7330         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7331         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7332         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7333         CLEANUP_JMP_BUF.
7334         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7335         * tst-cancel12.c: New file.
7336         * tst-cancel13.c: New file.
7337         * tst-cancel14.c: New file.
7338         * tst-cancel15.c: New file.
7339         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7340         and tst-cancel15.
7342         * tst-cancel1.c: Add some comments.
7344         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7345         timeout correctly.
7347 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7349         * Makefile (CFLAGS-pthread_cancel.c): Define.
7351 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7353         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7354         Change type of __writer element to int.
7355         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7356         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7357         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7358         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7359         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7360         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7361         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7362         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7363         Compare with TID to determine deadlocks.
7364         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7365         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7366         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7367         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7368         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7369         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7370         Likewise.
7371         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7372         Likewise.
7373         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7374         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7375         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7376         Likewise.
7377         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7378         Likewise.
7379         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7380         * Makefile (tests): Add tst-rwlock12.
7381         * tst-rwlock12.c: New file.
7383 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7385         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7386         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7387         Remove bogus hidden_proto.
7388         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7389         Likewise.
7390         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7391         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7392         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7393         ___lll_mutex_timedlock): Likewise.
7395 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7397         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7398         (__pthread_cond_signal): Add some code to eventually handle
7399         cond_lock!=0.
7401 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7403         * Makefile (tests): Add tst-exec4.
7404         (tst-exec4-ARGS): Define.
7405         * tst-exec4.c: New file.
7407 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7409         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7410         Also fail if tv_nsec < 0.
7411         (__lll_timedwait_tid): Likewise.
7412         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7413         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7414         Likewise.
7415         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7416         Likewise.
7417         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7418         Likewise.
7419         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7420         Likewise.
7421         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7422         Likewise.
7423         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7424         Likewise.
7426         * Makefile (tests): Add tst-sem8 and tst-sem9.
7427         * tst-sem8.c: New file.
7428         * tst-sem9.c: New file.
7429         * sem_open.c: Fix creation of in_use record if the file exists but
7430         no internal record.
7432         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7433         definitions.
7435         * sysdeps/pthread/timer_create.c (timer_create): In case
7436         evp==NULL, assign timer ID to sival_ptr.
7438         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7439         struct pthread_unwind_buf *.
7440         (struct pthread): Likewise for cleanup_jmp_buf element.
7442         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7443         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7444         * unwind.c (__pthread_unwind_next): Likewise.
7446 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7448         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7449         (lll_futex_timed_wait): Use int for futex value parameter.
7450         (lll_futex_wake): Likewise.
7451         (lll_futex_requeue): Likewise.
7453         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7454         Replace one memory operation with one register operation.
7456         * tst-join4.c (do_test): Fix error message.
7458         * tst-rwlock6.c (do_test): Use correct format specifier.
7460         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7461         (__lll_mutex_lock_wait): Replace one memory operation with one
7462         register operation.
7463         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7464         (__lll_mutex_lock_wait): Likewise.
7466         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7467         (__lll_mutex_cond_lock): Add one to value parameter of
7468         __lll_lock_wait to reflect reality in the futex syscall.
7469         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7470         (lll_mutex_cond_lock): Likewise.
7472 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7474         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7475         New function.
7476         (lll_mutex_cond_lock): Define.
7478 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7480         * Makefile (tests): Add tst-signal6.
7481         * tst-signal6.c: New file.
7483         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7484         (__lll_mutex_unlock_force): New function
7485         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7487         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7488         (__lll_mutex_unlock_force): New function.
7489         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7491         * tst-rwlock7.c (do_test): Use correct format specifier.
7493         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7494         Find break parameter in correct asm argument.
7496 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7498         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7499         Remove out4.
7500         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7501         error occured.
7502         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7503         Add __mutex.
7504         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7505         lll_futex_requeue, lll_mutex_unlock_force): Define.
7507 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7509         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7510         (pthread_cond_t): Add __mutex.
7511         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7512         lll_futex_requeue, lll_mutex_unlock_force): Define.
7514 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7516         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7517         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7518         Add __mutex field.
7519         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7520         Define.
7521         (lll_futex_wait, lll_futex_wake): Define.
7522         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7523         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7524         FUTEX_REQUEUE instead of FUTEX_WAIT.
7525         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7526         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7527         mutex which was used in condvar structure.  Call
7528         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7529         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7531         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7532         include tcb-offsets.h.  Read wakeup value in locked region.
7533         Use the value of gbr register as THREAD_ID.
7534         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7535         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7536         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7538         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7539         macros.
7541 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7543         * sysdeps/pthread/pthread_cond_broadcast.c
7544         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7546 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7548         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7549         typo in register name.
7550         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7551         correctly.  Actually use requeue.  Little optimization.
7552         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7553         mutex address early.  Handle cancellation state as 32-bit value.
7554         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7555         Remove unnecessary label.
7557 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7559         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7560         instead of FUTEX_WAIT.
7561         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7563         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7564         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7565         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7566         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7567         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7568         of __pthread_mutex_lock_internal.
7569         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7570         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7571         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7572         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7573         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7574         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7575         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7576         Add pthread_mutex_cond_lock.
7577         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7578         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7579         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7580         lll_mutex_cond_lock.
7581         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7582         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7583         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7584         Add __mutex field.
7585         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7586         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7588         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7589         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7591         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7592         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7593         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7594         macro don't define aliases.
7596         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7597         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7598         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7599         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7600         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7601         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7602         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7603         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7604         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7606 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7608         * sem_open.c: Fix one endless loop.  Implement correct semantics
7609         wrt opening the same semaphore more then once.
7610         * sem_close.c: Adjust for sem_open change.
7611         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7612         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7613         * Makefile (tests): Add tst-sem7.
7614         * tst-sem7.c: New file.
7616 2003-05-16  Roland McGrath  <roland@redhat.com>
7618         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7619         uninitialized variable braino.
7621 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7623         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7624         test for syscall availability.
7626         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7627         __no_posix_timers to -1 if the syscalls don't exist.
7629         * pthread_join.c (pthread_join): Set tid field of the joined
7630         thread to -1.  This isn't necessary but helps to recognize some
7631         error conditions with almost no cost.
7633         * allocatestack.c (FREE_P): Also negative values indicate an
7634         unused stack.
7636         * unwind.c: Include <unistd.h>.
7638 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7640         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7642 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7644         * Makefile (crti-objs, crtn-objs): New variables.
7645         (omit-deps, extra-objs): Add crtn.
7646         ($(objpfx)libpthread.so): Depend on both crti and crtn
7647         and links to them in multidir.
7648         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7650 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7652         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7653         (lll_mutex_unlock): Use atomic_exchange_rel.
7655 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7657         * cond-perf.c (cons): Add missing locking around setting of alldone.
7659 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7661         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7662         related macros.
7663         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7665 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7667         * tst-sem6.c: New file.
7668         * Makefile (tests): Add tst-sem6.
7670         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7671         Use atomic_exchange_rel instead of atomic_exchange.
7672         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7673         Likewise.
7675         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7676         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7677         vsyscall is possible.
7679         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7680         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7681         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7682         pthread_setaffinity_np.
7683         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7684         and pthread_setaffinity_np.
7685         * Makefile (libpthread-routines): Add pthread_getaffinity and
7686         pthread_setaffinity.
7688         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7689         use it in case mmap to allocate the stack fails.
7690         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7691         ARCH_MAP_FLAGS here.
7692         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7693         ARCH_RETRY_MMAP.
7695 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7697         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7698         handler implementation.  It is now lockless in fork().
7699         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7700         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7701         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7702         declare the __fork_*_lists.
7703         (struct fork_handler): Include pointers to all three functions.
7704         Add next, refcntr and need_signal elements.
7705         (__fork_handlers): New declaration.
7706         (__register_atfork_malloc): Remove declaration.
7707         (HAVE_register_atfork_malloc): Remove definition.
7708         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7709         __pthread_child_handler variable.
7710         (__libc_pthread_init): Use __register_atfork instead of explicitly
7711         adding to the list.
7712         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7713         and lll_futex_wake.
7714         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7716         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7717         function must never be reached.
7719         * cond-perf.c: New file.
7721 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7723         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7725 2003-05-04  Roland McGrath  <roland@redhat.com>
7727         * Makefile ($(objpfx)../libc.so): New target.
7729 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7731         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7732         (pthread_condattr_t): Size is only an int, don't use long for
7733         alignment.
7734         (pthread_mutexattr_t): Likewise.
7735         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7736         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7737         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7739 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7741         * sysdeps/i386/tls.h: Define THREAD_ID.
7742         * sysdeps/ia64/tls.h: Likewise.
7743         * sysdeps/powerpc/tls.h: Likewise.
7744         * sysdeps/s390/tls.h: Likewise.
7745         * sysdeps/sh/tls.h: Likewise.
7746         * sysdeps/x86_64/tls.h: Likewise.
7747         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7748         record ownership.
7749         * pthread_mutex_timedlock.c: Likewise.
7750         * pthread_mutex_trylock.c: Likewise.
7751         * pthread_mutex_unlock.c: Likewise.
7752         * pthread_rwlock_trywrlock.c: Likewise.
7753         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7754         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7755         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7756         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7758         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7759         flag.
7761 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7763         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7764         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7765         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7766         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7767         Make __align long long instead of long.
7768         (pthread_rwlock_t): Formatting.
7769         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7770         (pthread_rwlock_t): Formatting.
7771         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7772         (pthread_cond_t): Make __align long long instead of long.
7773         (pthread_rwlock_t): Move __flags field to the same position as in
7774         linuxthreads.
7776 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7778         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7779         * tst-rwlock7.c (do_test): Likewise.
7781 2003-04-26  Roland McGrath  <roland@redhat.com>
7783         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7785 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7787         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7788         sizeof (struct pthread).
7789         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7790         1 struct pthread.
7791         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7792         to 0.
7793         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7794         struct pthread.
7795         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7796         to 32-bit bytes.
7797         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7798         tcbp.
7799         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7800         unneccessarily.
7801         (NO_TLS_OFFSET): Define.
7802         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7803         add TLS_TCB_SIZE unnecessarily.
7805 2003-04-22  Roland McGrath  <roland@redhat.com>
7807         * Makeconfig (shared-thread-library): Reverse link order to work
7808         around linker bug.
7810 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7812         * semaphore.h: Fix typo in comment.
7814 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7816         * sysdeps/pthread/sigfillset.c: New file.
7818         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7819         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7820         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7821         * sysdeps/pthread/sigaction.c: Likewise.
7822         * sysdeps/pthread/sigprocmask.c: New file.
7823         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7824         __SIGRTMIN+1.
7825         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7826         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7827         in this case.
7829 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7831         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7832         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7834         * sysdeps/unix/sysv/linux/unregister-atfork.c
7835         (__unregister_atfork): Don't free memory not allocated dynamically.
7837         * semaphore.h: Remove __THROW marker from cancellation points.
7838         * nptl/sysdeps/pthread/pthread.h: Likewise.
7840 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7842         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7843         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7844         __THROW.
7846 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7848         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7850 2003-04-15  Roland McGrath  <roland@redhat.com>
7852         * forward.c (__pthread_unwind): Tweak to avoid warning.
7854 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7856         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7858 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7860         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7861         overflow CFA advance instructions.
7862         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7864 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7866         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7867         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7868         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7869         defined.
7871         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7872         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7873         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7874         DW_CFA_advance_loc for .Laddl-.Lsubl.
7876 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7878         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7879         position-independent unwind data for static libraries.
7880         Add missing unwind info.  Add comments.
7882         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7883         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7884         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7885         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7887 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7889         * Makefile: Make sure all cancellation points are compiled with
7890         exception and asynchronous unwind tables.
7892         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7893         which mishandles loading of global object addresses in PIC.
7894         (THREAD_SETMEM_NC): Likewise.
7896 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7898         * pthread.h: Define new data structure for cleanup buffer.  Declare
7899         new cleanup handler interfaces.
7900         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7901         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7902         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7903         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7904         it.  Declare old cleanup handler installation functions.
7905         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7906         handling.
7907         * cleanup_defer.c: Likewise.
7908         * cleanup_compat.c: New file.  Old cleanup code.
7909         * cleanup_def_compat.c: New file.  Old cleanup code.
7910         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7911         if own thread descriptor.
7912         * unwind.c: New file.
7913         * forward.c: Add __pthread_unwind.
7914         * init.c (pthread_functions): Add __pthread_unwind.
7915         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7916         Add ptr___pthread_unwind.
7917         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7918         and unwind function.
7919         * Makefile (libpthread-routines): Add cleanup_compat,
7920         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7921         table generation if necessary.
7922         * version.c: Record whether unwind support is compiled in.
7923         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7924         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7925         handler interfaces.
7926         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7927         complication to generate unwind information for syscall wrappers.
7928         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7929         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7930         __cleanup_fct_attribute.
7932         * Makefile: Add rules to build and run tst-cleanup0.
7933         * tst-cleanup0.c: New file.
7934         * tst-cleanup0.expect: New file.
7936         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7937         caller.  Optimize to avoid often unecessary local variable.
7939 2003-04-11  Roland McGrath  <roland@redhat.com>
7941         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7942         sets variable `multidir'; include that.
7943         (generated): Add it.
7944         ($(objpfx)$(multidir)/crti.o): New target.
7945         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7947 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7949         * tst-attr2.c (do_test): Add cast to avoid warning.
7950         * tst-mutex4.c (do_test): Likewise.
7952 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7954         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7955         in child.
7957 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7959         * Makefile (tests): Add tst-detach1.
7960         * tst-detach1.c: New file.
7962 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7964         * sysdeps/pthread/pthread.h: Remove duplicate
7965         pthread_cleanup_{push,pop} definitions.
7967         * tst-barrier2.c: Eliminate warnings.
7968         * tst-cancel4.c: Likewise.
7969         * tst-cond4.c: Likewise.
7970         * tst-cond6.c: Likewise.
7971         * tst-detach1.c: Likewise.
7972         * tst-rwlock4.c: Likewise.
7973         * tst-rwlock6.c: Likewise.
7974         * tst-rwlock7.c: Likewise.
7975         * tst-sem3.c: Likewise.
7976         * tst-spin2.c: Likewise.
7977         * tst-umask1.c: Likewise.
7979 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7981         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7983 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7985         * descr.h (struct pthread): Move cancelhandling member to the front.
7987 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7989         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7990         malloc_parent, and malloc_child statically.
7991         (__register_atfork_malloc): New function.
7992         (free_mem): Don't free any of the malloc_* variables on the list.
7993         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7994         Define HAVE_register_atfork_malloc.
7996 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7998         * sysdeps/pthread/createthread.c (create_thread): Add some more
7999         comments explaining when to set multiple_threads and when not.
8001         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8002         THREAD_ATOMIC_BIT_SET if not already defined.
8003         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
8004         THREAD_ATOMIC_BIT_SET:
8005         * sysdeps/x86_64/tls.h: Likewise.
8006         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
8007         THREAD_ATOMIC_CMPXCHG_VAL.
8008         (_pthread_cleanup_pop_restore): Likewise.
8009         * cancellation.c (__pthread_enable_asynccancel): Likewise.
8010         (__pthread_enable_asynccancel_2): Likewise.
8011         (__pthread_disable_asynccancel): Likewise.
8012         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8013         (__libc_disable_asynccancel): Likewise.
8014         * init.c (sigcancel_handler): Likewise.
8015         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
8016         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
8018 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
8020         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
8021         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
8022         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
8023         * Makefile (tests): Add tst-cancel11.
8024         * tst-cancel11.c: New file.
8026 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
8028         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
8029         round, not the first.  Use specific_used flag instead of local
8030         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
8031         (__free_tcb): Don't call deallocate_tsd here.
8032         (start_thread): Call deallocate_tsd here.
8033         * pthread_setspecific.c: Set specific_used flag really only when
8034         needed.
8035         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
8036         * tst-tsd3.c: New file.
8037         * tst-tsd4.c: New file.
8039 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8041         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
8042         Use atomic_exchange_and_add instead of __lll_add.
8043         (__lll_mutex_timedlock): Likewise.
8044         Patch by Ian Wienand.
8046 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
8048         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8049         (SINGLE_THREAD_P): Fix typo.
8050         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
8052 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
8054         * Makefile (tests): Add tst-align.
8055         * tst-align.c: New file.
8056         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
8058         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
8059         function correctly.
8061         * tst-tsd2.c: Add casts to avoid warnings.
8063 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
8065         * descr.h (struct pthread): Move most often used elements to the front.
8067 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
8069         * Makefile (libpthread-routines): Add pthread_atfork.
8070         (libpthread-static-only-routines): Add pthread_atfork.
8072 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8074         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
8075         of TLS_DTV_AT_TP.
8076         (INSTALL_DTV): Add parens.
8077         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
8078         Use passed descr instead of THREAD_SELF.
8079         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
8080         (__lll_mutex_timedlock_wait): Correct expected value after
8081         spurious wakeup.
8082         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
8083         Release lock before waking up the waiters.
8084         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
8085         criteria.  Reorderstruct passed to cleanup handler.  Fix
8086         handling of cancellation and failung pthread_mutex_unlock call.
8087         Use __pthread_enable_asynccancel_2 instead of
8088         __pthread_enable_asynccancel.
8089         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8090         Return result of lock re-get if it fails.
8091         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
8092         for __pthread_cleanup_push.
8093         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
8094         completely broken rwlock implementation.
8095         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8096         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8097         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8098         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
8099         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8100         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
8101         versioned_symbol macro.
8102         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
8103         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8105 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
8107         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
8108         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
8109         and __helper_tid.
8110         (struct timer): Remove th and bar field.
8111         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
8112         debugging code.  Create only one helper thread.
8113         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
8114         helper thread.
8115         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8116         Renamed.  Define statically.  Use thread info from siginfo.
8117         (__helper_once): New variable.
8118         (__helper_tid): New variable.
8119         (__reset_helper_control): New function.
8120         (__start_helper_thread): New function.
8122         * pthread_create.c (start_thread): Don't use setjmp inside
8123         __builtin_expect to work around gcc bug.
8125         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
8126         timer_delete syscall fails, but not with ENOSYS, set
8127         __no_posix_timers.
8129         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
8130         (timer_settime): Fix typo.
8131         * sysdeps/unix/sysv/linux/timer_getoverr.c
8132         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
8134 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
8136         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
8137         offset of cleanupbuf.__prev.
8139 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8141         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8142         of included file.
8144 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8146         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8147         NULL provide default definition to syscall.
8149 2003-03-25  Roland McGrath  <roland@redhat.com>
8151         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8152         (timer_id2ptr): Fix typo.
8154 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8156         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8157         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8158         * sysdeps/ia64/pthreaddef.h: Likewise.
8159         * sysdeps/powerpc/pthreaddef.h: Likewise.
8160         * sysdeps/s390/pthreaddef.h: Likewise.
8161         * sysdeps/sh/pthreaddef.h: Likewise.
8162         * sysdeps/x86_64/pthreaddef.h: Likewise.
8163         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8164         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8165         being changed.
8166         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8167         SIGTIMER is not unblocked.
8168         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8169         RT signal taken.
8170         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8171         be send.
8172         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8173         pass pointer through as ID.
8174         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8175         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8176         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8177         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8178         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8179         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8180         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8181         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8182         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8183         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8184         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8185         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8186         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8187         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8188         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8189         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8190         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8191         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8192         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8193         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8194         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8195         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8196         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8197         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8198         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8199         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8200         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8201         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8202         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8203         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8204         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8205         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8206         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8208         * pthreadP.h: Remove FRAME_LEFT definition.
8209         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8210         already left frame.  Programs which have this problem are not POSIX
8211         compliant.
8212         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8214 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8216         * sysdeps/pthread/tst-timer.c: Check return values of the
8217         functions we test.
8219 2003-03-23  Roland McGrath  <roland@redhat.com>
8221         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8222         * tst-tls3mod.c: Likewise.
8223         * tst-tls1.c: Likewise.
8224         * tst-tls2.c: Likewise.
8226         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8227         undefined behavior.
8229         * tst-join5.c (tf1, tf2): Add a cast.
8231         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8233         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8234         Don't test anything.
8235         * tst-cond4.c: Likewise.
8236         * tst-cond6.c: Likewise.
8237         * tst-flock2.c: Likewise.
8238         * tst-mutex4.c: Likewise.
8239         * tst-rwlock4.c: Likewise.
8240         * tst-signal1.c: Likewise.
8241         * tst-spin2.c: Likewise.
8242         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8244         * tst-mutex4.c: Use test-skeleton.c.
8245         * tst-spin2.c: Likewise.
8246         * tst-sysconf.c: Likewise.
8247         * tst-barrier2.c: Likewise.
8248         * tst-cond4.c: Likewise.
8249         * tst-cond6.c: Likewise.
8250         * tst-rwlock4.c: Likewise.
8251         * tst-unload.c: Likewise.
8252         * tst-flock2.c (do_test): Use return instead of exit.
8254 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8256         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8258 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8260         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8261         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8262         instead of __lll_compare_and_swap.
8263         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8264         Likewise.
8265         Removed definition if __lll_compare_and_swap.
8267         * cancellation.c: Adjust for new form of compare&exchange macros.
8268         * cleanup_defer.c: Likewise.
8269         * init.c: Likewise.
8270         * libc-cancellation.c: Likewise.
8271         * old_pthread_cond_broadcast.c: Likewise.
8272         * old_pthread_cond_signal.c: Likewise.
8273         * old_pthread_cond_timedwait.c: Likewise.
8274         * old_pthread_cond_wait.c: Likewise.
8275         * pthread_cancel.c: Likewise.
8276         * pthread_create.c: Likewise.
8277         * pthread_detach.c: Likewise.
8278         * pthread_join.c: Likewise.
8279         * pthread_key_delete.c: Likewise.
8280         * pthread_setcancelstate.c: Likewise.
8281         * pthread_setcanceltype.c: Likewise.
8282         * pthread_timedjoin.c: Likewise.
8283         * pthread_tryjoin.c: Likewise.
8284         * sysdeps/pthread/createthread.c: Likewise.
8286 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8288         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8289         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8290         definitions.  Replace uses with calls to atomic_* functions.
8291         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8292         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8293         __lll_test_and_set calls with atomic_exchange_and_add and
8294         atomic_exchange calls respectively.
8295         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8296         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8297         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8298         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8299         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8300         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8301         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8303         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8304         returns the old value.
8306 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8308         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8309         int for variable OLDVAL and correct inline assembler contraint.
8310         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8311         type int for variable OLD.
8313         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8314         only for s390-32.
8315         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8316         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8317         instead of multiple_threads field in the TCB.
8319 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8321         * sysdeps/i386/i686/bits/atomic.h: Removed.
8322         * sysdeps/i386/i586/bits/atomic.h: Removed.
8323         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8324         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8325         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8326         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8327         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8328         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8329         * atomic.h: Removed.  Moved to glibc.
8331         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8332         support for clock selection.
8334         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8335         signalling waiters.
8337 2003-03-18  Roland McGrath  <roland@redhat.com>
8339         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8340         Add __lll_rel_instr first.  Add memory clobber.
8341         (lll_mutex_unlock): Use __lll_test_and_set.
8342         From Paul Mackerras <paulus@samba.org>.
8344         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8345         unconditionally.
8346         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8347         (SINGLE_THREAD_P):  Add `header.' prefix.
8348         From Paul Mackerras <paulus@samba.org>.
8350         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8351         pthread_timedjoin_np to ...
8352         (libpthread: GLIBC_2.3.3): ... here.
8353         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8355         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8356         Avoid shadowing VAL variable.
8358         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8359         New macro.
8361 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8363         * Makefile (tests): Add tst-cond11.
8364         * tst-cond11.c: New file.
8366         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8367         struct passed to cleanup handler to eliminate one more
8368         instruction.
8369         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8371         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8372         (pthrad_cond_t): Replace __unused field with __clock.
8374         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8375         waken all waiters in cleanup handler.
8376         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8377         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8379         * pthread_condattr_getclock.c: New file.
8380         * pthread_condattr_setclock.c: New file.
8381         * sysdeps/pthread/pthread.h: Declare these new functions.
8382         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8383         * Makefile (libpthread-routines): Add the new functions.
8384         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8385         Renamed field to value.  Document use of the bits.
8386         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8387         change.
8388         * pthread_condattr_setpshared.c: Likewise.
8389         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8390         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8391         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8392         Add __clock field.
8393         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8394         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8395         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8396         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8397         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8398         Implement clock selection.
8399         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8400         * pthread-errnos.sym: Add ENOSYS.
8401         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8402         _POSIX_CLOCK_SELECTION.
8403         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8405         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8406         invalid .size directive.
8408 2003-03-17  Roland McGrath  <roland@redhat.com>
8410         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8411         Formatting tweaks.
8413 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8415         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8416         Use __lll_add instead of spelling it out.  Use protected symbol names.
8417         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8418         Use __lll_add.
8419         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8420         Renamed from lll_compare_and_swap.  Use new name where necessary.
8421         (__lll_add): Defined.
8422         (__lll_dec_if_positive): Defined.
8423         (__lll_test_and_set): Defined.
8424         * sysdeps/ia64/pthread_spin_init.c: Removed.
8425         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8426         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8427         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8428         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8429         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8430         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8431         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8432         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8433         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8434         __sync_lock_release_si.
8435         Patch by Jakub Jelinek.
8437         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8438         Fix timeout handling.
8439         (__lll_timedwait_tid): Likewise.
8440         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8441         Patch by Jakub Jelinek.
8443         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8445 2003-03-17  Roland McGrath  <roland@redhat.com>
8447         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8448         * sysdeps/pthread/pthread_spin_init.c: New file.
8449         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8450         * sysdeps/powerpc/Makefile: New file.
8451         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8452         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8453         * sysdeps/powerpc/pthreaddef.h: New file.
8454         * sysdeps/powerpc/tcb-offsets.sym: New file.
8455         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8456         * sysdeps/powerpc/tls.h: New file.
8457         * sysdeps/powerpc/bits/atomic.h: New file.
8458         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8459         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8460         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8462         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8463         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8464         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8465         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8466         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8467         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8468         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8469         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8470         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8471         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8472         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8473         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8474         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8475         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8476         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8478         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8479         not gettimeofday.
8480         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8481         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8482         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8483         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8484         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8486 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8488         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8489         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8490         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8491         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8492         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8494 2003-03-16  Roland McGrath  <roland@redhat.com>
8496         * tst-fork4.c: Include <string.h>.
8497         * tst-signal2.c: Likewise.
8498         * tst-mutex5.c (do_test): exit -> return.
8499         * tst-mutex2.c: Include <stdlib.h>.
8501 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8503         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8504         (__lll_mutex_timedlock_wait): Correct expected value after
8505         spurious wakeup.  Otherwise we would never wait again.
8507         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8508         zone versus inline asm stupidity.  Use correct instructions.
8510         * tst-rwlock6.c: Add some more status output.
8512 2003-03-15  Roland McGrath  <roland@redhat.com>
8514         * sysdeps/pthread/configure.in: New file.
8515         * sysdeps/pthread/configure: New file (generated).
8517 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8519         * allocatestack.c (allocate_stack): Store the exact stack size of
8520         user allocated stacks.
8522 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8524         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8525         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8526         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8527         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8528         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8529         Use `header.' prefix.
8530         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8532 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8534         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8535         __builtin_frame_address, use stack pointer.
8537         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8538         instead of __builtin_frame_pointer.
8540 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8542         * tst-basic1.c (do_test): Add cast to avoid warning.
8543         * tst-basic2.c (do_test): Likewise.
8545         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8546         amount of stack correction.
8548         * tst-fork4.c: Use test-skeleton.c.
8550 2003-03-14  Roland McGrath  <roland@redhat.com>
8552         * init.c: Fix typo "#eli" for "#else".
8554 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8556         * allocatestack.c (__stack_user): Use hidden_data_def.
8557         * pthread_create.c (__pthread_keys): Likewise.
8559         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8561 2003-03-14  Roland McGrath  <roland@redhat.com>
8563         * tst-fork4.c: New file.
8564         * Makefile (tests): Add it.
8566         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8567         we always define the padding space.
8568         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8569         stopped supporting its own extensions fully.
8570         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8571         struct also called `header', so `header.multiple_threads' is the field
8572         name to use on all machines.
8573         * allocatestack.c (allocate_stack): Use `header.' prefix.
8574         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8575         * pthread_create.c (__pthread_create_2_1): Likewise.
8576         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8577         (THREAD_SELF): Likewise.
8578         * sysdeps/x86_64/tls.h: Likewise.
8579         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8580         (SINGLE_THREAD_P): Likewise.
8581         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8582         (SINGLE_THREAD_P): Likewise.
8583         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8584         (SINGLE_THREAD_P): Likewise.
8586         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8587         value directly.
8589 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8591         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8592         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8594         * pthread_create.c (start_thread): setjmp is expected to return 0.
8596         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8597         (THREAD_GETMEM_NC): Likewise.
8599 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8601         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8602         and the size of the stack which must be allocated is a multiple,
8603         allocate one more page.
8604         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8605         MULTI_PAGE_ALIASING.
8607 2003-03-13  Roland McGrath  <roland@redhat.com>
8609         * pthread_create.c (start_thread): Set EXITING_BIT after the
8610         event-reporting (and destructors), not before.
8612 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8614         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8615         lll_futex_wake): Declare register variables as long int instead of
8616         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8617         Make syscall arguments clobbered by the syscall.
8618         (lll_futex_wait): Define using lll_futex_timed_wait.
8620         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8621         to void *.
8623         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8624         PPID if [! NDEBUG].
8626         * allocatestack.c (nptl_ncreated): Only declare if
8627         COLORING_INCREMENT != 0.
8629         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8630         (__libc_enable_asynccancel_2): Remove prototype.
8632         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8633         ctid to match kernel.
8635 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8637         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8638         libc_multiple_threads.
8639         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8640         __libc_multiple_threads to...
8641         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8643         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8644         versioning.
8645         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8646         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8648         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8649         (__pthread_once_internal): Define.
8651         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8652         macros instead of .symver directly.
8653         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8654         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8656         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8657         * sysdeps/x86_64/tcb-offsets.sym: New file.
8658         * sysdeps/x86_64/Makefile: New file.
8660         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8661         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8662         to access own pthread_t in TCB.
8663         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8664         Likewise.
8665         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8666         Likewise.
8667         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8669 2003-03-12  Roland McGrath  <roland@redhat.com>
8671         * pthread-errnos.sym: New file.
8672         * Makefile (gen-as-const-headers): New variable, list that file.
8673         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8674         header <pthread-errnos.h> instead of defining errno values here.
8675         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8676         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8677         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8678         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8679         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8680         Likewise.
8681         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8682         Likewise.
8683         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8684         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8685         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8686         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8687         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8688         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8689         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8690         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8691         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8692         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8693         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8694         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8695         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8696         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8697         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8698         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8699         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8700         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8701         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8702         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8703         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8704         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8705         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8706         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8707         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8708         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8709         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8711         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8712         CLONE_CHILD_SETTID worked.
8714 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8716         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8717         file.
8718         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8719         file.
8721         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8722         (pthread_cond_t): Add padding.
8724         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8725         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8726         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8728         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8729         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8730         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8731         (__pthread_rwlock_timedrdlock): Likewise.
8732         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8733         (__pthread_rwlock_wrlock): Likewise.
8734         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8735         (__pthread_rwlock_rdlock): Likewise.
8737         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8739         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8740         result of lock re-get if it fails.
8742 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8744         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8745         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8746         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8747         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8748         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8749         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8750         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8751         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8752         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8753         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8755         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8756         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8758         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8759         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8760         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8761         (create_thread): Likewise.
8762         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8763         * init.c (__pthread_initialize_minimal_internal): Initialize
8764         __libc_multiple_threads_ptr if necessary.
8765         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8766         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8767         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8768         __libc_multiple_threads.
8769         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8770         necessary.
8772         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8773         (THREAD_SETMEM_NC): Likewise.
8775         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8776         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8777         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8778         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8780         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8781         Eliminate one entire instruction.
8783         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8784         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8786         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8787         instead of __pthread_enable_asynccancel.
8788         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8789         (__pthread_cond_wait): Likewise.
8790         * sysdeps/pthread/pthread_cond_timedwait.c
8791         (__pthread_cond_timedwait): Likewise.
8792         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8794         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8795         (__condvar_cleanup): Wake up all waiters in case we got signaled
8796         after being woken up but before disabling asynchronous
8797         cancellation.
8798         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8799         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8800         (__condvar_cleanup): Likewise.
8802         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8803         Make it an error if architecture has no #if case.  Add x86-64.
8805         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8806         pt-initfini.s generation.
8808         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8809         (TLS_INIT_TP): Fix typo.
8811 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8813         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8814         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8816         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8817         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8818         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8819         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8820         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8821         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8822         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8823         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8825 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8827         * sysdeps/pthread/pthread_cond_timedwait.c
8828         (__pthread_cond_timedwait): Return the result of the final
8829         locking.  If it succeeds, the regular function return value.
8831         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8832         Return result of the final locking.
8833         * version.c (__nptl_main): Work around problems with the strange
8834         INTERNAL_SYSCALL macro on ppc32.
8835         * init.c (__pthread_initialize_minimal_internal): Unblock
8836         SIGCANCEL in case the parent blocked it.
8837         Reported by Paul Mackerras <paulus@samba.org>.
8839         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8840         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8841         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8843 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8845         * sysdeps/pthread/pthread_cond_timedwait.c
8846         (__pthread_cond_timedwait): Unlock and fail if
8847         __pthread_mutex_unlock_internal failed.
8849         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8850         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8851         Use ARCH_CLONE.
8852         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8853         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8854         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8855         ALLOCATE_STACK): New macros.
8856         (TLS_TPADJ): New macro.
8857         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8858         (allocate_stack): Handle TLS_DTV_AT_TP and
8859         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8860         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8861         Don't set PD->self.
8862         * init.c [__ia64__] (__NR_set_tid_address): Define.
8864         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8865         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8866         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8867         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8868         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8869         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8870         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8871         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8872         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8873         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8874         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8875         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8876         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8877         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8878         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8879         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8880         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8881         * sysdeps/ia64/bits/atomic.h: New file.
8882         * sysdeps/ia64/Makefile: New file.
8883         * sysdeps/ia64/pthread_spin_init.c: New file.
8884         * sysdeps/ia64/pthread_spin_lock.c: New file.
8885         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8886         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8887         * sysdeps/ia64/pthreaddef.h: New file.
8888         * sysdeps/ia64/tcb-offsets.sym: New file.
8889         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8890         * sysdeps/ia64/tls.h: New file.
8892         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8893         to syscall instead of no arguments.
8895 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8897         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8898         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8899         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8900         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8902         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8903         unused code.
8905         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8907         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8908         lowlevelbarrier.sym.
8909         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8910         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8911         Include lowlevelbarrier.h and don't define offsets locally.
8912         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8914         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8915         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8916         (__lll_mutex_timedlock_wait): Likewise.
8917         (lll_mutex_lock): Adjust asm for that.
8918         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8919         (lll_lock): Adjust asm for operand order change.
8920         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8921         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8923         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8924         Reverse order of parameters.
8925         (__lll_timedwait_tid): Remove regparms attribute.
8926         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8927         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8929         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8930         (__lll_timedwait_tid): Remove one unnecessary instruction.
8932         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8933         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8934         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8935         lowlevelmutex.S.
8937         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8938         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8939         for NOT_IN_libc.
8940         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8941         lowlevellock.S.
8943         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8944         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8945         for libc.so.
8946         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8947         define LOCK here (if UP is not defined).  The actual code is in
8948         lowlevelmutex.S.
8950         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8951         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8952         __lll_timedwait_tid for libc.so.
8953         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8954         define LOCK here (if UP is not defined).  The actual code is in
8955         lowlevellock.S.
8957         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8958         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8959         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8960         instead of lowlevelsem.h.
8961         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8962         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8963         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8965         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8966         lowlevelrwlock.sym.
8967         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8968         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8969         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8971         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8972         register loading.
8973         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8974         last changed.  D'oh.
8976         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8978         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8979         of __libc_locking_needed.
8980         (lll_trylock): Initialize %eax to zero.
8982         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8983         pthread_cond_t definition.
8985 2003-03-10  Roland McGrath  <roland@redhat.com>
8987         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8988         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8989         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8990         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8991         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8993         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8994         Instead of setting PD->multiple_threads, set globals
8995         __pthread_multiple_threads and __libc_multiple_threads.
8996         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8997         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8998         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
9000         * descr.h (struct pthread): Conditionalize first member on
9001         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
9002         containing an anonymous tcbhead_t.  Move `list' member out.
9003         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
9004         * allocatestack.c: Remove use of `header.data.' prefix.
9005         * pthread_create.c: Likewise.
9006         * init.c (__pthread_initialize_minimal_internal): Likewise.
9007         * sysdeps/pthread/createthread.c (create_thread): Likewise.
9008         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
9009         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
9010         * sysdeps/x86_64/tls.h: Likewise.
9011         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
9012         (SINGLE_THREAD_P): Likewise.
9013         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
9014         (SINGLE_THREAD_P): Likewise.
9015         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
9016         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
9018 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
9020         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
9022         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
9023         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9025         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
9026         leftovers from the ia32 code.
9028         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
9029         memory load.
9030         (clear_once_control): Don't load %esi.
9032         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
9033         handling.
9035         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
9037         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
9038         * sysdeps/unix/sysv/linux/createthread.c: ...here.
9040         * Makefile (tests): Add tst-cond10.
9041         * tst-cond10.c: New file.
9043 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
9045         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
9046         * tst-signal3.c (do_test): Likewise.
9047         * tst-sem5.c (do_test): Likewise.
9048         * tst-kill6.c (do_test): Likewise.
9049         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
9051         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
9052         of inc/dec.
9053         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9054         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
9055         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
9056         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
9057         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9058         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9059         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9060         Likewise.
9061         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9062         Likewise.
9063         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9064         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9065         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9066         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9067         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9068         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9069         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9070         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9072         * allocatestack.c (allocate_stack): If mprotect() fails free the
9073         TLS memory.
9075 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
9077         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
9079         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
9080         lll_wake_tid.  This was used only to work around kernel limits in
9081         the early days.
9082         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
9083         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
9084         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9085         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
9087         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
9088         (__pthread_initialize_minimal_internal): Change initialization of
9089         __static_tls_align_m1 appropriately.
9090         * pthreadP.h (__static_tls_align_m1): Renamed from
9091         __static_tls_align.
9092         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
9093         instead of __static_tls_align-1.
9095 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
9097         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
9099         * pthread_create.c: Define __pthread_keys using nocommon
9100         attribute, not by placing it explicitly in bss.
9101         Remove DEFINE_DEALLOC definition.  Not needed anymore.
9103         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
9104         Use it in mmap call to allocate stacks.
9106         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
9108         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
9109         result of the thread function.
9111 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
9113         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
9114         version is just fine.
9116         * sysdeps/unix/sysv/linux/libc_pthread_init.c
9117         (__pthread_child_handler): Renamed from pthread_child_handler,
9118         exported, and marked hidden.  Change all users.
9119         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
9120         free __pthread_child_handler from child list.
9122 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9124         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
9126         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9127         Fix handling of cancellation and failing pthread_mutex_unlock call.
9128         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9129         (__pthread_cond_wait): Likewise.
9131         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
9132         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
9133         lll_futex_timed_wait call.
9134         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
9135         (pthread_rwlock_timedwrlock): Likewise.
9137         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
9138         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
9139         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9141         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9142         check of lll_futex_wake return value.
9144 2003-03-03  Roland McGrath  <roland@redhat.com>
9146         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9148         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9149         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9150         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9152 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9154         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9155         error for CPU clocks.
9157         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9158         _POSIX_MONOTONIC_CLOCK.
9159         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9161         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9162         recent kernels.
9164 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9166         * descr.h (struct pthread): Move cleanup field to the front.
9168 2003-03-01  Roland McGrath  <roland@redhat.com>
9170         * sem_open.c (sem_open): Braino fix.
9172 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9174         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9175         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9176         __pthread_cleanup_pop functionality.
9177         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9179         * descr.h (struct pthread): Move tid field to the front now that
9180         it is often used.
9182         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9183         (__lll_mutex_timedlock_wait): Remove.
9184         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9185         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9186         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9187         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9188         (lll_unlock_wake_cb): Don't save and restore %esi.
9189         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9190         %esi.
9191         (__lll_timedwait_tid): Add alignment.
9192         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9193         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9194         %esi.
9195         (__lll_timedwait_tid): Removed.
9196         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9197         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9198         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9199         (pthread_barrier_wait): Don't save, load, and restore %esi for
9200         last thread.
9201         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9202         (__pthread_cond_signal): Don't save, load, and restore %esi.
9203         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9204         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9205         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9206         Don't save, load, and restore %esi.
9208 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9210         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9211         Release lock before waking up the waiters.
9213         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9215         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9216         (reader_thread): Likewise.
9218         * sysdeps/pthread/pthread_rwlock_unlock.c
9219         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9220         to wake up readers if there are none.
9222         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9223         Release internal lock before wake threads.
9225 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9227         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9228         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9229         predefined.
9230         * tst-rwlock9.c: Likewise.
9231         * tst-rwlock10.c: New file.
9232         * tst-rwlock11.c: New file.
9234         * Makefile (tests): Add tst-dlsym1.
9235         * tst-dlsym1.c: New file.
9237         * init.c (__pthread_initialize_minimal_internal): Set
9238         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9239         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9241 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9243         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9245         * tst-cond2.c: Fix sychronization with child.
9247         * tst-rwlock8.c (reader_thread): Remove unused variable.
9249         * Makefile: Add rules to build and run tst-tls3.
9250         * tst-tls3.c: New file.
9251         * tst-tls3mod.c: New file.
9253         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9254         * tst-rwlock8.c: New file.
9255         * tst-rwlock9.c: New file.
9256         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9257         complete broken rwlock implementation.
9258         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9259         Likewise.
9260         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9261         Likewise.
9262         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9263         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9264         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9265         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9266         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9267         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9268         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9270 2003-02-23  Roland McGrath  <roland@redhat.com>
9272         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9274 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9276         * Makefile (tests): Add tst-context1.
9277         * tst-context1.c: New file.
9279         * Makefile (tests): Add tst-tls1 and tst-tls2.
9280         * tst-tls1.c: New file.
9281         * tst-tls2.c: New file.
9283         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9284         for failed cmpxchg.
9286         * pthread_create.c (start_thread): Set EXITING_BIT early.
9288         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9289         (THREAD_GETMEM_NC): Likewise.
9291 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9293         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9294         off 3 more bytes by using offset-less instructions when possible.
9296         * Makefile: Add dependency for $(objpfx)version.d.
9298         * eintr.c (eintr_source): Add unnecessary return but the compiler
9299         insists.
9301         * tst-kill3.c: Include <unistd.h>.
9303 2003-02-21  Roland McGrath  <roland@redhat.com>
9305         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9307 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9309         * Makefile (tests): Add tst-eintr1.
9310         (distribute): Add eintr.c.
9311         * tst-eintr1.c: New file.
9312         * eintr.c: New file.
9314         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9316         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9317         Disallow sending SIGCANCEL.
9319         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9320         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9321         * tst-kill1.c: New file.
9322         * tst-kill2.c: New file.
9323         * tst-kill3.c: New file.
9324         * tst-kill5.c: New file.
9325         * tst-kill6.c: New file.
9326         * tst-basic7.c: Renamed to...
9327         * tst-kill4.c: ...this.
9329 2003-02-21  Roland McGrath  <roland@redhat.com>
9331         * Makefile (install-lib-ldscripts): New variable.
9333 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9335         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9336         * pthread_cancel.c: Use INVALID_TD_P.
9337         * pthread_detach.c: Likewise.
9338         * pthread_getschedparam.c: Likewise.
9339         * pthread_setschedparam.c: Likewise.
9340         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9341         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9342         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9343         * pthread_timedjoin.c: Likewise.
9345         * tst-basic7.c: Include <signal.h>.
9347         * pthread_join.c (pthread_join): Limited checking for invalid
9348         descriptors.
9349         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9351 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9353         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9354         beginning of the loop.  Clear the entire first block of TSD.
9355         * Makefile (tests): Add tst-key4.
9356         * tst-key4.c: New file.
9358 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9360         * Makefile (tests): Add tst-basic7.
9361         * tst-basic7.c: New file.
9363         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9364         Add some more __builtin_expect.
9366         * pthreadP.h: Define dummy version of DEBUGGING_P.
9368 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9370         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9371         _POSIX_THREAD_PRIORITY_SCHEDULING.
9372         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9373         _XOPEN_REALTIME_THREADS.
9374         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9376         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9377         kernel returns EINVAL for PID <= 0, work around it.
9379         * Makefile (tests): Add tst-signal5.
9380         * tst-signal5.c: New file.
9382         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9383         and LOGIN_NAME_MAX.
9385         * tst-cancel1.c (tf): Block all signals.
9387         * Makefile (tests): Add tst-basic6.
9388         * tst-basic6.c: New file.
9390         * tst-basic1.c: Add test for process ID.
9392         * Makefile (tests): Add tst-cancel10.
9393         * tst-cancel10.c: New file.
9395         * Makefile (tests): Add tst-signal4.
9396         * tst-signal4.c: New file.
9398         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9399         __sigismember instead of sigismember.  Add __builtin_expect.
9401 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9403         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9404         pthread_setcancelstate, and pthread_rwlock_setpshared.
9406         * tst-cancel7.c (do_test): Make sure the pid file exists before
9407         canceling the thread.
9409         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9410         pthread_rwlock_timedrdlock tests.
9411         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9412         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9413         Check for invalid tv_nsec field.
9414         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9415         Likewise.
9417         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9418         recursive mutex of overflow.
9420         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9422         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9423         going into an endless loop.
9424         * Makefile (tests): Add tst-cancel9.
9425         * tst-cancel9.c: New file.
9427         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9429 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9431         * tst-mutex5.c (do_test): Add more timedlock tests.
9433         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9434         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9436         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9437         use INLINE_SYSCALL.  Error number is returned, not -1.
9439         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9440         and __deallocate_stack with internal_function.
9441         * pthread_create.c: Adjust definitions appropriately.
9442         * allocatestack.c: Likewise.
9444         * pthread_join.c: Add one more __builtin_expect.
9445         * pthread_timedjoin.c: Likewise.
9447         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9448         not data of sequence number does not match.
9449         Add one __builtin_expect.
9451         * Makefile (tests): Add tst-clock1.
9452         * tst-clock1.c: New file.
9454         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9455         negative arguments.
9456         * Makefile (tests): Add tst-basic5.
9457         * tst-basic5.c: New file.
9459 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9461         * Makefile (tests): Add tst-basic4.
9462         * tst-basic4.c: New file.
9464         * pthreadP.h: Add declaraction for __nptl_nthreads.
9465         * pthread_create.c: Define __nptl_nthreads
9466         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9467         after thread is done.  If then zero, call exit(0).
9468         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9469         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9470         * init.c (pthread_functions): Initialize ptr_nthreads.
9471         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9472         (__reclaim_stacks): Decrement __nptl_nthreads.
9473         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9474         Define.
9475         * Makefile (tests): Add tst-basic3.
9476         * tst-basic3.c: New file.
9478         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9479         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9480         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9481         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9482         if asynchronous canceling is enabled.
9483         * pthread_join.c (pthread_join): When recognizing circular joins,
9484         take into account the other thread might be already canceled.
9485         * Makefile (tests): Add tst-join5.
9486         * tst-join5.c: New file.
9488         * Makefile (tests): Add tst-join4.
9489         * tst-join4.c: New file.
9491 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9493         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9495 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9497         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9498         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9499         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9500         warning.
9501         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9502         to avoid warning.
9503         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9504         error if lll_futex_wake failed.
9506 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9509         handling of cancellation and failung pthread_mutex_unlock call.
9510         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9511         * Makefile (tests): Add tst-cond8 and tst-cond9.
9512         * tst-cond8.c: New file.
9513         * tst-cond9.c: New file.
9515         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9517         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9518         non-standard initializers with __USE_GNU.
9520         * Makefile (tests): Add tst-cleanup3.
9521         * tst-cleanup3.c: New file.
9523 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9525         * Makefile (tests): Add tst-attr1 and tst-attr2.
9526         * tst-attr1.c: New file.
9527         * tst-attr2.c: New file.
9529         * Makefile: Add rules to build and run tst-atfork2 test.
9530         * tst-atfork2.c: New file.
9531         * tst-atfork2mod.c: New file.
9533         * sysdeps/unix/sysv/linux/unregister-atfork.c
9534         (__unregister_atfork): Free the memory allocated for the handlers
9535         after removing them from the lists.
9537         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9538         cleanup function.
9540         * tst-atfork1.c (do_test): Wait for the child we forked.
9541         Report error in child.
9543         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9545         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9547 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9549         * Makefile (tests): Add tst-cancel8.
9550         * tst-cancel8.c: New file.
9552         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9553         clearing of control variable.
9554         * Makefile (tests): Add tst-once3 and tst-once4.
9555         * tst-once3.c: New file.
9556         * tst-once4.c: New file.
9558 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9560         * sysdeps/sh/Makefile: New file.
9561         * sysdeps/sh/bits/atomic.h: New file.
9562         * sysdeps/sh/pthread_spin_init.c: New file.
9563         * sysdeps/sh/pthread_spin_lock.c: New file.
9564         * sysdeps/sh/pthread_spin_trylock.S: New file.
9565         * sysdeps/sh/pthread_spin_unlock.S: New file.
9566         * sysdeps/sh/pthreaddef.h: New file.
9567         * sysdeps/sh/tcb-offsets.sym: New file.
9568         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9569         * sysdeps/sh/tls.h: New file.
9570         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9571         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9572         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9573         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9574         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9575         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9576         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9577         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9578         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9579         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9580         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9581         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9582         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9583         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9584         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9585         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9586         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9587         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9588         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9589         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9590         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9591         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9592         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9593         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9594         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9595         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9596         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9597         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9598         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9599         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9601 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9603         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9604         according to POSIX.
9606         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9608 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9610         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9611         (TLS_GET_FS): New #define.
9612         (TLS_SET_FS): New #define.
9613         Correct value of __NR_set_thread_area.
9615         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9617 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9619         * Makefile (tests): Add tst-popen1.
9620         * tst-popen1.c: New file.
9622         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9623         but inactive generalization.
9624         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9625         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9626         Minor optimization, remove one instruction.
9627         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9629 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9631         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9633 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9635         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9636         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9637         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9638         * sysdeps/pthread/pthread_cond_signal.c: New file.
9639         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9640         * sysdeps/pthread/pthread_cond_wait.c: New file.
9641         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9642         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9643         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9644         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9645         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9646         * sysdeps/s390/Makefile: New file.
9647         * sysdeps/s390/bits/atomic.h: New file.
9648         * sysdeps/s390/pthread_spin_init.c: New file.
9649         * sysdeps/s390/pthread_spin_lock.c: New file.
9650         * sysdeps/s390/pthread_spin_trylock.c: New file.
9651         * sysdeps/s390/pthread_spin_unlock.c: New file.
9652         * sysdeps/s390/pthreaddef.h: New file.
9653         * sysdeps/s390/tcb-offsets.sym: New file.
9654         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9655         * sysdeps/s390/tls.h: New file.
9656         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9657         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9658         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9659         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9660         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9661         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9662         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9663         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9664         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9665         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9666         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9667         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9668         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9669         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9670         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9671         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9672         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9673         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9674         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9675         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9676         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9677         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9678         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9680 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9682         * atomic.h: Add a couple more default implementations.
9683         (atomic_compare_and_exchange_acq): Use
9684         __arch_compare_and_exchange_32_acq in return value definition.  It
9685         always exists.
9686         (atomic_bit_set): Renamed from atomic_set_bit.
9687         Add missing atomic_ prefixes.
9689         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9690         thread library is available, use correct value to mark initialized
9691         once variable.
9693 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9695         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9696         __sysconf to determine pagesize.
9698         * pthread_create.c: Include <atomic.h>.
9699         * allocatestack.c (allocate_stack): Implement coloring of the
9700         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9701         size minus one.  Adjust users.
9702         * sysdeps/i386/i686/Makefile: New file.
9704 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9706         * allocatestack.c: Improve comment throughout the file.
9708         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9709         (__lll_lock_wait): Add branch prediction.
9710         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9711         (__lll_lock_wait): Likewise.
9712         (lll_unlock_wake_cb): Removed.
9714 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9716         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9717         _POSIX_THREAD_PRIORITY_SCHEDULING.
9719 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9721         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9722         Fix return type of ptr___pthread_getspecific.
9724 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9726         * Makefile (tests): Add tst-umask1.
9727         (tst-umask1-ARGS): Define.
9728         * tst-umask1.c: New file.
9730 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9732         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9733         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9734         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9735         pthread_rwlock_unlock.
9736         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9737         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9738         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9739         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9740         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9741         New file.
9742         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9743         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9744         New file.
9745         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9746         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9747         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9748         New file.
9749         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9750         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9751         New file.
9752         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9753         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9754         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9755         New file.
9756         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9757         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9758         New file.
9759         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9761         * Makefile (libpthread-routines): Remove lowlevelcond and
9762         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9763         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9764         and pthread_cond_broadcast.
9765         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9766         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9767         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9768         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9769         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9770         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9771         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9772         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9773         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9774         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9775         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9776         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9777         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9778         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9779         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9780         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9781         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9782         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9783         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9784         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9785         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9786         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9787         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9788         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9789         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9790         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9791         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9792         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9793         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9794         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9795         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9797         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9798         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9799         of the code is moved to ...
9800         * sysdeps/pthread/createthread.c: ...here.  New file.
9802 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9804         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9805         (__new_sem_post): Clear %eax before returning.
9806         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9808         * Makefile (tests): Add tst-cleanup2.
9809         * tst-cleanup2.c: New file.
9811         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9812         Interpret first parameter correctly.
9814 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9816         * Makefile (headers): Add bits/semaphore.h.
9818 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9820         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9821         if not SHARED.
9823 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9825         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9826         must be used and mapping failed.
9827         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9829         * Makefile (CFLAGS-pthread_self.os): Define this, not
9830         CFLAGS-pthread_self.c.
9832 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9834         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9835         lll_unlock_wake_cb.
9837         * Makefile (libpthread-routines): Add version.  Add rules to build
9838         version.os and banner.h.
9839         * version.c: New file.
9841 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9843         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9844         the alias unconditional.
9845         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9847 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9849         * Makefile (CFLAGS-pthread_self.c): New definition.
9851 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9853         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9854         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9855         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9856         * init.c (__pthread_initialize_minimal_internal): Likewise.
9858 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9860         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9862         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9863         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9864         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9865         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9866         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9867         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9869 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9871         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9872         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9873         * tst-cancel-wrappers.sh: Remove all exceptions.
9875 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9877         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9878         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9880         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9881         Use __libc_pthread_functions array if SHARED.
9883         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9884         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9886         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9887         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9888         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9889         __libc_ptf_call instead of __libc_maybe_call.
9890         (PTF): New #define.
9891         (__libc_cleanup_region_start): Wrap function name with PTF call.
9892         (__libc_cleanup_region_end): Likewise.
9893         (__libc_cleanup_end): Likewise.
9895         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9896         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9897         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9898         * pthreadP.h: Add prototypes.
9900         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9901         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9902         __pthread_rwlock_unlock aliases.
9903         * pthreadP.h: Add prototypes for new aliases.
9905         * pthreadP.h (struct pthead_functions): Moved to...
9906         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9907         * init.c (pthread_functions): Add initializers for new elements.
9909         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9910         __pthread_cleanup_pop_restore aliases.
9911         * pthreadP.h: Add prototypes.
9913         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9914         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9915         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9916         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9917         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9918         * pthreadP.h: Adjust prototypes and callers.
9920 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9922         * Makefile (tests): Add tst-cancel7.
9923         (tst-cancel7-ARGS): New variable.
9924         * tst-cancel7.c: New file.
9926         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9927         around gcc defficiencies.
9928         * old_pthread_cond_signal.c: Likewise.
9929         * old_pthread_cond_timedwait.c: Likewise.
9930         * old_pthread_cond_wait.c: Likewise.
9932         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9934 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9936         * Makefile (tests): Add tst-cond7.
9937         * tst-cond7.c: New file.
9939         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9940         (condvar_cleanup): Get condvar address from the right place.
9942         * atomic.h: Correct definitions of atomic_full_barrier,
9943         atomic_read_barrier, atomic_write_barrier.
9945         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9946         race-free.
9947         * old_pthread_cond_signal.c: Likewise.
9948         * old_pthread_cond_timedwait.c: Likewise.
9949         * old_pthread_cond_wait.c: Likewise.
9951 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9953         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9955 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9957         * pthreadP.h (pthread_cond_2_0_t): New type.
9958         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9959         Use new type for the 2.0 condvar function prototypes.
9960         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9961         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9962         parameter.
9963         * old_pthread_cond_destroy.c: Likewise.
9964         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9965         * old_pthread_cond_signal.c: Likewise.
9966         * old_pthread_cond_timedwait.c: Likewise.
9967         * old_pthread_cond_wait.c: Likewise.
9969         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9970         (__pthread_cond_wait): Don't save cancellation mode and seq value
9971         in same location.
9973         * herrno.c (__h_errno_location): Don't define as weak.
9975 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9977         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9978         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9979         and pthread_cond_wait.
9980         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9981         Renamed to...
9982         (__pthread_cond_broadcast_2_0): ... this.
9983         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9984         Renamed to...
9985         (__pthread_cond_destroy_2_0): ... this.
9986         * old_pthread_cond_init.c (__old_pthread_cond_init):
9987         Renamed to...
9988         (__pthread_cond_init_2_0): ... this.
9989         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9990         Renamed to...
9991         (__pthread_cond_signal_2_0): ... this.
9992         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9993         Renamed to...
9994         (__pthread_cond_wait_2_0): ... this.
9995         * pthread_cond_destroy.c: Include shlib-compat.h.
9996         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9997         * pthread_cond_init.c: Include shlib-compat.h.
9998         (pthread_cond_init): Change strong_alias into versioned_symbol.
9999         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
10000         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
10001         fields.
10002         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
10003         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
10004         __pthread_cond_wait_2_0): New prototypes.
10005         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
10006         __old_pthread_cond_init, __old_pthread_cond_signal,
10007         __old_pthread_cond_wait): Removed.
10008         * init.c: Include shlib-compat.h.
10009         (pthread_functions): Guard ptr___pthread_attr_init_2_0
10010         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
10011         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
10012         ptr___pthread_cond_*_2_0 fields.
10013         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
10014         pthread_cond_*@GLIBC_2.0 compatibility symbols.
10016         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
10017         LIBC_SIGACTION was not yet defined.
10018         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
10019         [!defined LIBC_SIGACTION] (__sigaction): New function and
10020         libc_hidden_weak.
10021         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
10022         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
10024 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
10026         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
10028 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
10030         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
10031         New, larger type definition.
10032         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
10033         implementation.
10034         * Versions [libpthread]: Add definitions for new pthread_cond_*
10035         interfaces for version GLIBC_2.3.2.
10036         * pthread_cond_init.c: Update initialization for new type definition.
10037         * Makefile (libpthread-routines): Remove pthread_cond_wait,
10038         pthread_cond_timedwait, pthread_cond_signal, and
10039         pthread_cond_broadcast.  Add old_pthread_cond_init,
10040         old_pthread_cond_destroy, old_pthread_cond_wait,
10041         old_pthread_cond_timedwait, old_pthread_cond_signal, and
10042         old_pthread_cond_broadcast.
10043         * old_pthread_cond_broadcast.c: New file.
10044         * old_pthread_cond_destroy.c: New file.
10045         * old_pthread_cond_init.c: New file.
10046         * old_pthread_cond_signal.c: New file.
10047         * old_pthread_cond_timedwait.c: New file.
10048         * old_pthread_cond_wait.c: New file.
10049         * pthreadP.h: Add prototypes for the compatibility interfaces.
10051         * pthread_cond_destroy.c: Don't include <errno.h>.
10053 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
10055         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
10056         unnecessary zero offset when addressing MUTEX.
10058 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10060         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
10061         __register_atfork.
10062         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
10063         for __register_atfork.
10065 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10067         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
10068         instead of ASSEMBLER test macro.
10070         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
10071         __libc_current_sigrtmax): Add libc_hidden_def.
10073         * sysdeps/pthread/list.h: Remove assert.h include.
10075 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10077         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
10078         __pthread_initialize_minimal_internal not
10079         __pthread_initialize_minimal.
10081 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
10083         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
10084         __pthread_initialize_minimal as hidden.
10086         * init.c (__pthread_initialize_minimal_internal): Don't mark as
10087         constructor.
10089 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10091         * Makefile ($(inst_libdir)/libpthread.so): Depend on
10092         $(common-objpfx)format.lds, include that into the output script.
10093         Fix comment.
10094         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
10096 2002-12-28  Andreas Jaeger  <aj@suse.de>
10098         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
10099         nsec resolution changes.
10100         (xstat64_conv): Likewise.
10101         (xstat32_conv): Likewise.
10102         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
10103         struct kernel_stat.
10104         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
10105         structs stat and stat64.
10106         * time/time.h (__timespec_defined): Define for __USE_MISC.
10107         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
10109 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
10111         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
10112         argument.
10113         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
10114         (pthread_exit): Use strong_alias to avoid warnings.
10115         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
10116         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
10117         ptr___pthread_attr_init_2_*.
10118         * init.c (pthread_functions): Adjust.
10120 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
10122         * forward.c: Make all functions available by default again.  It
10123         caused too much trouble.
10125         * pt-siglongjmp.c: Removed.
10127 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
10129         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
10130         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
10131         * sysdeps/i386/Makefile: New file.
10132         * sysdeps/i386/tcb-offsets.sym: New file.
10133         * sysdeps/pthread/tcb-offsets.h: New file.
10134         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10135         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
10137         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
10138         __register_atfork...
10139         (GLIBC_2.3.2): ...here.
10141 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10143         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10144         pthread_attr_setstackaddr with __attribute_deprecated__.
10146 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10148         * pt-system.c (system): Remove cancellation handling.
10149         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10150         cancellation routines.
10152 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10154         * descr.h: Include <dl-sysdep.h>.
10155         (struct pthread): Move header.data.list to the back of the struct.
10156         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10157         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10158         (SYSINFO_OFFSEET): Likewise.
10160 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10162         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10163         Define.
10164         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10165         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10166         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10167         (USE_DL_SYSINFO): Undef.
10169 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10171         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10172         $(common-objpfx)libc.so.
10173         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10174         it is bigger than pipe buffer size even on arches with bigger
10175         page size.
10176         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10178 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10180         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10181         correct errno access for case that USE___THREAD is not defined.
10183 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10185         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10186         Patch by Marijn Ros <marijn@mad.scientist.com>.
10188 2002-12-22  Roland McGrath  <roland@redhat.com>
10190         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10192 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10194         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10196 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10198         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10199         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10200         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10202         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10203         of int $0x80.
10204         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10205         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10206         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10207         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10208         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10209         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10210         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10211         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10213         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10214         sysenter.
10215         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10217         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10219         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10220         in new TCB.
10221         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10222         that sysinfo is properly initialized.
10223         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10224         to 1 only for ld.so.
10226         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10227         RTLD_CORRECT_DYNAMIC_WEAK.
10229 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10231         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10232         Use return 0 as 6th argument to FORWARD4.
10233         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10235 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10237         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10238         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10239         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10240         (INIT_SYSINFO): New #define.
10241         (TLS_TP_INIT): Use INIT_SYSINFO.
10242         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10243         At test to make sure SYSINFO_OFFSET value is correct.
10244         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10246 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10248         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10249         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10250         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10251         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10252         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10253         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10254         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10256 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10258         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10259         macro instead of using int $0x80 directly.
10261         * sysdeps/pthread/bits/stdio-lock.h: New file.
10262         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10263         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10264         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10265         * Makefile (routines): Add libc-lowlevelmutex.
10267         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10268         __i686.get_pc_thunk.dx.
10270 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10272         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10273         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10274         ($(objpfx)tst-cancel-wrappers.out): New rule.
10275         * tst-cancel-wrappers.sh: New test.
10276         * tst-locale1.c: Include signal.h.
10277         (uselocale): Test static linking of __libc_current_sigrt*.
10279 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10281         * Makefile (tests): Add tst-cancel6.
10282         * tst-cancel6.c: New file
10284 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10286         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10287         Define meaningfully for assembler as well.
10288         * pthreadP.h (struct pthread_functions): Remove
10289         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10290         and ptr_pthread_attr_init_2_1 fields.
10291         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10292         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10293         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10294         (FORWARD3): Define using FORWARD4.
10295         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10296         versions.
10297         * pt-system.c: Remove duplicate stdlib.h include.
10299 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10301         * sem_init.c: Define sem_init@GLIBC_2.0.
10302         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10303         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10305         * flockfile.c: Moved to...
10306         * sysdeps/pthread/flockfile.c: ...here.  New file.
10307         * funlockfile.c: Moved to...
10308         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10309         * ftrylockfile.c: Moved to...
10310         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10312 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10314         * libc-cancellation.c: Guard both function with
10315         #if !defined NOT_IN_libc.
10316         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10317         automatically provided pthread wrappers.
10318         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10319         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10320         nor in libpthread.
10321         * pt-open.c: Removed.
10322         * pt-fcntl.c: Removed.
10323         * pt-fsync.c: Removed.
10324         * pt-lseek.c: Removed.
10325         * pt-msgrcv.c: Removed.
10326         * pt-msgsnd.c: Removed.
10327         * pt-msync.c: Removed.
10328         * pt-nanosleep.c: Removed.
10329         * pt-open64.c: Removed.
10330         * pt-pause.c: Removed.
10331         * pt-pread.c: Removed.
10332         * pt-pread64.c: Removed.
10333         * pt-pwrite.c: Removed.
10334         * pt-pwrite64.c: Removed.
10335         * pt-read.c: Removed.
10336         * pt-recv.c: Removed.
10337         * pt-recvfrom.c: Removed.
10338         * pt-recvmsg.c: Removed.
10339         * pt-send.c: Removed.
10340         * pt-sendto.c: Removed.
10341         * pt-sigtimedwait.c: Removed.
10342         * pt-sigwait.c: Removed.
10343         * pt-wait.c: Removed.
10344         * pt-waitpid.c: Removed.
10345         * pt-write.c: Removed.
10346         * pt-accept.c: Removed.
10347         * pt-close.c: Removed.
10348         * pt-connect.c: Removed.
10349         * pt-lseek64.c: Removed.
10350         * pt-sendmsg.c: Removed.
10351         * pt-tcdrain.c: Removed.
10353 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10355         * init.c (__pthread_initialize_minimal_internal): Renamed from
10356         __pthread_initialize_minimal.  Make old name an alias.  This
10357         converts a normal relocation into a relative relocation.
10359         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10361         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10362         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10363         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10364         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10365         pt-sigwaitinfo, pt-waitid, and pt-writev.
10366         * pt-creat.c: Removed.
10367         * pt-poll.c: Removed.
10368         * pt-pselect.c: Removed.
10369         * pt-readv.c: Removed.
10370         * pt-select.c: Removed.
10371         * pt-sigpause.c: Removed.
10372         * pt-sigsuspend.c: Removed.
10373         * pt-sigwaitinfo.c: Removed.
10374         * pt-waitid.c: Removed.
10375         * pt-writev.c: Removed.
10377         * init.c (pthread_functions): New variable.
10378         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10379         (or NULL) to __libc_pthread_init.
10380         * forward.c: Rewrite to use __libc:pthread_functions array to get
10381         function addresses.
10382         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10383         prototype.
10384         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10385         Take new parameter.  Copy content of variable pointed to by it
10386         to __libc_pthread_init.
10388         * pthreadP.h (struct pthread_functions): New type.
10389         (__libc_pthread_init): Declare.
10391         * pthread_attr_destroy.c: Add namespace protected alias.
10392         * pthread_attr_getdetachstate.c: Likewise.
10393         * pthread_attr_getinheritsched.c: Likewise.
10394         * pthread_attr_getschedparam.c: Likewise.
10395         * pthread_attr_getschedpolicy.c: Likewise.
10396         * pthread_attr_getscope.c: Likewise.
10397         * pthread_attr_setdetachstate.c: Likewise.
10398         * pthread_attr_setinheritsched.c: Likewise.
10399         * pthread_attr_setschedparam.c: Likewise.
10400         * pthread_attr_setschedpolicy.c: Likewise.
10401         * pthread_attr_setscope.c: Likewise.
10402         * pthread_cond_broadcast.c: Likewise.
10403         * pthread_cond_destroy.c: Likewise.
10404         * pthread_cond_init.c: Likewise.
10405         * pthread_cond_signal.c: Likewise.
10406         * pthread_cond_wait.c: Likewise.
10407         * pthread_condattr_destroy.c: Likewise.
10408         * pthread_condattr_init.c: Likewise.
10409         * pthread_equal.c: Likewise.
10410         * pthread_exit.c: Likewise.
10411         * pthread_getschedparam.c: Likewise.
10412         * pthread_self.c: Likewise.
10413         * pthread_setcancelstate.c: Likewise.
10414         * pthread_setschedparam.c: Likewise.
10415         * pthread_mutex_destroy.c: Likewise.
10416         * pthread_mutex_init.c: Likewise.
10417         * pthreadP.h: Add prototypes for the aliases.
10419         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10420         multiple_threads member in correct TCB to 1.
10422         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10423         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10424         member of thread decriptor, otherwise return unconditionally 1.
10426 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10428         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10429         regular Linux version.  Remove file.
10430         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10431         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10432         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10433         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10434         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10435         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10436         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10437         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10438         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10439         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10440         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10441         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10442         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10443         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10444         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10445         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10446         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10447         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10448         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10449         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10450         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10451         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10452         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10453         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10454         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10455         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10456         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10457         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10458         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10459         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10461 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10463         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10464         * sysdeps/unix/sysv/linux/open.c: Removed.
10465         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10466         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10467         * sysdeps/unix/sysv/linux/msync.c: Removed.
10468         * sysdeps/unix/sysv/linux/read.c: Removed.
10469         * sysdeps/unix/sysv/linux/close.c: Removed.
10470         * sysdeps/unix/sysv/linux/creat.c: Removed.
10471         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10472         * sysdeps/unix/sysv/linux/pause.c: Removed.
10473         * sysdeps/unix/sysv/linux/select.c: Removed.
10474         * sysdeps/unix/sysv/linux/write.c: Removed.
10476 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10478         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10479         element in TCB to see whether locking is needed.
10481         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10482         MULTIPLE_THREADS_OFFSET value is correct.
10484         * sysdeps/unix/sysv/linux/close.c: New file.
10485         * sysdeps/unix/sysv/linux/connect.S: New file.
10486         * sysdeps/unix/sysv/linux/creat.c: New file.
10487         * sysdeps/unix/sysv/linux/fsync.c: New file.
10488         * sysdeps/unix/sysv/linux/llseek.c: New file.
10489         * sysdeps/unix/sysv/linux/lseek.c: New file.
10490         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10491         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10492         * sysdeps/unix/sysv/linux/msync.c: New file.
10493         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10494         * sysdeps/unix/sysv/linux/open.c: New file.
10495         * sysdeps/unix/sysv/linux/open64.c: New file.
10496         * sysdeps/unix/sysv/linux/pause.c: New file.
10497         * sysdeps/unix/sysv/linux/poll.c: New file.
10498         * sysdeps/unix/sysv/linux/pread.c: New file.
10499         * sysdeps/unix/sysv/linux/pread64.c: New file.
10500         * sysdeps/unix/sysv/linux/pselect.c: New file.
10501         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10502         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10503         * sysdeps/unix/sysv/linux/readv.c: New file.
10504         * sysdeps/unix/sysv/linux/recv.S: New file.
10505         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10506         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10507         * sysdeps/unix/sysv/linux/select.c: New file.
10508         * sysdeps/unix/sysv/linux/send.S: New file.
10509         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10510         * sysdeps/unix/sysv/linux/sendto.S: New file.
10511         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10512         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10513         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10514         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10515         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10516         * sysdeps/unix/sysv/linux/system.c: New file.
10517         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10518         * sysdeps/unix/sysv/linux/wait.c: New file.
10519         * sysdeps/unix/sysv/linux/waitid.c: New file.
10520         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10521         * sysdeps/unix/sysv/linux/writev.c: New file.
10522         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10524         * pt-readv.c: Fix comment.
10526 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10528         * tst-cleanup1.c: Include stdlib.h.
10530         * tst-cancel5.c: New test.
10531         * Makefile (tests): Add tst-cancel5.
10532         (tst-cancel5): Link against libc.so libpthread.so in that order.
10534 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10536         * forward.c (test_loaded): Prevent recursive calls.
10538         * Makefile (routines): Add libc-cancellation.
10539         * libc-cancellation.c: New file.
10540         * descr.h (struct pthread): Add multiple_threads field.
10541         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10542         new thread descriptor to 1.
10543         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10544         Initialize multiple_thread field after successful thread creation.
10545         * cancellation.c (__do_cancel): Move to pthreadP.h.
10546         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10547         (__pthread_disable_asynccancel): Add internal_function attribute.
10548         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10549         * pthread_setcancelstate.c: Likewise.
10550         * pthread_setcanceltype.c: Likewise.
10551         * pthread_exit.c: Likewise.
10552         * pthreadP.h (CANCELLATION_P): Likewise.
10553         (__do_cancel): Define as static inline.
10554         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10555         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10556         declarations.
10557         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10558         fields.  Define MULTIPLE_THREADS_OFFSET.
10559         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10560         declaration.
10561         * sysdeps/unix/sysv/linux/accept.S: New file.
10562         * sysdeps/unix/sysv/linux/read.c: New file.
10563         * sysdeps/unix/sysv/linux/write.c: New file.
10564         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10565         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10566         initialization of __libc_locking_needed.
10567         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10568         __libc_locking_needed, use multiple_threads field in TCB.
10569         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10571 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10573         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10574         version.
10575         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10577         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10578         access to __libc_locking_needed for PIC.
10580 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10582         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10583         declare for libc.so.
10584         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10585         expression.
10586         (__libc_lock_lock): Put into statement expression.
10587         (__libc_lock_unlock): Remove trailing semicolon.
10588         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10590 2002-12-12  Roland McGrath  <roland@redhat.com>
10592         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10593         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10595 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10597         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10598         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10599         Initialize __libc_locking_needed.
10600         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10601         instead of __register_pthread_fork_handler.
10602         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10603         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10604         fork-gen with libc_pthread_init.
10605         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10606         of __register_pthread_fork_handler.
10607         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10608         of __register_pthread_fork_handler.
10609         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10610         __libc_locking_needed to determine whether lock prefix can be avoided.
10611         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10613 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10615         * Makefile (tests): Add tst-cleanup1.
10616         * tst-cleanup1.c: New file.
10617         * cancellation.c (__cleanup_thread): Removed.
10618         (__do_cancel): Remove call to __cleanup_thread.
10619         * pthreadP.h: Remove __cleanup_thread prorotype.
10621         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10622         Remember function and argument even if cancellation handler
10623         function is not available.
10624         (__libc_cleanup_region_end): Execute registered function directly if
10625         pthread functions are not available.
10626         (__libc_cleanup_end): Likewise.
10628         * init.c (__pthread_initialize_minimal): Fix initialization in
10629         static lib by preventing gcc from being too clever.
10631 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10633         * init.c (__pthread_initialize_minimal): Remove unneccesary
10634         sigaddset call.
10636         * Makefile (tests): We can run tst-locale2 now.
10638 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10640         * Versions: Remove duplicated sigwait entry.
10642 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10644         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10645         inside libpthread.
10647         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10649         * pthreadP.h: Declare __pthread_enable_asynccancel and
10650         __pthread_disable_asynccancel.
10651         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10652         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10653         * cancellation.c (__pthread_enable_asynccancel): New function.
10654         (__pthread_disable_asynccancel): New function.
10655         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10656         * pt-close.c: Likewise.
10657         * pt-connect.c: Likewise.
10658         * pt-creat.c: Likewise.
10659         * pt-fcntl.c: Likewise.
10660         * pt-fsync.c: Likewise.
10661         * pt-lseek.c: Likewise.
10662         * pt-lseek64.c: Likewise.
10663         * pt-msgrcv.c: Likewise.
10664         * pt-msgsnd.c: Likewise.
10665         * pt-msync.c: Likewise.
10666         * pt-nanosleep.c: Likewise.
10667         * pt-open.c: Likewise.
10668         * pt-open64.c: Likewise.
10669         * pt-pause.c: Likewise.
10670         * pt-poll.c: Likewise.
10671         * pt-pread.c: Likewise.
10672         * pt-pread64.c: Likewise.
10673         * pt-pselect.c: Likewise.
10674         * pt-pwrite.c: Likewise.
10675         * pt-pwrite64.c: Likewise.
10676         * pt-read.c: Likewise.
10677         * pt-readv.c: Likewise.
10678         * pt-recv.c: Likewise.
10679         * pt-recvfrom.c: Likewise.
10680         * pt-recvmsg.c: Likewise.
10681         * pt-select.c: Likewise.
10682         * pt-send.c: Likewise.
10683         * pt-sendmsg.c: Likewise.
10684         * pt-sendto.c: Likewise.
10685         * pt-sigpause.c: Likewise.
10686         * pt-sigsuspend.c: Likewise.
10687         * pt-sigtimedwait.c: Likewise.
10688         * pt-sigwait.c: Likewise.
10689         * pt-sigwaitinfo.c: Likewise.
10690         * pt-system.c: Likewise.
10691         * pt-tcdrain.c: Likewise.
10692         * pt-wait.c: Likewise.
10693         * pt-waitid.c: Likewise.
10694         * pt-waitpid.c: Likewise.
10695         * pt-write.c: Likewise.
10696         * pt-writev.c: Likewise.
10697         * pthread_join.c: Likewise.
10698         * pthread_timedjoin.c: Likewise.
10700         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10701         (__xpg_sigpause): New function.
10702         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10704 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10706         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10708         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10709         _GI_pthread_cleanup_pop to pthreadP.h.
10711         * ftrylockfile.c: Use _IO_lock_trylock instead of
10712         pthread_mutex_trylock.
10714         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10715         (CANCEL_RESET): Likewise.
10716         (__pthread_setcanceltype_): Declare.
10717         (__pthread_mutex_lock_internal): Declare.
10718         (__pthread_mutex_unlock_internal): Declare.
10719         (__pthread_once_internal): Declare.
10720         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10721         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10723         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10724         and pthread_mutex_unlock.
10725         * pthread_cond_wait.c: Likewise.
10726         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10727         * pthread_mutex_unlock.c: Likewise.
10729         * pthread_setcanceltype.c: Add additional alias
10730         __pthread_setcanceltype.
10732         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10733         * sem_open.c (sem_open): Likewise.
10734         Use __libc_open, __libc_write, and __libc_close instead of
10735         open, write, and close respectively.
10737         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10738         Rewrite as statement expression since it must return a value.
10740         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10741         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10742         __pthread_kill.
10744         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10745         alias __pthread_once_internal.
10747         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10749 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10751         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10752         * tst-stdio1.c: New file.
10753         * tst-stdio2.c: New file.
10755         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10757         * Makefile (tests): Comment out tst-locale2 for now.
10758         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10760         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10761         -D_IO_MTSAFE_IO.
10762         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10763         Use _IO_lock_init instead of explicit assignment.
10765         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10766         Define __libc_lock_* and __libc_lock_recursive macros with
10767         lowlevellock macros, not pthread mutexes.
10769         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10770         of pthread_mutex_lock.
10771         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10772         instead of pthread_mutex_unlock.
10774 2002-12-06  Roland McGrath  <roland@redhat.com>
10776         * allocatestack.c (__stack_user): Use uninitialized defn.
10777         * init.c (__pthread_initialize_minimal): Initialize it here.
10779 2002-12-05  Roland McGrath  <roland@redhat.com>
10781         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10782         string.
10783         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10785         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10786         missing & here too.
10788 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10790         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10791         lowlevellock.
10792         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10793         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10794         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10795         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10796         for __libc_lock_* macros.
10797         * Makefile (routines): Add libc-lowlevellock.
10799 2002-10-09  Roland McGrath  <roland@redhat.com>
10801         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10802         Under [__PIC__], call the function via the pointer fetched for
10803         comparison rather than a call by name that uses the PLT.
10804         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10805         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10806         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10807         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10808         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10810 2002-12-04  Roland McGrath  <roland@redhat.com>
10812         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10814         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10815         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10817         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10819 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10821         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10822         a completely opaque, non-integer type.
10823         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10825 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10827         * sysdeps/i386/tls.h: Include stdlib.h.
10828         * sysdeps/x86_64/tls.h: Likewise.
10830 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10832         * Makefile (tests): Add tst-locale2.
10833         (tests-static): Likewise.
10834         * tst-locale2.c: New file.
10836         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10837         volatile and add memory clobbers to lock operations.
10839 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10841         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10842         * sysdeps/i386/i486/bits/atomic.h: New file.
10843         * sysdeps/i386/i586/bits/atomic.h: New file.
10844         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10845         include i486 version.
10846         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10847         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10848         Patch by Marijn Ros <marijn@mad.scientist.com>.
10850         * allocatestack.c (get_cached_stack): Don't crash if we first
10851         found a stack with a larger size then needed.
10852         Reported by Hui Huang <hui.huang@sun.com>.
10854         * Makefile (tests): Add tst-sysconf.
10855         * tst-sysconf.c: New file.
10857         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10858         PTHREAD_THREADS_MAX.
10860 2002-12-02  Roland McGrath  <roland@redhat.com>
10862         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10863         Declare using hidden_proto instead of attribute_hidden, so there are
10864         non-.hidden static symbols for gdb to find.
10865         (__pthread_keys): Likewise.
10866         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10867         * allocatestack.c (__stack_user): Likewise.
10868         * pthread_create.c (__pthread_keys): Likewise.
10869         (__nptl_threads_events, __nptl_last_event): Make these static instead
10870         of hidden.
10871         * pthread_key_create.c (__pthread_pthread_keys_max,
10872         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10874 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10876         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10877         statically.
10878         * tst-locale1.c: New file.
10880         * pthread_cond_timedwait.c: Include <stdlib.h>.
10882         * Makefile (tests): Add tst-fork2 and tst-fork3.
10883         * tst-fork2.c: New file.
10884         * tst-fork3.c: New file.
10886 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10888         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10890         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10891         require it to 200112L.
10893         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10894         instruction only if HAVE_CMOV is defined.
10895         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10897         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10899         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10901         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10903         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10905 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10907         * sysdeps/x86_64/bits/atomic.h: New file.
10909         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10910         16-bit operations.
10912         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10913         possible since gettid cannot fail.
10915         * sysdeps/x86_64/pthreaddef.h: New file.
10917         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10919         * sysdeps/x86_64/pthread_spin_init.c: New file.
10920         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10921         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10922         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10924         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10925         Add missing lock prefix.  Minute optimization.
10927         * tst-spin2.c (main): Also check successful trylock call.
10929         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10930         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10932         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10933         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10935         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10936         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10937         value in case of an error.  Add support for INTERNAL_SYSCALL.
10939         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10940         value in case of an error.
10942         * sysdeps/x86_64/tls.h: New file.
10944 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10946         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10947         takes the array member name and the index as parameters.
10948         (THREAD_SETMEM_NC): Likewise.
10949         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10950         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10951         interfaces.
10953         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10954         to decide which code to use.
10955         (THREAD_SETMEM_NC): Likewise.
10957         * allocatestack.c (queue_stack): Don't remove stack from list here.
10958         Do it in the caller.  Correct condition to prematurely terminate
10959         loop to free stacks.
10960         (__deallocate_stack): Remove stack from list here.
10962 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10964         * Makefile (tests): Add tst-stack1.
10965         * tst-stack1.c: New file.
10967         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10968         provided stack.
10970         * pthread_attr_getstack.c: Return bottom of the thread area.
10972 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10974         * Makefile (libpthread-routines): Add pt-allocrtsig and
10975         pthread_kill_other_threads.
10976         * pt-allocrtsig.c: New file.
10977         * pthread_kill_other_threads.c: New file.
10978         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10979         all three functions.
10980         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10981         allocrtsig.
10982         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10983         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10984         and __libc_allocate_rtsig_private.
10985         * Versions (libpthread): Export pthread_kill_other_threads_np,
10986         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10988 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10990         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10991         the end of the stack.  Adjust computations.
10992         When mprotect call fails dequeue stack and free it.
10993         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10994         attribute.
10995         * pthread_getattr_np.c: Likewise.
10997         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10998         surprises.
11000 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
11002         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
11003         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11005 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
11007         * pthread_getspecific.c: Optimize access to first 2nd-level array.
11008         * pthread_setspecific.c: Likewise.
11010 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
11012         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
11013         definitions.  Get them from the official place.
11014         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
11016         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
11017         Use new CLONE_ flags in clone() calls.
11019         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
11020         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
11022         * Versions: Add pthread_* functions for libc.
11023         * forward.c: New file.
11025         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
11026         errno-loc.
11027         * herrno.c: New file.
11028         * res.c: New file.
11030         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
11031         sem_trywait, and sem_timedwait.  Add herrno and res.
11032         * sem_init.c: Don't initialize lock and waiters members.
11033         * sem_open.c: Likewise.
11034         * sem_post.c: Removed.
11035         * sem_wait.c: Removed.
11036         * sem_trywait.c: Removed.
11037         * sem_timedwait.c: Removed.
11038         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
11039         Includes full implementations of sem_post, sem_wait, sem_trywait,
11040         and sem_timedwait.
11041         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
11042         for new implementation.
11043         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
11044         and waiters fields.
11046         * tst-sem3.c: Improve error message.
11047         * tst-signal3.c: Likewise.
11049         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
11050         to tell the kernel about the termination futex and to initialize tid
11051         member.  Don't initialize main_thread.
11052         * descr.h (struct pthread): Remove main_thread member.
11053         * cancelllation.c (__do_cancel): Remove code handling main thread.
11054         The main thread is not special anymore.
11056         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
11057         size of the stacks to stack_cache_actsize.
11059         * pt-readv.c: Add missing "defined".
11060         * pt-sigwait.c: Likewise.
11061         * pt-writev.c: Likewise.
11063 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
11065         * Versions: Export __connect from libpthread.
11066         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11068         * Makefile (libpthread-routines): Add pt-raise.
11069         * sysdeps/unix/sysv/linux/raise.c: New file.
11070         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
11071         * sysdeps/generic/pt-raise.c: New file.
11073         * pthread_cond_init.c: Initialize all data elements of the condvar
11074         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11076         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
11077         * pthread_create.c: Likewise.
11079         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
11080         * tst-key1.c: New file.
11081         * tst-key2.c: New file.
11082         * tst-key3.c: New file.
11084         * Versions: Export pthread_detach for version GLIBC_2.0.
11085         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
11087 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
11089         * pthread_key_create.c: Terminate search after an unused key was found.
11090         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11092         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
11093         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11095 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
11097         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
11098         dynamic lookup for errno in PIC.
11100         * allocatestack.c (get_cached_stack): Rearrange code slightly to
11101         release the stack lock as soon as possible.
11102         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
11103         the static TLS block.
11104         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
11106         * cancellation.c: Renamed from cancelation.c.
11107         * Makefile: Adjust accordingly.
11108         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
11109         * cleanup_defer.c: Use CANCELLATION_P.
11110         * pthread_testcancel.c: Likewise.
11111         * descr.h: Fix spelling in comments.
11112         * init.c: Likewise.
11113         * pthread_getattr_np.c: Likewise.
11114         * pthread_getschedparam.c: Likewise.
11115         * pthread_setschedparam.c: Likewise.
11116         * Versions: Likewise.
11118         * pt-pselect.c: New file.
11119         * Makefile (libpthread-routines): Add pt-pselect.
11120         * Versions: Add pselect.
11122         * tst-cancel4.c: New file.
11123         * Makefile (tests): Add tst-cancel4.
11125 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
11127         * pthread_mutex_lock.c: Always record lock ownership.
11128         * pthread_mutex_timedlock.c: Likewise.
11129         * pthread_mutex_trylock.c: Likewise.
11131         * pt-readv.c: New file.
11132         * pt-writev.c: New file.
11133         * pt-creat.c: New file.
11134         * pt-msgrcv.c: New file.
11135         * pt-msgsnd.c: New file.
11136         * pt-poll.c: New file.
11137         * pt-select.c: New file.
11138         * pt-sigpause.c: New file.
11139         * pt-sigsuspend.c: New file.
11140         * pt-sigwait.c: New file.
11141         * pt-sigwaitinfo.c: New file.
11142         * pt-waitid.c: New file.
11143         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11144         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11145         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11146         * Versions: Add all the new functions.
11148         * tst-exit1.c: New file.
11149         * Makefile (tests): Add tst-exit1.
11151         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11153 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11155         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11157         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11158         call.  pthread_join is an official cancellation point.
11159         * pthread_timedjoin.c: Likewise.
11161         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11162         and the condvar's mutex are retrieved.
11163         * pthread_cond_timedwait.c: Likewise.
11164         Reported by dice@saros.East.Sun.COM.
11166 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11168         * pthreadP.h: Cut out all type definitions and move them...
11169         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11170         * pthreadP.h: Include <internaltypes.h>.
11172         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11173         performance tweaks.
11175         * sem_trywait.c: Shuffle #includes around to get right order.
11176         * sem_timedwait.c: Likewise.
11177         * sem_post.c: Likewise.
11178         * sem_wait.c: Likewise.
11180         * nptl 0.3 released.
11182         * Makefile (tests): Add tst-signal3.
11183         * tst-signal3.c: New file.
11185 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11187         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11188         the asms modify the sem object.
11189         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11191         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11192         the actual members.
11193         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11194         * semaphoreP.h: Include pthreadP.h.
11195         * sem_getvalue.c: Adjust to sem_t change.
11196         * sem_init.c: Likewise.
11197         * sem_open.c: Likewise.
11198         * sem_post.c: Likewise.
11199         * sem_timedwait.c: Likewise.
11200         * sem_trywait.c: Likewise.
11201         * sem_wait.c: Likewise.
11203 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11205         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11206         * tst-basic2.c: New file.
11207         * tst-exec1.c: New file.
11208         * tst-exec2.c: New file.
11209         * tst-exec3.c: New file.
11211         * tst-fork1.c: Remove extra */.
11213         * nptl 0.2 released.  The API for IA-32 is complete.