* sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
[glibc.git] / nptl / ChangeLog
blob73bcfaa84f6d79510dfc90561ca7282823796e39
1 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4         (__pthread_list_t): New typedef.
5         (pthread_mutex_t): Replace __next and __prev fields with __list.
6         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7         (__pthread_list_t): New typedef.
8         (pthread_mutex_t): Replace __next and __prev fields with __list.
9         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
10         (__pthread_list_t, __pthread_slist_t): New typedefs.
11         (pthread_mutex_t): Replace __next and __prev fields with __list.
12         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
13         (__pthread_list_t, __pthread_slist_t): New typedefs.
14         (pthread_mutex_t): Replace __next and __prev fields with __list.
15         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
16         (__pthread_list_t, __pthread_slist_t): New typedefs.
17         (pthread_mutex_t): Replace __next and __prev fields with __list.
18         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
19         (__pthread_slist_t): New typedef.
20         (pthread_mutex_t): Replace __next field with __list.
22 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
24         * allocatestack.c (allocate_stack): Initialize robust_list.
25         * init.c (__pthread_initialize_minimal_internal): Likewise.
26         * descr.h (struct xid_command): Pretty printing.
27         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
28         robust_list.  Adjust macros.
29         * pthread_create.c (start_thread): Adjust robust_list handling.
30         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
31         but the owner for all robust mutex types.
32         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
33         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
34         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
36         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
37         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
39 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
41         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
42         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
44 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
46         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
47         Return status.
48         (lll_futex_timed_wait): Define.
50 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
52         * tst-cancel4.c: Test ppoll.
54 2006-01-18  Andreas Jaeger  <aj@suse.de>
56         [BZ #2167]
57         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
58         (pthread_mutex_t): Follow changes for other archs.  Based on patch
59         by Jim Gifford <patches@jg555.com>.
61 2006-01-13  Richard Henderson  <rth@redhat.com>
63         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
65 2006-01-10  Roland McGrath  <roland@redhat.com>
67         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
68         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
69         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
70         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
71         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
72         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
73         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
74         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
75         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
76         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
78 2006-01-09  Roland McGrath  <roland@redhat.com>
80         * tst-initializers1-c89.c: New file.
81         * tst-initializers1-c99.c: New file.
82         * tst-initializers1-gnu89.c: New file.
83         * tst-initializers1-gnu99.c: New file.
84         * Makefile (tests): Add them.
85         (CFLAGS-tst-initializers1-c89.c): New variable.
86         (CFLAGS-tst-initializers1-c99.c): New variable.
87         (CFLAGS-tst-initializers1-gnu89.c): New variable.
88         (CFLAGS-tst-initializers1-gnu99.c): New variable.
90         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
91         Use __extension__ on anonymous union definition.
92         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
93         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
94         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
95         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
96         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
98 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
100         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
101         Don't give the union a name because it changes the mangled name.
102         Instead name the struct for __data.
103         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
104         Likewise.
105         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
106         Likewise.
108 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
110         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
111         stack bias to mc_ftp field.
113 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
115         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
116         being too clever and reloading the futex value where it shouldn't.
118 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
120         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
121         correct type.
123 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
125         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
126         Add cfi directives.
128 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
130         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
131         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
132         rename in tcbhead_t.
134         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
135         Don't give the union a name because it changes the mangled name.
136         Instead name the struct for __data.
137         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
138         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
139         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
140         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
141         * pthread_create.c (start_thread): Adjust robust mutex free loop.
142         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
144 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
146         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
147         Return status.
148         (lll_futex_timed_wait): Define.
149         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
150         * sysdeps/pthread/aio_misc.h: New file.
152 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
154         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
156 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
158         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
159         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
160         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
162 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
164         * tst-cancel24.cc: Use C headers instead of C++ headers.
166 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
168         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
169         sparc-linux configured glibc.
170         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
171         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
172         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
173         atomic_compare_and_exchange_val_24_acq instead of
174         atomic_compare_and_exchange_val_acq.
175         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
176         instead of atomic_exchange_rel.
177         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
178         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
179         file.
180         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
181         file.
182         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
183         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
184         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
185         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
186         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
187         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
188         New file.
189         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
190         New file.
191         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
192         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
193         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
194         file.
195         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
196         file.
197         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
199 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
201         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
202         mutex initializers.
204 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
206         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
207         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
208         THREAD_COPY_POINTER_GUARD): Define.
209         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
210         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
212 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
214         * version.c: Update copyright year.
216 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
218         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
219         .eh_frame section, use cfi_* directives.
220         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
222 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
224         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
225         now.
227 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
229         * sysdeps/pthread/sigaction.c: Removed.
230         * sigaction.c: New file.
231         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
233 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
235         * Makefile (tests): Add tst-signal7.
236         * tst-signal7.c: New file.
238 2005-12-27  Roland McGrath  <roland@redhat.com>
240         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
241         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
242         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
243         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
244         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
245         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
246         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
247         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
248         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
249         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
250         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
252 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
254         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
255         and __prev field to pthread_mutex_t.
256         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
257         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
258         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
259         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
260         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
261         to pthread_mutex_t.
263 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
265         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
266         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
267         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
268         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
269         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
270         and PTHREAD_MUTEXATTR_FLAG_BITS.
271         * descr.h (struct pthread): Add robust_list field and define
272         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
273         * pthread_mutexattr_getrobust.c: New file.
274         * pthread_mutexattr_setrobust.c: New file.
275         * pthread_mutex_consistent.c: New file.
276         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
277         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
278         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
279         Adjust pthread_mutex_t initializers.
280         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
281         field to pthread_mutex_t.
282         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
283         and __prev field to pthread_mutex_t.
284         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
285         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
286         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
287         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
288         * pthread_mutexattr_gettype.c: Likewise.
289         * pthread_mutexattr_setpshared.c: Likewise.
290         * pthread_mutexattr_settype.c: Likewise.
291         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
292         Initialize mutex kind according to robust flag.
293         * pthread_mutex_lock.c: Implement local robust mutex.
294         * pthread_mutex_timedlock.c: Likewise.
295         * pthread_mutex_trylock.c: Likewise.
296         * pthread_mutex_unlock.c: Likewise.
297         * pthread_create.c (start_thread): Mark robust mutexes which remained
298         locked as dead.
299         * tst-robust1.c: New file.
300         * tst-robust2.c: New file.
301         * tst-robust3.c: New file.
302         * tst-robust4.c: New file.
303         * tst-robust5.c: New file.
304         * tst-robust6.c: New file.
305         * tst-robust7.c: New file.
306         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
307         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
308         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
309         tst-robust5, tst-robust6, and tst-robust7.
311         * tst-typesizes.c: New file.
312         * Makefile (tests): Add tst-typesizes.
314         * tst-once3.c: More debug output.
316 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
318         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
319         missing after last change.
321         * version.c: Update copyright year.
323 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
325         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
326         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
327         * pthread_mutex_trylock.c: Likewise.
328         * pthread_mutex_timedlock.c: Likewise.
329         * pthread_mutex_unlock.c: Likewise.
331 2005-12-22  Roland McGrath  <roland@redhat.com>
333         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
334         so that #include_next's search location is not reset to the -I..
335         directory where <nptl/...> can be found.
337 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
339         [BZ #1913]
340         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
341         Fix unwind info.  Remove useless branch prediction prefix.
342         * tst-cancel24.cc: New file.
343         * Makefile: Add rules to build and run tst-cancel24.
345 2005-12-21  Roland McGrath  <roland@redhat.com>
347         * libc-cancellation.c: Use <> rather than "" #includes.
348         * pt-cleanup.c: Likewise.
349         * pthread_create.c: Likewise.
350         * pthread_join.c: Likewise.
351         * pthread_timedjoin.c: Likewise.
352         * pthread_tryjoin.c: Likewise.
353         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
354         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
355         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
356         * unwind.c: Likewise.
358 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
360         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
361         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
362         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
363         THREAD_COPY_POINTER_GUARD): Define.
365 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
367         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
368         rather than one.
369         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
370         THREAD_COPY_POINTER_GUARD): Define.
371         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
372         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
373         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
374         THREAD_COPY_POINTER_GUARD): Define.
375         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
376         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
377         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
378         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
379         Use PTR_DEMANGLE for B0 if defined.
381 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
383         * pthread_create.c (__pthread_create_2_1): Use
384         THREAD_COPY_POINTER_GUARD if available.
385         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
386         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
387         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
388         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
389         * sysdeps/x86_64/tls.h: Likewise.
391 2005-12-15  Roland McGrath  <roland@redhat.com>
393         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
395 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
397         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
398         sysdeps/generic.
399         * errno-loc.c: New file.
401 2005-12-12  Roland McGrath  <roland@redhat.com>
403         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
404         adjustments before choosing stack size.  Update minimum stack size
405         calculation to match allocate_stack change.
407 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
409         * allocatestack.c (allocate_stack): Don't demand that there is an
410         additional full page available on the stack beside guard, TLS, the
411         minimum stack.
413 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
415         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
416         (__cleanup_fct_attribute): Use __regparm__ not regparm.
418         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
419         compiling 32-bit code we must define __cleanup_fct_attribute.
421 005-11-24  Jakub Jelinek  <jakub@redhat.com>
423         [BZ #1920]
424         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
425         __attribute__ instead of __attribute.
426         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
427         (__cleanup_fct_attribute): Likewise.
429 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
431         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
432         a write barrier before writing libgcc_s_getcfa.
434 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
436         * sysdeps/unix/sysv/linux/configure: Removed.
438 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
440         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
441         optional init_array/fini_array support.
443 2005-10-24  Roland McGrath  <roland@redhat.com>
445         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
446         versioned_symbol use.
448 2005-10-16  Roland McGrath  <roland@redhat.com>
450         * init.c (__pthread_initialize_minimal_internal): Even when using a
451         compile-time default stack size, apply the minimum that allocate_stack
452         will require, and round up to page size.
454 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
456         * Makefile ($(test-modules)): Remove static pattern rule.
458 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
459             Ulrich Drepper  <drepper@redhat.com>
461         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
462         alignment in callback function.
463         * Makefile: Add rules to build and run tst-align3.
464         * tst-align3.c: New file.
466 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
468         * allocatestack.c (setxid_signal_thread): Add
469         INTERNAL_SYSCALL_DECL (err).
471 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
473         * allocatestack.c (setxid_signal_thread): Need to use
474         atomic_compare_and_exchange_bool_acq.
476 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
477             Jakub Jelinek  <jakub@redhat.com>
479         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
480         CANCEL_RESTMASK.
481         (struct pthread): Move specific_used field to avoid padding.
482         Add setxid_futex field.
483         * init.c (sighandler_setxid): Reset setxid flag and release the
484         setxid futex.
485         * allocatestack.c (setxid_signal_thread): New function.  Broken
486         out of the bodies of the two loops in __nptl_setxid.  For undetached
487         threads check whether they are exiting and if yes, don't send a signal.
488         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
489         * pthread_create.c (start_thread): For undetached threads, check
490         whether setxid bit is set.  If yes, wait until signal has been
491         processed.
493         * allocatestack.c (STACK_VARIABLES): Initialize them.
494         * pthread_create.c (__pthread_create_2_1): Initialize pd.
496 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
498         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
499         waiters, awake all waiters on the associated mutex.
501 2005-09-22  Roland McGrath  <roland@redhat.com>
503         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
504         ../sysdeps/x86_64/hp-timing.h).
506 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
508         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
509         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
510         (lll_futex_wake_unlock): Define.
511         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
512         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
513         (lll_futex_wake_unlock): Define.
514         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
515         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
516         (lll_futex_wake_unlock): Define.
517         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
518         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
519         (lll_futex_wake_unlock): Define.
520         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
521         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
522         (lll_futex_wake_unlock): Define.
523         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
524         lll_futex_wake_unlock.
525         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
526         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
527         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
528         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
529         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
530         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
532 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
534         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
535         Fix typo in register name.
537 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
539         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
540         Use __sigfillset.  Document that sigfillset does the right thing wrt
541         to SIGSETXID.
543 2005-08-08  Jakub Jelinek  <jakub@redhat.com>
545         * tst-stackguard1.c (do_test): Likewise.
547 2005-07-29  Jakub Jelinek  <jakub@redhat.com>
549         * tst-stackguard1.c (do_test): Don't fail if the poor man's
550         randomization doesn't work well enough.
552 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
554         [BZ #1102]
555         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
556         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
557         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
558         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
559         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
560         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
561         in the structure.
562         * Makefile (tests): Add tst-initializers1.
563         (CFLAGS-tst-initializers1.c): Set.
564         * tst-initializers1.c: New test.
566 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
568         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
569         Make sure __flags are located at offset 48 from the start of the
570         structure.
572 2005-07-02  Roland McGrath  <roland@redhat.com>
574         * Makeconfig: Comment fix.
576 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
578         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
579         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
580         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
581         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
582         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
583         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
584         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
585         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
586         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
587         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
589 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
591         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
592         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
593         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
594         fields.
595         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
596         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
597         field.  Put in sysinfo field unconditionally.
598         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
599         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
600         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
601         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
602         fields.
603         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
604         * pthread_create.c (__pthread_create_2_1): Use
605         THREAD_COPY_STACK_GUARD macro.
606         * Makefile: Add rules to build and run tst-stackguard1{,-static}
607         tests.
608         * tst-stackguard1.c: New file.
609         * tst-stackguard1-static.c: New file.
611 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
613         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
614         Invoke CGOTSETUP and CGOTRESTORE.
615         (CGOTSETUP, CGOTRESTORE): Define.
617 2005-05-29  Richard Henderson  <rth@redhat.com>
619         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
620         (tf_write, tf_writev): Use it.
621         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
622         the system minimum.
624 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
626         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
627         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
628         __librt_*_asynccancel@local.
630 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
632         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
633         all occurrences of JUMPTARGET.  Instead append @local to labels.
635 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
637         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
638         size/alignment of struct pthread rather than tcbhead_t.
639         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
640         Likewise.
641         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
642         Likewise.
643         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
644         Likewise.
646 2005-05-19  Richard Henderson  <rth@redhat.com>
648         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
649         __sync_val_compare_and_swap, not explicit _si variant.
650         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
652 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
654         [BZ #915]
655         * sysdeps/pthread/pthread.h: Avoid empty initializers.
657 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
659         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
660         .eh_frame section, use cfi_* directives.
662 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
664         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
665         of "" includes.
667 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
669         [BZ #1075]
670         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
671         aio_write blocks.
673 2005-04-27  Roland McGrath  <roland@redhat.com>
675         * Makefile (tests): Remove tst-clock2.
677         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
678         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
679         translating to the kernel clockid_t for our own process/thread clock.
681         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
683 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
685         * old_pthread_cond_init.c: Include <errno.h>.
686         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
687         process shared or uses clock other than CLOCK_REALTIME.
688         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
690 2005-04-13  David S. Miller  <davem@davemloft.net>
692         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
693         * sysdeps/sparc/sparc64/clone.S: New file.
695 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
697         [BZ #1102]
698         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
699         __inline instead of inline.
700         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
702 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
704         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
705         functionally equivalent, but shorter instructions.
706         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
707         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
708         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
709         Likewise.
710         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
711         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
712         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
713         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
714         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
715         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
716         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
717         Likewise.
718         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
719         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
720         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
721         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
722         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
724 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
726         * sysdeps/mips/Makefile: New file.
727         * sysdeps/mips/nptl-sysdep.S: New file.
728         * sysdeps/mips/tcb-offsets.sym: New file.
729         * sysdeps/mips/pthread_spin_lock.S: New file.
730         * sysdeps/mips/pthread_spin_trylock.S: New file.
731         * sysdeps/mips/pthreaddef.h: New file.
732         * sysdeps/mips/tls.h: New file.
733         * sysdeps/mips/jmpbuf-unwind.h: New file.
734         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
735         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
736         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
737         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
738         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
739         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
740         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
741         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
742         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
743         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
745 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
747         [BZ #1112]
748         * pthread_create.c (__pthread_create_2_1): Rename syscall error
749         variable to scerr.
751 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
753         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
755 2005-02-25  Roland McGrath  <roland@redhat.com>
757         * alloca_cutoff.c: Correct license text.
758         * tst-unload.c: Likewise.
759         * sysdeps/pthread/allocalim.h: Likewise.
760         * sysdeps/pthread/pt-initfini.c: Likewise.
761         * sysdeps/pthread/bits/libc-lock.h: Likewise.
762         * sysdeps/pthread/bits/sigthread.h: Likewise.
763         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
764         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
766 2005-02-16  Roland McGrath  <roland@redhat.com>
768         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
769         Use unsigned int * for ptr_nthreads.
771 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
773         [BZ #721]
774         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
775         gcc4.
777 2005-02-07  Richard Henderson  <rth@redhat.com>
779         [BZ #787]
780         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
781         argument.
783 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
785         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
786         order of arguments in invocation of atomic_add_zero.
788 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
790         [BZ #737]
791         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
792         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
793         at least gotntpoff relocation and addition.
794         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
795         Likewise.
796         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
797         Likewise.
798         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
799         Likewise.
801 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
803         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
804         entry for static tls deallocation fix.
805         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
806         also contains information whether the memory pointed to is static
807         TLS or not.
808         * sysdeps/i386/tls.h: Likewise.
809         * sysdeps/ia64/tls.h: Likewise.
810         * sysdeps/powerpc/tls.h: Likewise.
811         * sysdeps/s390/tls.h: Likewise.
812         * sysdeps/sh/tls.h: Likewise.
813         * sysdeps/sparc/tls.h: Likewise.
814         * sysdeps/x86_64/tls.h: Likewise.
816 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
818         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
820 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
822         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
823         %esp.
824         * Makefile (tests): Add tst-align2.
825         * tst-align2.c: New test.
826         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
827         -mpreferred-stack-boundary=4.
829 2004-12-18  Roland McGrath  <roland@redhat.com>
831         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
832         New file removed withdrawn for the moment.
834 2004-12-17  Richard Henderson  <rth@redhat.com>
836         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
837         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
839 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
841         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
842         Increased PTHREAD_STACK_MIN.
844         * tst-context1.c (stacks): Use bigger stack size.
846 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
848         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
849         * sysdeps/sparc/tcb-offsets.sym: Add TID.
851 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
853         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
854         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
855         * sysdeps/s390/tcb-offsets.sym (TID): Add.
857 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
859         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
861 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
863         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
864         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
866         * tst-getpid1.c: If child crashes, report this first.  Print which
867         signal.
869 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
871         * init.c (__pthread_initialize_minimal_internal): Also unblock
872         SIGSETXID.
874 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
876         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
877         _POSIX_THREAD_CPUTIME): Define to 0.
878         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
879         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
880         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
881         __timer_signal_thread_tclk): Remove.
882         (init_module): Remove their initialization.
883         (thread_cleanup): Remove their cleanup assertions.
884         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
885         __timer_signal_thread_tclk): Remove.
886         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
887         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
888         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
890 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
892         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
893         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
895         * Makefile (tests): Add tst-getpid2.
896         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
897         (do_test): Use it.  Use __clone2 instead of clone on ia64.
898         * tst-getpid2.c: New test.
900 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
902         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
904 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
906         * Makefile (tests): Add tst-getpid1.
907         * tst-getpid1.c: New file.
908         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
909         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
911 2004-12-02  Roland McGrath  <roland@redhat.com>
913         * Makefile (libpthread-nonshared): Variable removed.
914         ($(objpfx)libpthread_nonshared.a): Target removed.
915         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
916         These are now handled by generic magic from
917         libpthread-static-only-routines being set.
919 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
921         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
922         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
923         _POSIX_THREAD_PRIO_PROTECT): Define.
924         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
925         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
926         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
928 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
930         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
931         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
932         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
933         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
934         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
935         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
936         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
938 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
940         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
942         * Makefile (libpthread-routines): Add pthread_setschedprio.
943         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
944         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
945         * pthread_setschedprio.c: New file.
947 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
949         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
950         * pthread_cancel.c (pthread_create): Likewise.
952         * Makefile (libpthread-routines): Add vars.
953         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
954         * init.c (__default_stacksize, __is_smp): Remove.
955         * vars.c: New file.
956         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
957         and define a wrapper macro.
958         (PTHREAD_STATIC_FN_REQUIRE): Define.
959         * allocatestack.c (__find_thread_by_id): Undefine.
960         * pthread_create (__pthread_keys): Remove.
961         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
962         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
963         PTHREAD_STATIC_FN_REQUIRE.
965 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
967         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
968         parameter to REGISTER macro.
970 2004-11-17  Roland McGrath  <roland@redhat.com>
972         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
973         Make sure SIGCANCEL is blocked as well.
975 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
977         * sysdeps/pthread/setxid.h: New file.
978         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
979         (struct xid_command): Add forward decl.
980         (struct pthread_functions): Change return type of __nptl_setxid hook
981         to int.
982         * pthreadP.h (__nptl_setxid): Change return type to int.
983         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
984         calling thread, return its return value and set errno on failure.
985         * descr.h (struct xid_command): Change id type to long array.
987         * Makefile: Add rules to build and test tst-setuid1 and
988         tst-setuid1-static.
989         * tst-setuid1.c: New test.
990         * tst-setuid1-static.c: New test.
992 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
994         * Makefile (tests): Add tst-exit3.
995         * tst-exit3.c: New test.
997 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
999         * Makefile (tests): Add tst-exit2.
1000         * tst-exit2.c: New file.
1002 2004-11-09  Roland McGrath  <roland@redhat.com>
1004         [BZ #530]
1005         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
1006         here, before calling clone.
1007         * pthread_create.c (start_thread): Don't do it here.
1009 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
1011         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
1013 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
1015         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1016         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
1017         assembler warning.
1019 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
1021         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
1022         if sched_priority is not between minprio and maxprio.
1024 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1026         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1027         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
1029         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1030         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
1032 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
1034         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
1035         not-cancelable I/O functions.
1037 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1039         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
1040         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1041         make sure 2 is stored in the futex and we looked at the old value.
1042         Fix a few other problems to return the correct value.
1044 2004-10-14  Richard Henderson  <rth@redhat.com>
1046         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
1047         make gcc4 happy.
1049 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
1051         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
1052         of pthread-functions.h and pthreaddef.h.
1053         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
1055         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1056         Change __data.__nwaiters from int to unsigned int.
1058         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
1059         sysconf (_SC_THREAD_CPUTIME) returns negative value.
1061         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
1062         before return type.
1064         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
1065         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
1067 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
1069         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
1070         test fails, remove message queue.
1071         (tf_msgsnd): Likewise.
1073 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1075         * tst-clock1.c: Change #ifdef to #if defined.
1076         * tst-clock2.c: Likewise.
1077         * tst-cond11.c: Likewise.
1079         * sysdeps/pthread/timer_create.c (timer_create): Use
1080         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
1081         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
1082         THREAD_CPUTIME.
1084 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
1086         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
1087         _POSIX_THREAD_CPUTIME): Define to 0.
1089 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
1091         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
1092         and _POSIX_THREAD_CPUTIME to zero.
1093         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
1094         * tst-barrier2.c: Fix testing for POSIX feature.
1095         * tst-clock1.c: Likewise.
1096         * tst-clock2.c: Likewise.
1097         * tst-cond11.c: Likewise.
1098         * tst-cond4.c: Likewise.
1099         * tst-cond6.c: Likewise.
1100         * tst-flock2.c: Likewise.
1101         * tst-mutex4.c: Likewise.
1102         * tst-mutex9.c: Likewise.
1103         * tst-rwlock12.c: Likewise.
1104         * tst-rwlock4.c: Likewise.
1105         * tst-signal1.c: Likewise.
1106         * tst-spin2.c: Likewise.
1107         * sysdeps/pthread/posix-timer.h: Likewise.
1108         * sysdeps/pthread/timer_create.c: Likewise.
1109         * sysdeps/pthread/timer_routines.c: Likewise.
1111 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
1113         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1114         (__lll_mutex_timedlock_wait): Address futex correctly.
1116         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1117         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
1118         make sure 2 is stored in the futex and we looked at the old value.
1119         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1120         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
1121         which might very well made the code not working at all before.
1122         [BZ #417]
1124 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
1126         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
1127         allow SIGSETXID to be sent.
1128         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
1129         for SIGSETXID to be defined.
1130         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
1131         SIGSETXID cannot be blocked.
1133         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1134         Add __extension__ to long long types.
1135         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1136         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1137         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1138         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1139         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
1140         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1141         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1143 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
1145         * descr.h (struct pthread): Add stopped_start field.
1146         * sysdeps/pthread/createthread.c (create_thread): Set
1147         start_stopped flag in descriptor for new thread appropriately.
1148         * pthread_create.c (start_thread): Only take lock to be stopped on
1149         startup if stopped_start flag says so.
1151 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
1153         * pthread_create.c (__pthread_create_2_1): Remember whether thread
1154         is created detached and if yes, do not try to free the stack in case
1155         the thread creation failed.
1156         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
1157         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
1158         case there has been no error.  [BZ #405]
1160         * pthread_create.c (start_thread): Don't wait for scheduler data
1161         etc to be set at the beginning of the function.  The cancellation
1162         infrastructure must have been set up.  And enable async
1163         cancellation before potentially going to sleep.  [BZ #401]
1165 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
1167         * Versions: Remove exports for pthread_set*id_np functions.
1168         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
1169         for now.
1170         * Makefile: Don't build pthread_set*id code for now.
1172 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
1174         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
1175         internal use.
1176         * allocatestack.c (__nptl_setxid): New function.
1177         * descr.h (struct xid_command): Define type.
1178         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
1179         (sighandler_setxid): New function.
1180         (__pthread_initialize_minimal): Register sighandler_setxid for
1181         SIGCANCEL.
1182         * pt-allocrtsig.c: Update comment.
1183         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
1184         Declare __nptl_setxid.
1185         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
1186         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
1187         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1188         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1189         and pthread_setresuid_np.
1190         * pthread_setgid_np.c: New file.
1191         * pthread_setuid_np.c: New file.
1192         * pthread_setegid_np.c: New file.
1193         * pthread_seteuid_np.c: New file.
1194         * pthread_setregid_np.c: New file.
1195         * pthread_setreuid_np.c: New file.
1196         * pthread_setresgid_np.c: New file.
1197         * pthread_setresuid_np.c: New file.
1198         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
1199         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
1200         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
1201         and pthread_setresuid_np.
1202         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
1203         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
1204         pthread_setregid, and pthread_setresgid.
1206 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
1208         * allocatestack.c (allocate_stack): Return EAGAIN instead of
1209         ENOMEM when out of memory.
1211 2004-09-10  Roland McGrath  <roland@redhat.com>
1213         [BZ #379]
1214         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
1215         code, since we don't try to use the broken CLONE_STOPPED any more.
1216         * pthread_create.c (start_thread): Likewise.
1218 2004-09-15  Richard Henderson  <rth@redhat.com>
1220         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
1222 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
1224         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
1225         (__libc_unwind_longjmp): Delete macro and declare as function.
1226         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
1227         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
1228         nptl directory.
1229         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
1230         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
1231         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
1233 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
1235         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
1236         for __USE_XOPEN2K.
1237         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
1238         types also for __USE_XOPEN2K.
1239         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1240         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1241         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1242         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1243         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1244         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1245         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1246         [BZ #320]
1248 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
1250         * sysdeps/pthread/pthread.h
1251         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
1252         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
1253         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
1254         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
1255         [BZ #375]
1257 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
1259         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
1260         PSEUDO to be used with . prefix.
1262         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
1263         Use atomic_increment instead of atomic_exchange_and_add.
1264         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
1265         Likewise.
1266         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1267         Likewise.
1268         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1269         Likewise.
1271         * allocatestack.c (allocate_stack): Use atomic_increment_val
1272         instead of atomic_exchange_and_add.
1273         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
1274         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1275         Likewise.
1276         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1277         Likewise.
1279         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
1280         the initialization function might throw.
1282 2005-09-05  Richard Henderson  <rth@redhat.com>
1284         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1285         Move definition inside libpthread, libc, librt check.  Provide
1286         definition for rtld.
1288 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
1290         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
1291         waiters, awake all waiters on the associated mutex.
1293 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
1295         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
1296         * sysdeps/i386/jmpbuf-unwind.h: Likewise
1297         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
1298         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
1299         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
1300         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
1301         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
1302         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
1303         * unwind.c: Use it.
1305         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1306         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
1307         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1308         Likewise.
1309         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1310         Decrement __nwaiters.  If pthread_cond_destroy has been called and
1311         this is the last waiter, signal pthread_cond_destroy caller and
1312         avoid using the pthread_cond_t structure after unlock.
1313         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1314         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1315         Read clock type from the least significant bits of __nwaiters instead
1316         of __clock.
1317         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1318         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
1320 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
1322         [BZ #342]
1323         * Makefile (tests): Add tst-cond20 and tst-cond21.
1324         * tst-cond20.c: New test.
1325         * tst-cond21.c: New test.
1326         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1327         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
1328         it unsigned int.
1329         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1330         Likewise.
1331         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1332         (pthread_cond_t): Likewise.
1333         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1334         Likewise.
1335         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1336         Likewise.
1337         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1338         Likewise.
1339         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
1340         (cond_nwaiters): New.
1341         (clock_bits): New.
1342         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
1343         if there are waiters not signalled yet.
1344         Wait until all already signalled waiters wake up.
1345         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
1346         __nwaiters.  If pthread_cond_destroy has been called and this is the
1347         last waiter, signal pthread_cond_destroy caller and avoid using
1348         the pthread_cond_t structure after unlock.
1349         (__pthread_cond_wait): Increment __nwaiters in the beginning,
1350         decrement it when leaving.  If pthread_cond_destroy has been called
1351         and this is the last waiter, signal pthread_cond_destroy caller.
1352         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1353         Likewise.  Read clock type from the least significant bits of
1354         __nwaiters instead of __clock.
1355         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
1356         whether clock ID can be encoded in COND_CLOCK_BITS bits.
1357         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
1358         clock type just from the last COND_CLOCK_BITS bits of value.
1359         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
1360         instead of __clock, just from second bit of condattr's value.
1362 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
1364         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
1365         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
1366         != 64.
1367         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1369 2004-08-15  Roland McGrath  <roland@frob.com>
1371         * pthread_atfork.c: Update copyright terms including special exception
1372         for these trivial files, which are statically linked into executables
1373         that use dynamic linking for the significant library code.
1375 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
1377         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
1378         pthread_rwlock_rdlock.
1379         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
1380         Decrease __nr_readers_queued after reacquiring lock.
1381         * sysdeps/pthread/pthread_rwlock_timedrdlock
1382         (pthread_rwlock_timedrdlock): Likewise.
1383         Reported by Bob Cook <bobcook47@hotmail.com>.
1385 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
1387         * tst-rwlock14.c (tf): Read main thread handle from *ARG
1388         before pthread_barrier_wait.
1390 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
1392         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1393         Remove unnecessary exception handling data.
1395 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
1397         [BZ #284]
1398         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
1399         instead of clockid_t.
1401 2004-07-21  Roland McGrath  <roland@redhat.com>
1403         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
1405 2004-07-19  Roland McGrath  <roland@redhat.com>
1407         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
1409 2004-07-02  Roland McGrath  <roland@redhat.com>
1411         * configure: Don't exit.
1413 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1415         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1416         (__pthread_cond_timedwait): Check for invalid nanosecond in
1417         timeout value.
1419 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
1421         * Makefile: Add rules to build and run tst-fini1.
1422         * tst-fini1.c: New file.
1423         * tst-fini1mod.c: New file.
1425 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
1427         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
1428         if no cancellation support is needed.
1429         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1430         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1431         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1432         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1433         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1434         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1435         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1436         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1437         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1439         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
1440         only if not already defined.
1442 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
1444         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
1445         constraint "m" instead of "0" for futex.
1447         * shlib-versions: Add powerpc64-.*-linux.*.
1449 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
1451         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1452         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
1453         for valid tv_nsec.
1454         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
1455         1 billion and 64-bit tv_nsec which is valid when truncated to 32
1456         bits.
1458 2004-06-29  Roland McGrath  <roland@redhat.com>
1460         * Banner: NPTL no longer has its own version number.
1461         * Makefile (nptl-version): Variable removed.
1462         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
1463         using $(version), the glibc version number.
1465 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1467         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1468         Fix branch offset for a PLT entry.
1469         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1470         Likewise.
1471         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1472         Likewise.
1473         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
1474         Likewise.
1475         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
1476         Likewise.
1478 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1480         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
1481         unconditionally.
1483 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1485         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1486         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
1487         instead of tv_sec.
1488         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1489         (pthread_rwlock_timedrdlock): Likewise.
1491 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
1493         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1494         Set __r7 to val, not mutex.
1496 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
1498         * Makefile: Add rules to build tst-rwlock14.
1499         * tst-rwlock14.c: New file.
1501 2004-06-24  Boris Hu  <boris.hu@intel.com>
1503         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
1504         check.
1505         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1507 2004-06-19  Andreas Jaeger  <aj@suse.de>
1509         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
1510         assembler in last patch.
1512 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
1514         * sysdeps/pthread/pthread_cond_timedwait.c
1515         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
1516         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1517         (__pthread_cond_timedwait): Check for invalid nanosecond in
1518         timeout value.
1519         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1520         * tst-cond19.c: New file.
1521         * Makefile: Add rules to build and run tst-cond19.
1523 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
1525         * tst-context1.c (GUARD_PATTERN): Defined.
1526         (tst_context_t): Define struct containing ucontext_t & guard words.
1527         (ctx): Declare as an array of tst_context_t.
1528         (fct): Verify uc_link & guard words are still valid.
1529         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
1531 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1533         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1534         Add __data.__futex field, reshuffle __data.__clock.
1535         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
1536         (__pthread_cond_signal): Increment __futex at the same time as
1537         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1538         address of low 32-bits of __wakeup_seq to futex syscall.
1539         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1540         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1541         releasing internal lock to FUTEX_WAIT.
1542         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1543         (__pthread_cond_timedwait): Likewise.
1544         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1545         (FUTEX_CMP_REQUEUE): Define.
1546         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1547         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1548         Pass __futex value from before the unlock and __futex address instead
1549         of address of low 32-bits of __wakeup_seq to futex syscall.
1550         Fallback to FUTEX_WAKE all on any errors.
1552 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
1554         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
1555         comment typo.
1556         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
1557         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
1558         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
1559         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
1560         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
1562 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1564         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
1565         Add memory clobber to inline assembly.
1566         (__lll_mutex_trylock): Likewise.
1567         (__lll_mutex_cond_trylock): Likewise.
1569 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1571         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1572         Pass val argument as 6th system call argument in %r7.
1574 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1576         * Makefile (tests): Add tst-cond16.
1577         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
1578         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
1579         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1580         Add __data.__futex field, reshuffle __data.__clock.
1581         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
1582         (__pthread_cond_signal): Increment __futex at the same time as
1583         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1584         address of low 32-bits of __wakeup_seq to futex syscall.
1585         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
1586         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1587         releasing internal lock to FUTEX_WAIT.
1588         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
1589         (__pthread_cond_timedwait): Likewise.
1590         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
1591         (FUTEX_CMP_REQUEUE): Define.
1592         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1593         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1594         Pass __futex value from before the unlock and __futex address instead
1595         of address of low 32-bits of __wakeup_seq to futex syscall.
1596         Fallback to FUTEX_WAKE all on any errors.
1597         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
1598         Define.
1599         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1600         internally.  Return non-zero if error, zero if success.
1601         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1602         Add __data.__futex field, reshuffle __data.__clock.
1603         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
1604         Define.
1605         (lll_futex_requeue): Add val argument, return 1 unconditionally
1606         for the time being.
1607         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1608         Add __data.__futex field, reshuffle __data.__clock.
1609         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1610         Define.
1611         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1612         internally.  Return non-zero if error, zero if success.
1613         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1614         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
1615         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1616         Define.
1617         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1618         internally.  Return non-zero if error, zero if success.
1619         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1620         Add __data.__futex field, reshuffle __data.__clock.
1621         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
1622         Define.
1623         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1624         internally.  Return non-zero if error, zero if success.
1625         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1626         Add __data.__futex field, reshuffle __data.__clock.
1627         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1628         Add __data.__futex field, reshuffle __data.__clock.
1629         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
1630         Increment __futex at the same time as __wakeup_seq or __total_seq.
1631         Pass address of __futex instead of address of low 32-bits of
1632         __wakeup_seq to futex syscall.
1633         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1634         Pass __futex value from before releasing internal lock
1635         to FUTEX_WAIT.
1636         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1637         Likewise.  Avoid unnecessary shadowing of variables.
1638         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
1639         Set __futex to 2 * __total_seq.  Pass __futex value from before the
1640         unlock and __futex address instead of address of low 32-bits of
1641         __wakeup_seq to futex_requeue macro, adjust for new return value
1642         meaning.
1643         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1644         (__pthread_cond_signal): Increment __futex at the same time as
1645         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1646         address of low 32-bits of __wakeup_seq to futex syscall.
1647         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1648         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1649         releasing internal lock to FUTEX_WAIT.
1650         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1651         (__pthread_cond_timedwait): Likewise.
1652         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1653         (FUTEX_CMP_REQUEUE): Define.
1654         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1655         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1656         Pass __futex value from before the unlock and __futex address instead
1657         of address of low 32-bits of __wakeup_seq to futex syscall.
1658         Fallback to FUTEX_WAKE all on any errors.
1660 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1662         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
1663         Add nop to align the end of critical section.
1664         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
1666 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1668         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1669         Add __broadcast_seq field.
1670         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
1671         all waiters as woken with woken_seq and bump broadcast counter.
1672         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
1673         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
1674         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1675         Comment typo fixes.  Avoid returning -ETIMEDOUT.
1677 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
1679         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1680         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
1681         Reported by Kaz Kojima.
1683 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
1685         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
1687 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1689         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
1690         __broadcast_seq with bc_seq after acquiring internal lock instead of
1691         before it.
1693 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
1695         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
1696         compilation.
1697         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1698         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
1699         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1700         (pthread_cond_t): Add __data.__broadcast_seq field.
1701         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1702         (FRAME_SIZE): Define.
1703         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
1704         Comment typo fixes.
1705         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
1706         Define.
1707         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
1708         typo fixes.
1709         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1710         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
1711         fixes.
1713 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
1715         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
1716         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1717         Add __broadcast_seq field.
1718         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1719         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1720         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1721         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1722         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1723         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
1724         all waiters as woken with woken_seq and bump broadcast counter.
1725         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
1726         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
1727         __broadcast_seq field.
1728         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1729         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1730         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1731         * pthread_cond_init.c: Initialize __broadcast_seq field.
1732         * Makefile (tests): Add tst-cond17 and tst-cond18.
1733         Add .NOTPARALLEL goal.
1734         * tst-cond16.c: New file.  From Jakub.
1735         * tst-cond17.c: New file.  From Jakub.
1736         * tst-cond18.c: New file.  From Jakub.
1738 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
1740         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
1741         unwind info.
1743         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1744         Parametrize frame size.  Correct some unwind info.
1745         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1747 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1749         * tst-stack3.c: Note testing functionality beyond POSIX.
1751 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1753         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
1754         Change conditional from ifdef to if.
1756 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
1758         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
1759         SYSDEP_CANCEL_ERROR): Define.
1760         (PSEUDO): Use it.
1762 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
1764         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
1766 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
1768         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
1770 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1772         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
1773         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1774         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
1775         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1777 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
1779         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
1780         thread has all signals blocked.
1782 2004-04-18  Andreas Jaeger  <aj@suse.de>
1784         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
1785         (SEM_VALUE_MAX): Add missing brace.
1787 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1789         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
1790         in rt subdir.
1791         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
1792         * sysdeps/pthread/tst-mqueue8x.c: New test.
1793         * tst-cancel4.c: Update comment about message queues.
1795         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
1796         return it_value { 0, 0 }.
1797         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
1798         like SIGEV_SIGNAL.
1799         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
1800         assertion for SIGEV_NONE.
1801         (thread_attr_compare): Compare all attributes, not just a partial
1802         subset.
1804 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1806         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
1808 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
1810         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
1811         Just use a plain number.
1812         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
1813         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1814         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1815         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1816         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1817         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1818         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1820 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1822         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
1823         frame info.
1824         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1826 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
1828         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
1829         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
1830         of calling sigwaitinfo.
1832 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
1834         * allocatestack.c (allocate_stack): Set reported_guardsize
1835         unconditionally.
1836         * pthread_getattr_np.c (pthread_getattr_np): Use
1837         reported_guardsize instead of guardsize.
1838         * descr.h (struct pthread): Add reported_guardsize field.
1840 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
1842         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
1844 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
1846         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
1848 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
1850         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
1851         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
1852         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
1853         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
1854         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1855         Define.
1856         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
1857         (_POSIX_MESSAGE_PASSING): Define.
1858         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
1859         (_POSIX_MESSAGE_PASSING): Define.
1860         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
1861         (_POSIX_MESSAGE_PASSING): Define.
1863 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
1865         * tst-context1.c (fct): Check whether correct stack is used.
1867 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
1869         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
1870         matching constraints for asm mem parameters.
1872         * tst-clock2.c (tf): Don't define unless needed.
1874 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
1876         * Makefile (link-libc-static): Use $(static-gnulib) instead of
1877         $(gnulib).
1879 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
1881         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
1882         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
1883         * pthreadP.h: Declare __nptl_deallocate_tsd.
1884         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
1885         Adjust caller.
1887         * Makefile (tests): Add tst-tsd5.
1888         * tst-tsd5.c: New file.
1890 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
1892         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1893         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
1894         is SHLIB_COMPAT check.
1895         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1896         (__pthread_attr_getaffinity_old): Likewise.
1897         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1898         (__pthread_getaffinity_old): Likewise.
1899         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1900         (__pthread_setaffinity_old): Likewise.
1902 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
1904         * allocatestack.c (_make_stacks_executable): Call
1905         _dl_make_stack_executable first.
1907 2004-03-24  Roland McGrath  <roland@redhat.com>
1909         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
1910         constraint instead of "0".
1912 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
1914         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1915         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
1917         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
1918         code to avoid warning.
1920 2004-03-24  Andreas Jaeger  <aj@suse.de>
1922         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1923         (__pthread_attr_setaffinity_old): Remove const.
1925 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
1927         * sysdeps/unix/sysv/linux/smp.h: New file.
1928         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
1929         * init.c: Define __is_smp.
1930         (__pthread_initialize_minimal_internal): Call is_smp_system to
1931         initialize __is_smp.
1932         * pthreadP.h: Declare __is_smp.
1933         Define MAX_ADAPTIVE_COUNT is necessary.
1934         * pthread_mutex_init.c: Add comment regarding __spins field.
1935         * pthread_mutex_lock.c: Implement adaptive mutex type.
1936         * pthread_mutex_timedlock.c: Likewise.
1937         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1938         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
1939         Add __spins field.
1940         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1941         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1942         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1943         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1944         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1945         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1946         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1947         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
1948         lll_mutex_cond_trylock.
1949         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1950         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1951         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1952         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1953         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1954         Define BUSY_WAIT_NOP.
1955         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1956         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1958         * tst-mutex5.c: Add support for testing adaptive mutexes.
1959         * tst-mutex7.c: Likewise.
1960         * tst-mutex5a.c: New file.
1961         * tst-mutex7a.c: New file.
1962         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
1964         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1965         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
1966         vgettimeofday call might destroy the content.
1968         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
1969         @pause in the loop.
1971         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1972         No need to restrict type of ret.  Make it int.  Add comment.
1974         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1975         Remove unnecessary setne instruction.
1977 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
1979         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1980         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
1981         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
1982         If realloc fails, break out of the loop.
1984 2004-03-20  Andreas Jaeger  <aj@suse.de>
1986         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1987         (__pthread_setaffinity_old): Fix interface.
1988         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1989         (__pthread_getaffinity_old): Likewise.
1991         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1992         (__pthread_setaffinity_new): Remove duplicate declaration.
1994 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1996         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
1997         the return value to a safe register.
1998         (CDISABLE): Set the function argument correctly.
2000 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2002         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
2003         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
2004         Rewrite so that only one locked memory operation per round is needed.
2005         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
2006         (pthread_barrier_wait): After wakeup, release lock only when the
2007         last thread stopped using the barrier object.
2008         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
2009         (__pthread_cond_wait): Don't store mutex address if the current
2010         value is ~0l.  Add correct cleanup support and unwind info.
2011         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2012         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
2013         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
2014         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
2015         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
2016         Add correct cleanup support and unwind info.
2017         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
2018         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
2019         information for syscall wrappers.
2021 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
2023         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
2024         cpusetsize field, remove next.
2025         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
2026         parameter for size of the CPU set.
2027         (pthread_setaffinity_np): Likewise.
2028         (pthread_attr_getaffinity_np): Likewise.
2029         (pthread_attr_setaffinity_np): Likewise.
2030         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
2031         interface change, keep compatibility code.
2032         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2033         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
2034         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
2035         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
2036         __pthread_getaffinity_np.
2037         * Versions: Add version for changed interfaces.
2038         * tst-attr3.c: Adjust test for interface change.
2039         * pthread_getattr_np.c: Query the kernel about the affinity mask with
2040         increasing buffer sizes.
2041         * pthread_attr_destroy.c: Remove unused list handling.
2042         * pthread_attr_init.c: Likewise.
2044 2004-03-17  Roland McGrath  <roland@redhat.com>
2046         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
2047         first argument to clock_getres so we ever enable kernel timers.
2049 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
2051         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
2053 2004-03-12  Richard Henderson  <rth@redhat.com>
2055         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
2056         oldvalue from CENABLE to CDISABLE.
2058 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
2060         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
2061         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2062         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2063         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2065 2004-03-11  Richard Henderson  <rth@redhat.com>
2067         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
2068         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
2069         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
2071 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2073         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
2074         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
2075         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
2077 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
2079         * forward.c (__pthread_cond_broadcast_2_0,
2080         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
2081         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
2082         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
2084 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2086         * sysdeps/sh/tcb-offsets.sym: Add PID.
2087         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
2088         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
2090 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
2092         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
2093         include <sysdep-cancel.h>, vfork is no cancellation point.
2094         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
2095         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
2096         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
2098 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
2100         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
2101         libc_hidden_def.
2102         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
2103         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
2104         Likewise.
2105         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
2106         Likewise.
2107         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
2108         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
2109         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
2110         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
2111         of DO_CALL_VIA_BREAK.  Work around a gas problem.
2113         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
2114         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
2115         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
2116         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
2117         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
2118         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
2120         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
2121         a local register for saving old PID.  Negate PID in parent upon exit.
2123         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
2124         tcb-offsets.h.
2125         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2126         before syscall, set to the old value in the parent afterwards.
2127         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
2128         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
2129         tcb-offsets.h.
2130         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
2131         before syscall, set to the old value in the parent afterwards.
2132         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
2133         * sysdeps/s390/tcb-offsets.sym: Add PID.
2135         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
2136         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
2137         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
2138         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
2139         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
2140         * sysdeps/sparc/tcb-offsets.sym: Add PID.
2142 2004-03-10  Andreas Schwab  <schwab@suse.de>
2144         * sysdeps/ia64/tcb-offsets.sym: Add PID.
2145         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
2146         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
2148 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
2150         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
2151         * tst-cancel21.c (do_one_test): Likewise.
2152         Reported by Gordon Jin <gordon.jin@intel.com>.
2154 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
2156         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
2157         if non-zero and set to INT_MIN if zero.
2158         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
2159         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
2160         (SAVE_PID, RESTORE_PID): Define.
2161         (__vfork): Use it.
2162         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
2163         Use relative path to avoid including NPTL i386/vfork.S.
2164         (SAVE_PID, RESTORE_PID): Define.
2165         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
2166         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
2167         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
2168         tst-vfork2x.
2169         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
2170         * tst-vfork1.c: New test.
2171         * tst-vfork2.c: New test.
2172         * tst-vfork1x.c: New test.
2173         * tst-vfork2x.c: New test.
2175 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
2177         * sysdeps/i386/tcb-offsets.sym: Add PID.
2178         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
2179         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
2180         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
2182 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
2184         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
2186 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2188         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2189         _rtld_global_ro.
2191 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
2193         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
2194         _rtld_global_ro.
2196         * tst-once4.c: Remove unnecessary macro definition.
2198         * tst-mutex7.c (do_test): Limit thread stack size.
2199         * tst-once2.c (do_test): Likewise.
2200         * tst-tls3.c (do_test): Likewise.
2201         * tst-tls1.c (do_test): Likewise.
2202         * tst-signal3.c (do_test): Likewise.
2203         * tst-kill6.c (do_test): Likewise.
2204         * tst-key4.c (do_test): Likewise.
2205         * tst-join4.c (do_test): Likewise.
2206         * tst-fork1.c (do_test): Likewise.
2207         * tst-context1.c (do_test): Likewise.
2208         * tst-cond2.c (do_test): Likewise.
2209         * tst-cond10.c (do_test): Likewise.
2210         * tst-clock2.c (do_test): Likewise.
2211         * tst-cancel10.c (do_test): Likewise.
2212         * tst-basic2.c (do_test): Likewise.
2213         * tst-barrier4.c (do_test): Likewise.
2215 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
2217         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
2219 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
2221         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2222         (__pthread_cond_timedwait): Optimize wakeup test.
2223         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2224         (__pthread_cond_wait): Likewise.
2225         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2226         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2227         Likewise.
2229 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
2231         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2232         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
2233         the atomic instruction needed.
2234         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2235         (__lll_mutex_lock_wait): Likewise.
2237 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
2239         * Makefile (tests): Add tst-cond14 and tst-cond15.
2240         * tst-cond14.c: New file.
2241         * tst-cond15.c: New file.
2243 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
2245         * sysdeps/pthread/createthread.c (create_thread): Remove use of
2246         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
2247         needs to be implemented differently to be useful.
2249 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
2251         * pthread_attr_setschedparam.c: Don't test priority against limits
2252         here.  Set ATTR_FLAG_SCHED_SET flag.
2253         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
2254         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
2255         from parent thread to child.  If attribute is used and scheduling
2256         parameters are not inherited, copy parameters from attribute or
2257         compute them.  Check priority value.
2258         * pthread_getschedparam.c: If the parameters aren't known yet get
2259         them from the kernel.
2260         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
2261         ATTR_FLAG_POLICY_SET flag for thread.
2262         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
2263         and ATTR_FLAG_POLICY_SET.
2265         * sysdeps/pthread/createthread.c: Use tgkill if possible.
2267         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
2268         fail if stack address hasn't been set.  Just return 0.
2270 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
2272         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
2273         libpthread for the files in this list.
2274         (CFLAGS-tst-unload): Removed.
2275         * tst-unload.c (do_test): Don't use complete path for
2276         LIBPHREAD_SO.
2278         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
2279         tst-_res1mod2.
2281 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
2283         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2284         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
2285         operation per round is needed.
2286         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2287         (__lll_mutex_lock_wait): Likewise.
2289 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
2291         * tst-cancel9.c (cleanup): Don't print to stderr.
2293 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2295         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
2297 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
2299         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2300         (__syscall_error_handler2): Call CDISABLE.
2301         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2302         (__syscall_error_handler2): Call CDISABLE.
2304         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2305         Release lock before the loop, don't reacquire it.
2307         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
2309 2004-02-19  Andreas Schwab  <schwab@suse.de>
2311         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2312         Fix last change.
2314 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
2316         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
2317         (pthread_barrier_wait): After wakeup, release lock only when the
2318         last thread stopped using the barrier object.
2319         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
2320         (pthread_barrier_wait): Likewise.
2321         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2322         Likewise.
2323         * Makefile (tests): Add tst-barrier4.
2324         * tst-barrier4.c: New file.
2326         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2327         (__pthread_cond_timedwait): Perform timeout test while holding
2328         internal lock to prevent wakeup race.
2329         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2330         * sysdeps/pthread/pthread_cond_timedwait.c
2331         (__pthread_cond_timedwait): Likewise.
2332         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2333         (__pthread_cond_timedwait): Likewise.
2335 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
2337         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
2338         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
2339         * Makefile (tests): Add tst-rwlock13.
2340         * tst-rwlock13.c: New test.
2342 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
2344         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2345         (__condvar_tw_cleanup): Little optimization.
2346         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
2348 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
2350         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
2351         libpthread as "lib" parameter to SHLIB_COMPAT.
2352         (__novmx_siglongjmp): Fix typo in function name.
2353         (__novmx_longjmp): Fix typo in function name.
2355 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2357         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
2358         __builtin_expect.
2360         * sysdeps/generic/pt-longjmp.c: Moved to...
2361         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
2363 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
2365         * Makefile (libpthread-routines): Add pt-cleanup.
2366         * pt-longjmp.c: Removed.
2367         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
2368         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
2369         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
2370         Version longjmp, siglongjmp for GLIBC_2.3.4.
2371         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
2373 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
2375         * sysdeps/pthread/pthread_cond_timedwait.c
2376         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
2377         Reuse code.  Add __builtin_expects.
2379         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2380         (__pthread_cond_timedwait): Get internal lock in case timeout has
2381         passed before the futex syscall.
2382         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2384 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
2386         * allocatestack.c: Pretty printing.
2388         * sysdeps/pthread/createthread.c (create_thread): Don't add
2389         CLONE_DETACHED bit if it is not necessary.
2391 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
2393         * pthread_getattr_np.c: Include ldsodefs.h.
2395 2004-01-16  Richard Henderson  <rth@redhat.com>
2397         * allocatestack.c: Don't declare __libc_stack_end.
2398         * init.c (__pthread_initialize_minimal_internal): Likewise.
2399         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
2401 2004-01-15  Richard Henderson  <rth@redhat.com>
2403         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
2404         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
2405         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
2406         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
2407         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
2408         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
2409         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
2410         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
2412 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
2414         * init.c (pthread_functions): Make array const.
2416 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
2418         * allocatestack.c (__make_stacks_executable): Change interface.
2419         Check parameters.  Pass parameter on to libc counterpart.
2420         * pthreadP.h: Change declaration.
2422 2004-01-13  Richard Henderson  <rth@redhat.com>
2424         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
2425         prototype form.
2426         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
2427         Likewise.
2429         * sysdeps/alpha/Makefile: New file.
2430         * sysdeps/alpha/tcb-offsets.sym: New file.
2431         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2432         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
2434         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
2435         on powerpc version.
2437 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
2439         * Makefile (tests): Add tst-backtrace1.
2440         * tst-backtrace1.c: New test.
2442 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
2444         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
2445         register as second parameter to the REGISTER macro.
2446         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
2447         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
2448         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
2449         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
2450         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
2451         of thread register as second parameter to REGISTER macro in 64 case.
2453 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
2455         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
2456         (CFLAGS-getpid.o): Defined.
2457         (CFLAGS-getpid.os): Defined.
2459 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
2461         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
2462         returned for main thread does not overlap with any other VMA.
2463         Patch by Jakub Jelinek.
2465 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
2467         * tst-raise1.c: Include stdio.h.
2469 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
2471         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
2472         setting with __ASSUME_TGKILL || defined __NR_tgkill.
2473         If pid is 0, set it to selftid.
2474         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
2475         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
2476         != 0, return self->tid without doing a syscall.
2477         * descr.h (struct pthread): Move pid field after tid.
2479         * Makefile (tests): Add tst-raise1.
2480         * tst-raise1.c: New file.
2482 2003-12-23  Roland McGrath  <roland@redhat.com>
2484         * tst-oddstacklimit.c: New file.
2485         * Makefile (tests): Add it.
2486         (tst-oddstacklimit-ENV): New variable.
2488         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
2489         value up to page size for __default_stacksize.
2491 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
2493         * Makefile (tests): Add tst-eintr5.
2494         * tst-eintr5.c: New file.
2496         * eintr.c (eintr_source): Prevent sending signal to self.
2498         * tst-eintr2.c (tf1): Improve error message.
2500 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
2502         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
2503         * sysdeps/unix/sysv/linux/getpid.c: New file.
2504         * pthread_cancel.c: Add comment explaining use of PID field.
2505         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2506         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
2507         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
2508         temporarily to signal the field must not be relied on and updated
2509         by getpid().
2510         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
2511         temporarily negative.
2512         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2514 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
2516         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
2517         (eintr_source): If ARG != NULL, use pthread_kill.
2518         * tst-eintr1.c: Adjust for this change.
2519         * tst-eintr2.c: Likewise.
2520         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
2521         * tst-eintr3.c: New file.
2522         * tst-eintr4.c: New file.
2524 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
2526         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
2527         if CANCELSTATE_BITMASK is set.
2528         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
2529         Likewise.
2531         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
2532         (tests-reverse): Add tst-cancel23.
2533         * tst-cancel22.c: New test.
2534         * tst-cancel23.c: New test.
2536 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
2538         * tst-eintr1.c: Better error messages.
2540         * Makefile (tests): Add tst-eintr2.
2541         * tst-eintr2.c: New file.
2543 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
2545         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
2546         (CFLAGS-tst-cancelx21.c): Set.
2547         * tst-cancel21.c: New test.
2548         * tst-cancelx21.c: New test.
2550         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
2551         comparison operand.
2552         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
2553         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
2554         * pt-longjmp.c: Include jmpbuf-unwind.h.
2555         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
2556         _JMPBUF_UNWINDS.  Adjust compared pointers.
2557         * init.c (__pthread_initialize_minimal_internal): Initialize
2558         pd->stackblock_size.
2559         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
2560         * sysdeps/alpha/jmpbuf-unwind.h: New file.
2561         * sysdeps/i386/jmpbuf-unwind.h: New file.
2562         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
2563         * sysdeps/s390/jmpbuf-unwind.h: New file.
2564         * sysdeps/sh/jmpbuf-unwind.h: New file.
2565         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
2566         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
2567         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
2568         (_JMPBUF_CFA_UNWINDS): Remove.
2569         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
2571 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
2573         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
2574         (CFLAGS-tst-cancelx20.c): Set.
2575         * tst-cancel20.c: New test.
2576         * tst-cancelx20.c: New test.
2578 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
2580         * init.c (__pthread_initialize_minimal_internal): Don't treat
2581         architectures with separate register stack special here when
2582         computing default stack size.
2584 2003-12-17  Roland McGrath  <roland@redhat.com>
2586         * Makefile (tst-cancelx7-ARGS): New variable.
2587         Reportd by Greg Schafer <gschafer@zip.com.au>.
2589 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
2591         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
2592         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
2593         (tst-stack3-ENV): Set.
2594         ($(objpfx)tst-stack3-mem): New.
2595         * tst-stack3.c: New test.
2597 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
2599         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
2600         Add unwind directives.  Drop unused .regstk directive.
2601         (_fini_EPILOG_BEGINS): Add unwind directives.
2603 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
2605         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2606         Assume parameter is a pointer.
2607         (lll_futex_wake): Likewise.
2608         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
2609         Likewise.
2610         (lll_futex_wake): Likewise.
2611         Reported by Boris Hu.
2612         * sysdeps/unix/sysv/linux/unregister-atfork.c
2613         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
2615         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
2617 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
2619         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
2620         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
2621         __rtld_lock_initialize for ld.so lock.
2622         Patch in part by Adam Li <adam.li@intel.com>.
2624 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
2626         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
2627         in $(gnulib).  Also, remove stale comment.
2629 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
2631         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
2632         advantage of new syscall stub and optimize accordingly.
2634         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
2635         from SYS_futex, to match expectations of
2636         sysdep.h:DO_INLINE_SYSCALL.
2637         (lll_futex_clobbers): Remove.
2638         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
2639         (lll_futex_wake): Likewise.
2640         (lll_futex_requeue): Likewise.
2641         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
2642         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
2643         Jelinek).
2644         (__lll_mutex_lock): Likewise.
2645         (__lll_mutex_cond_lock): Likewise.
2646         (__lll_mutex_timed_lock): Likewise.
2647         (__lll_mutex_unlock): Likewise.
2648         (__lll_mutex_unlock_force): Likewise.
2650         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
2651         comes before the include of <sysdep.h>.
2652         (THREAD_SELF_SYSINFO): New macro.
2653         (THREAD_SYSINFO): Likewise.
2654         (INIT_SYSINFO): New macro.
2655         (TLS_INIT_TP): Call INIT_SYSINFO.
2657         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
2659         * sysdeps/pthread/createthread.c (create_thread): Use
2660         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
2661         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
2662         THREAD_SELF_SYSINFO instead of open code.
2663         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
2664         (THREAD_SYSINFO): Likewise.
2666         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
2668         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
2670 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
2672         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
2673         instead of .init.  Patch by David Mosberger.
2675 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
2677         * sysdeps/pthread/configure.in: Remove broken declaration in C
2678         cleanup handling check.
2680 2003-11-30  Andreas Jaeger  <aj@suse.de>
2682         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
2683         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
2684         Likewise.
2686 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
2688         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
2689         * pthread_attr_destroy.c: Include shlib-compat.h.
2690         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
2691         is set in iattr->flags.
2692         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
2694 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
2696         * Makefile (distribute): Add tst-cleanup4aux.c.
2698         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
2699         include.
2701 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
2703         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
2704         pthread_cond_signal.
2706         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
2707         store mutex address if the current value is ~0l.
2708         * sysdeps/pthread/pthread_cond_timedwait.c
2709         (__pthread_cond_timedwait): Likewise.
2710         * sysdeps/pthread/pthread_cond_broadcast.c
2711         (__pthread_cond_broadcast): Don't use requeue for pshared
2712         condvars.
2714         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2715         (__pthread_cond_wait): Don't store mutex address if the current
2716         value is ~0l.
2717         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2718         (__pthread_cond_timedwait): Likewise.
2719         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2720         (__pthread_cond_broadcast): Don't use requeue for pshared
2721         condvars.
2723         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
2724         element with ~0l for pshared condvars, with NULL otherwise.
2726         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2727         (__pthread_cond_wait): Don't store mutex address if the current
2728         value is ~0l.
2729         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2730         (__pthread_cond_timedwait): Likewise.
2731         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2732         (__pthread_cond_broadcast): Don't use requeue for pshared
2733         condvars.
2735         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
2736         * tst-cond12.c: New file.
2737         * tst-cond13.c: New file.
2739 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
2741         * sysdeps/pthread/configure.in: Make missing forced unwind support
2742         fatal.
2744 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
2746         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
2748 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
2750         * Makefile: Add magic to clean up correctly.
2752 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
2754         * unwind.c (FRAME_LEFT): Define.
2755         (unwind_stop): Handle old style cleanups here.
2756         (__pthread_unwind): Handle old style cleanups only if
2757         !HAVE_FORCED_UNWIND.
2758         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
2759         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
2760         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
2761         ($(objpfx)tst-cleanupx4): Likewise.
2762         * tst-cleanup4.c: New test.
2763         * tst-cleanup4aux.c: New.
2764         * tst-cleanupx4.c: New test.
2766 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
2768         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
2769         lll_mutex_*lock macros to skip atomic operations on some archs.
2771 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
2773         * sysdeps/pthread/tst-timer.c (main): Initialize
2774         sigev2.sigev_value as well.
2776 2003-10-15  Roland McGrath  <roland@redhat.com>
2778         * sysdeps/pthread/configure.in: Barf if visibility attribute support
2779         is missing.
2780         * sysdeps/pthread/configure: Regenerated.
2782 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2784         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
2785         locking macros.  No distinction between normal and mutex locking
2786         anymore.
2787         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
2788         Merge bits from lowlevelmutex.S we still need.
2789         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
2790         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
2791         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
2792         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
2793         new mutex implementation.
2794         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
2795         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2796         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2797         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2798         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2799         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2800         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2801         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2802         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2803         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
2804         symbol for entry point to avoid cancellation.
2806 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
2808         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
2809         changes.
2810         (SAVE_OLDTYPE_0): Fix a typo.
2812 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
2814         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2815         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
2817 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2819         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
2820         correct offset.
2822 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
2824         * Makefile (tests): Add tst-cancel19.
2825         * tst-cancel19.c: New test.
2827 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2829         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
2830         restoring of the old cancellation type.
2832 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
2834         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
2836 2003-09-27  Wolfram Gloger  <wg@malloc.de>
2838         * sysdeps/pthread/malloc-machine.h: New file
2840 2003-09-24  Roland McGrath  <roland@redhat.com>
2842         * allocatestack.c (__make_stacks_executable): Don't ignore return
2843         value from _dl_make_stack_executable.
2845 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
2847         * allocatestack.c (__make_stacks_executable): Also change
2848         permission of the currently unused stacks.
2850         * allocatestack.c (change_stack_perm): Split out from
2851         __make_stacks_executable.
2852         (allocate_stack): If the required permission changed between the time
2853         we started preparing the stack and queueing it, change the permission.
2854         (__make_stacks_executable): Call change_stack_perm.
2856         * Makefile: Build tst-execstack-mod locally.
2857         * tst-execstack-mod.c: New file.
2859 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
2861         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
2863 2003-09-23  Roland McGrath  <roland@redhat.com>
2865         * tst-execstack.c: New file.
2866         * Makefile (tests): Add it.
2867         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
2868         (LDFLAGS-tst-execstack): New variable.
2870         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
2871         whether to use PROT_EXEC for stack mmap.
2872         (__make_stacks_executable): New function.
2873         * pthreadP.h: Declare it.
2874         * init.c (__pthread_initialize_minimal_internal): Set
2875         GL(dl_make_stack_executable_hook) to that.
2877 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2879         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
2880         recommendation from AMD re avoidance of lock prefix.
2882 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
2884         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
2885         lll_futex_timed_wait instead of lll_futex_wait.
2886         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
2887         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
2888         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
2889         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
2890         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
2891         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
2892         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
2893         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
2894         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
2895         Completely revamp the locking macros.  No distinction between
2896         normal and mutex locking anymore.
2897         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2898         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
2899         __lll_lock_timedwait): Fix prototypes.
2900         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
2901         __lll_lock_timedwait): Likewise.
2902         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
2903         macros, add __builtin_expect.
2904         (lll_mutex_timedlock): Likewise.  Fix return value.
2905         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
2906         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
2907         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
2908         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
2909         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
2910         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
2911         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
2912         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
2914 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2916         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2917         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
2918         operation if possible.
2920         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
2921         like jumping over the lock prefix.
2923 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
2925         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
2926         locking macros.  No distinction between normal and mutex locking
2927         anymore.
2928         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2929         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2930         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2931         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
2932         locking.  Merge bits from lowlevelmutex.S we still need.
2933         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2934         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2935         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
2936         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
2937         * Makefile (routines): Remove libc-lowlevelmutex.
2938         (libpthread-rountines): Remove lowlevelmutex.
2939         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
2940         for new mutex implementation.
2941         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2942         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2943         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2944         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2945         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2946         Likewise.
2947         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2948         Likewise.
2949         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2950         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2951         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
2952         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2953         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2954         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2955         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2956         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2957         Likewise.
2958         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2959         Likewise.
2960         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2961         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2962         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2963         Don't use requeue.
2964         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2965         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
2967 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
2969         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
2970         in parameters of asm with output parameters.
2972         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
2973         type of DECR parameter to int.
2974         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
2976 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
2978         * tst-attr3.c (tf, do_test): Print stack start/end/size and
2979         guardsize for each thread.
2981 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
2983         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
2984         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2985         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
2987         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
2988         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
2989         NULL.
2990         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
2991         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
2992         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2993         (pthread_getaffinity_np): Add hidden_def.
2995         * Makefile (tests): Add tst-attr3.
2996         * tst-attr3.c: New test.
2998         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
3000 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3002         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
3003         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
3005 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
3007         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
3008         * tst-align.c: Include tst-stack-align.h.
3009         (tf, do_test): Use TEST_STACK_ALIGN macro.
3011 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
3013         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
3014         variable.
3016 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
3018         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
3019         stack-related values for the initial thread.
3021 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
3023         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
3025 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
3027         * pthread_mutex_lock.c: Minor code rearrangements.
3029 2003-09-05  Roland McGrath  <roland@redhat.com>
3031         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
3032         Instead, include ../nptl_db/db_info.c to do its magic.
3033         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
3034         (__pthread_pthread_key_2ndlevel_size): Likewise.
3035         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
3036         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
3037         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
3038         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
3039         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
3040         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
3041         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
3042         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
3043         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
3044         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
3045         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
3046         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
3047         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
3048         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
3049         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
3050         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
3051         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
3053 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
3055         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
3056         of pthread_t to be compatible with LT.
3057         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3058         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3059         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3060         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3061         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3062         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3063         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3065 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
3067         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
3069 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
3071         * unwind-forcedunwind.c: Move to...
3072         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
3073         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
3074         * sysdeps/pthread/jmpbuf-unwind.h: New file.
3075         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
3076         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
3077         * unwind.c: Include jmpbuf-unwind.h.
3078         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
3080 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
3082         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
3083         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
3084         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
3085         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
3086         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3087         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
3088         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
3089         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
3090         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
3091         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
3092         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
3093         function.
3094         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
3095         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
3096         * Makefile (tests): Add tst-stack2.
3097         * tst-stack2.c: New test.
3098         * tst-stack1.c: Include limits.h and sys/param.h.
3099         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
3101         * pthread_condattr_setpshared.c: Include errno.h.
3102         (pthread_condattr_setpshared): Return EINVAL if pshared
3103         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
3105         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
3106         defined symbol for entry point to avoid cancellation.
3107         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3108         Likewise.
3109         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3110         Likewise.
3111         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3112         Likewise.
3113         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
3114         Likewise.
3115         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3116         Likewise.
3117         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
3118         __close_nocancel, __read_nocancel, __write_nocancel,
3119         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
3120         libpthread.so or librt.so, define to corresponding function
3121         without _nocancel suffix.
3122         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
3123         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
3124         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
3126         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
3128 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
3130         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
3131         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
3133         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
3134         in subsections has a symbol associated with it.
3136         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
3137         defined symbol for entry point to avoid cancellation.
3138         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
3140 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3142         * Makefile (tests): Add tst-tls5.
3143         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
3144         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
3145         ($(objpfx)tst-tls5): New.
3146         ($(objpfx)tst-tls6.out): Likewise.
3147         (tests): Depend on $(objpfx)tst-tls6.out.
3148         * tst-tls3.c: Include stdint.h and pthreaddef.h.
3149         (do_test): Check pthread_self () return value alignment.
3150         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
3151         (tf): Check pthread_self () return value alignment.
3152         * tst-tls5.c: New test.
3153         * tst-tls5.h: New.
3154         * tst-tls5mod.c: New.
3155         * tst-tls5moda.c: New.
3156         * tst-tls5modb.c: New.
3157         * tst-tls5modc.c: New.
3158         * tst-tls5modd.c: New.
3159         * tst-tls5mode.c: New.
3160         * tst-tls5modf.c: New.
3161         * tst-tls6.sh: New test.
3163         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
3164         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
3165         * init.c (pthread_functions): Initialize them.
3166         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
3167         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
3168         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
3169         pthread_cond_timedwait@@GLIBC_2.3.2.
3171 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
3173         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
3174         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
3175         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
3176         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
3177         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
3178         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
3180         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
3182         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
3183         _POSIX_THREAD_PRIORITY_SCHEDULING.
3184         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3186 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
3188         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
3189         nested function, use static inline function from libio.h.
3190         Code by Richard Henderson.
3192         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
3193         weak.
3195 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
3197         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
3198         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
3199         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
3200         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
3201         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
3202         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
3203         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
3204         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
3205         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
3206         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
3207         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
3208         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
3209         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
3210         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
3211         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
3212         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
3213         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
3214         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
3215         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
3216         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
3217         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
3218         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
3219         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
3220         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
3221         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
3222         * sysdeps/sparc/tls.h: New file.
3223         * sysdeps/sparc/tcb-offsets.sym: New file.
3224         * sysdeps/sparc/Makefile: New file.
3225         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
3226         * init.c [__sparc__] (__NR_set_tid_address): Define.
3228 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
3230         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
3231         _IO_release_lock): Define.
3233 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
3235         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
3236         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
3238 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
3240         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
3241         (__pthread_cleanup_class): Add missing return types of member
3242         functions.
3244 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
3246         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3247         (lll_mutex_unlock_force): Add memory barrier between store and futex
3248         syscall.
3250 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
3252         * tst-cancel4.c (do_test): Also unlink tempfname and remove
3253         tempmsg in first loop.
3255 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
3257         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
3258         _POSIX_THREAD_PRIORITY_SCHEDULING.
3259         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3261 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3263         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
3264         (__rtld_lock_default_lock_recursive,
3265         __rtld_lock_default_unlock_recursive): Define.
3266         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
3267         __rtld_lock_unlock_recursive): Define using
3268         GL(_dl_rtld_*lock_recursive).
3269         * init.c (__pthread_initialize_minimal_internal): Initialize
3270         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
3271         Lock GL(_dl_load_lock) the same number of times as
3272         GL(_dl_load_lock) using non-mt implementation was nested.
3274         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
3275         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
3277 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
3279         * tst-cancel17.c (do_test): Make len2 maximum of page size and
3280         PIPE_BUF.
3282 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
3284         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
3286 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
3288         * sysdeps/pthread/createthread.c (do_clone): Move error handling
3289         to first syscall error check.  Move syscall error check for tkill
3290         into __ASSUME_CLONE_STOPPED #ifdef.
3292 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
3294         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
3295         is not defined, do explicit synchronization.
3296         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
3297         is not defined also unlock pd->lock for non-debugging case in case
3298         it is necessary.
3299         * pthread_create.c (start_thread): Always get and release pd->lock
3300         if __ASSUME_CLONE_STOPPED is not defined.
3301         (start_thread_debug): Removed.  Adjust users.
3302         * allocatestack.c (allocate_stack): Always initialize lock if
3303         __ASSUME_CLONE_STOPPED is not defined.
3304         * Makefile (tests): Add tst-sched1.
3305         * tst-sched1.c: New file.
3307         * sysdeps/pthread/createthread.c (do_clone): Only use
3308         sched_setschduler and pass correct parameters.
3310 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3312         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
3313         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
3314         PTHREAD_STACK_MIN in comments.
3316 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
3318         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3319         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
3320         argument.
3321         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
3322         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
3323         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
3324         (__pthread_cleanup_upto): Fix prototype.
3325         (_longjmp_unwind): Adjust caller.
3326         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
3327         Change second argument to const struct pointer.
3328         * tst-sem8.c (main): Remove unused s2 and s3 variables.
3329         * tst-sem9.c (main): Likewise.
3330         * unwind.c: Include string.h for strlen prototype.
3332 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
3334         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3335         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
3336         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
3337         Define HAVE_CMOV.
3338         Patch by Nicholas Miell <nmiell@attbi.com>.
3340 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
3342         * init.c (__pthread_initialize_minimal_internal): Initialize
3343         GL(dl_init_static_tls).
3344         * pthreadP.h (__pthread_init_static_tls): New prototype.
3345         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
3346         New functions.
3347         * Makefile (tests): Add tst-tls4.
3348         (modules-names): Add tst-tls4moda and tst-tls4modb.
3349         ($(objpfx)tst-tls4): Link against libdl and libpthread.
3350         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
3351         tst-tls4modb.so.
3352         * tst-tls4.c: New file.
3353         * tst-tls4moda.c: New file.
3354         * tst-tls4modb.c: New file.
3356 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
3358         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
3359         before __timer_dealloc.
3360         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
3361         Don't call list_unlink.
3363 2003-07-29  Roland McGrath  <roland@redhat.com>
3365         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
3367 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
3369         * descr.h: Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h
3370         if __need_struct_pthread_size, instead define lll_lock_t.
3372 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
3374         * tst-cancel17.c (do_test): Check if aio_cancel failed.
3375         Don't reuse struct aiocb A if it failed.
3376         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
3377         not just one byte, as that does not block.
3379 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
3381         * sysdeps/pthread/unwind-resume.c: New file.
3382         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
3383         unwind-resume in csu subdir.
3384         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
3385         exceptions.
3386         (librt-sysdep_routines, librt-shared-only-routines): Add
3387         rt-unwind-resume.
3388         * sysdeps/pthread/rt-unwind-resume.c: New file.
3389         * unwind-forcedunwind.c: New file.
3390         * Makefile (libpthread-routines): Add unwind-forcedunwind.
3391         (libpthread-shared-only-routines): Likewise.
3392         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
3393         * pthreadP.h (pthread_cancel_init): New prototype.
3394         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
3396         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
3397         attr argument const struct pthread_attr *.
3399         * res.c (__res_state): Return __resp.
3400         * descr.h: Include resolv.h.
3401         (struct pthread): Add res field.
3402         * pthread_create.c: Include resolv.h.
3403         (start_thread): Initialize __resp.
3404         * Makefile (tests): Add tst-_res1.
3405         (module-names): Add tst-_res1mod1, tst-_res1mod2.
3406         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
3407         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
3408         libpthread.
3409         * tst-_res1.c: New file.
3410         * tst-_res1mod1.c: New file.
3411         * tst-_res1mod2.c: New file.
3413 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
3415         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
3417         * Makefile: Define various *-no-z-defs variables for test DSOs
3418         which has undefined symbols.
3420 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
3422         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3423         Retry if the stwcx fails to store once_control.
3425 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
3427         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
3428         pthread_attr_setaffinity.
3429         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
3430         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
3431         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
3432         * pthread_attr_destroy.c: Free cpuset element if allocated.
3433         * pthread_create.c: Pass iattr as additional parameter to
3434         create_thread.
3435         * sysdeps/pthread/createthread.c: If attribute is provided and
3436         a new thread is created with affinity set or scheduling parameters,
3437         start thread with CLONE_STOPPED.
3438         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
3439         pthread_attr_setaffinity.
3440         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
3441         cpuset element.
3443 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
3445         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
3447 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
3449         * sysdeps/pthread/configure.in: Require CFI directives also for
3450         ppc and s390.
3452 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
3454         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3455         Add cfi directives.
3457 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3459         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
3460         CLEANUP_JMP_BUF.
3461         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
3462         registers as variables.  Call __pthread_mutex_unlock_usercnt.
3463         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3464         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
3465         not self pointer in __writer.  Compare with TID to determine
3466         deadlocks.
3467         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3468         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
3469         Likewise.
3470         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
3471         Likewise.
3472         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
3473         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3474         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
3475         macros also when compiling librt.
3477 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
3479         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
3480         -fasynchronous-unwind-tables.
3481         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3482         (PSEUDO): Add cfi directives.
3483         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
3484         Likewise.
3485         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3486         Likewise.
3488 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
3490         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
3491         __pthread_unregister_cancel): Add prototypes and hidden_proto.
3492         * unwind.c (__pthread_unwind_next): Add hidden_def.
3493         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
3494         Likewise.
3495         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3496         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
3497         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3498         Likewise.
3499         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
3500         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
3501         Likewise.
3502         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
3503         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
3504         __pthread_unregister_cancel and __pthread_unwind_next.
3506 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
3508         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
3509         different symbol for the cancellation syscall wrapper and
3510         non-cancellation syscall wrapper.
3511         (PSEUDO_END): Define.
3513 2003-07-05  Richard Henderson  <rth@redhat.com>
3515         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
3516         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
3517         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3518         return actual return value from the syscall, not 0.
3520 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
3522         * descr.h (struct pthread): Add pid field.
3523         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
3524         (__reclaim_stacks): Likewise.
3525         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
3526         also check for PID of the signal source.
3527         (__pthread_initialize_minimal_internal): Also initialize pid field
3528         of initial thread's descriptor.
3529         * pthread_cancel.c: Use tgkill instead of tkill if possible.
3530         * sysdeps/unix/sysv/linux/fork.c: Likewise.
3531         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
3532         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3533         * sysdeps/unix/sysv/linux/raise.c: Likewise.
3535 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
3537         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
3538         Fix use of parameter.
3539         (__libc_cleanup_pop): Likewise.
3541 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
3543         * init.c (sigcancel_handler): Change parameters to match handler
3544         for SA_SIGACTION.  Check signal number and code to recognize
3545         invalid invocations.
3547 2003-07-03  Roland McGrath  <roland@redhat.com>
3549         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
3550         Apply sizeof (struct pthread) bias to r13 value.
3552 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
3554         * sysdeps/pthread/configure.in: Require CFI directives.
3556         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
3557         definition.
3558         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
3559         libpthread compilation.
3560         * unwind.c (__pthread_unwind): Add hidden_def.
3561         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
3563 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3565         * libc-cancellation.c (__libc_cleanup_routine): Define.
3566         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
3567         (__pthread_cleanup_pop): Define.
3569 2003-07-01  Richard Henderson  <rth@redhat.com>
3571         * sysdeps/alpha/elf/pt-initfini.c: New file.
3572         * sysdeps/alpha/pthread_spin_lock.S: New file.
3573         * sysdeps/alpha/pthread_spin_trylock.S: New file.
3574         * sysdeps/alpha/pthreaddef.h: New file.
3575         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
3576         * sysdeps/alpha/tls.h: New file.
3577         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
3578         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
3579         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
3580         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
3581         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
3582         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
3583         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
3584         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
3585         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
3586         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
3588 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3590         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
3591         cleanup support and unwind info.
3593 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
3595         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3596         Use correct cleanup handler registration.  Add unwind info.
3597         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
3598         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
3599         * tst-once3.c: Add cleanup handler and check it is called.
3600         * tst-once4.c: Likewise.
3601         * tst-oncex3.c: New file.
3602         * tst-oncex4.c: New file.
3603         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
3605 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
3607         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
3609 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
3611         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
3612         (tf_msgsnd): Likewise.
3614         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
3615         premature returns a bit more.
3617 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
3619         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
3620         definition to the front.
3622         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
3623         the cleanup functions to make the names unique.  Fix dwarf opcode
3624         un unwind table.
3625         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
3626         functions to make the names unique.  Fix CFA offset for two blocks.
3628 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
3630         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
3631         missing closing braces.
3632         Patch by Christophe Saout <christophe@saout.de>.
3634 2003-06-24  Roland McGrath  <roland@redhat.com>
3636         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
3638 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
3640         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
3641         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
3643         * pthreadP.h: Declare __find_thread_by_id.
3644         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
3645         * pthread_clock_gettime.c: Allow using other thread's clock.
3646         * pthread_clock_settime.c: Likewise.
3647         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
3648         * Makefile: Add rules to build and run tst-clock2.
3649         * tst-clock2.c: New file.
3651 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
3653         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
3654         to use exception-based cleanup handler.
3655         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3657         * tst-cond8.c (ch): Announce that we are done.
3659         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
3661         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
3662         Also test aio_suspend with timeout value.
3664 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
3666         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
3667         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
3668         attribute_hidden.
3670         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
3671         (__pthread_mutex_lock_internal): Likewise.
3672         (__pthread_mutex_unlock_internal): Likewise.
3673         (__pthread_mutex_unlock_usercnt): Declare.
3674         * pthread_mutex_destroy.c: Always fail if used in any way.
3675         * pthread_mutex_init.c: Update comment.
3676         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
3677         * pthread_mutex_timedlock.c: Adjust __nusers.
3678         * pthread_mutex_trylock.c: Adjust __nusers.
3679         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
3680         and public interfaces are wrapper with pass additional parameter.
3681         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
3682         parameter zero.
3683         * tst-mutex8.c: New file.
3684         * Makefile (tests): Add tst-mutex8.
3685         * sysdeps/pthread/pthread_cond_timedwait.c: Call
3686         __pthread_mutex_unlock_usercnt.
3687         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3688         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3689         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3690         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3691         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3692         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
3693         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3694         Add __nusers.
3695         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3696         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3697         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3698         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3699         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3701         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
3702         * pthread_mutex_timedlock.c: Likewise.
3703         * pthread_mutex_trylock.c: Adjust __nusers.
3704         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
3705         * tst-mutex9.c: New file.
3706         * Makefile (tests): Add tst-mutex9.
3707         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
3708         * sysdeps/ia64/tls.h: Likewise.
3709         * sysdeps/powerpc/tls.h: Likewise.
3710         * sysdeps/s390/tls.h: Likewise.
3711         * sysdeps/sh/tls.h: Likewise.
3712         * sysdeps/x86_64/tls.h: Likewise.
3713         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3714         Change type of __owner.
3715         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3716         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3717         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3718         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3719         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3721 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
3723         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
3724         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
3726         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
3727         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
3728         instead of nr to lll_futex_wake.  Only set errno and return -1
3729         if err < 0.
3731         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
3732         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3733         return actual return value from the syscall, not 0.
3735 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
3737         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
3738         find a random value.
3739         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
3740         errno==EIDRM.
3742         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
3743         compat_timer_settime.
3744         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
3745         compat_timer_gettime.
3746         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
3747         compat_timer_getoverrun.
3748         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
3749         compat_timer_delete.
3751         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
3752         error-checking mutex detect busy mutexes.
3754 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3756         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
3757         Add ax to clobber list.
3758         (lll_mutex_cond_lock): Likewise.
3759         (lll_mutex_unlock): Likewise.
3760         (lll_lock): Likewise.
3761         (lll_unlock): Likewise.
3763         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
3764         * tst-cancel18.c: New file.
3765         * tst-cancelx18.c: New file.
3767         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
3768         and tcdrain.
3770         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
3771         * tst-cancel17.c: New file.
3772         * tst-cancelx17.c: New file.
3774         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
3775         * sysdeps/unix/sysv/linux/sigwait.c: New file.
3776         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
3778         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
3780 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
3782         * sysdeps/pthread/createthread.c (create_thread): Set
3783         header.multiple_threads unconditionally.
3784         * allocatestack.c (allocate_stack): Likewise.
3785         * descr.h (struct pthread): Add header.multiple_threads
3786         unconditionally.
3787         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
3788         Define for librt.  #error if neither libpthread, libc nor librt.
3789         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
3790         Likewise.
3791         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
3792         CDISABLE): Likewise.
3793         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
3794         CDISABLE): Likewise.
3795         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
3796         CDISABLE): Likewise.
3797         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
3798         CDISABLE): Likewise.  Access header.multiple_threads outside of
3799         libc and libpthread.
3800         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
3801         Likewise.
3802         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
3803         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
3805 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3807         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
3808         Also test early cancellation before the thread reaches the cancellation
3809         point.
3811         * Makefile: Compile forward.c with exceptions.
3813         * sysdeps/unix/sysv/linux/sleep.c: New file.
3815 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
3817         * Makefile: Add CFLAGS definition to compile function wrappers
3818         duplicated from libc with exceptions.
3819         * tst-cancel4.c: Also check cancellation handlers.
3821         * Makefile: Add rules to build and run tst-cancel16 and
3822         tst-cancelx16.  Add missing CFLAGS definitions.
3823         * tst-cancel16.c: New file.
3824         * tst-cancelx16.c: New file.
3826 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
3828         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3829         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
3830         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
3831         (DL_SYSINFO_IMPLEMENTATION): Likewise.
3833         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
3834         (LIBC_CANCEL_RESET): Likewise.
3835         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
3836         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
3837         librt-cancellation.
3838         (CFLAGS-libcrt-cancellation.c): Define.
3839         * sysdeps/pthread/librt-cancellation.c: New file.
3840         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
3841         macros also when compiling librt.
3842         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3843         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3844         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3845         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3846         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3847         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3848         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3850         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
3851         compat_timer_create.
3853 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
3855         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
3857         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
3858         __register_atfork.
3859         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
3860         Add libc_hidden_def.
3862 2003-06-13  Roland McGrath  <roland@redhat.com>
3864         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
3865         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
3867 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
3869         * allocatestack.c (queue_stack): Always inline.
3870         * ptreadhP.h (__do_cancel): Likewise.
3872 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
3874         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
3875         a typo.
3877 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
3879         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3880         (__pthread_cond_signal): Remove incorrect second addition for
3881         cond_lock!=0.
3883 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
3885         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3886         (__pthread_cond_signal): Use correct futex pointer in
3887         __lll_mutex_lock_wait call.
3889         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3890         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
3892 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
3894         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
3895         cancelable.
3896         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
3897         Likewise.
3899         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
3900         hand-written CFI generation code.  Since ENTRY/END also initiated
3901         CFI frames this caused two CFI sets to be generated.
3903 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
3905         * cleanup_routine.c: New file.
3906         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
3907         * sysdeps/pthread/pthread.h: Add support for fully exception-based
3908         cleanup handling.
3909         * Makefile (libpthread-routines): Add cleanup_routine.
3910         Add more CFLAGS variables to compile with exceptions.  Add comments
3911         why which file needs unwind tables.
3912         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
3913         tests.
3914         * tst-cancelx1.c: New file.
3915         * tst-cancelx2.c: New file.
3916         * tst-cancelx3.c: New file.
3917         * tst-cancelx4.c: New file.
3918         * tst-cancelx5.c: New file.
3919         * tst-cancelx6.c: New file.
3920         * tst-cancelx7.c: New file.
3921         * tst-cancelx8.c: New file.
3922         * tst-cancelx9.c: New file.
3923         * tst-cancelx10.c: New file.
3924         * tst-cancelx11.c: New file.
3925         * tst-cancelx12.c: New file.
3926         * tst-cancelx13.c: New file.
3927         * tst-cancelx14.c: New file.
3928         * tst-cancelx15.c: New file.
3929         * tst-cleanupx0.c: New file.
3930         * tst-cleanupx0.expect: New file.
3931         * tst-cleanupx1.c: New file.
3932         * tst-cleanupx2.c: New file.
3933         * tst-cleanupx3.c: New file.
3935         * tst-cleanup0.c: Make standard compliant.
3936         * tst-cleanup1.c: Likewise.
3938         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
3939         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3940         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3941         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3942         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3943         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3944         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
3945         CLEANUP_JMP_BUF.
3946         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3947         * tst-cancel12.c: New file.
3948         * tst-cancel13.c: New file.
3949         * tst-cancel14.c: New file.
3950         * tst-cancel15.c: New file.
3951         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
3952         and tst-cancel15.
3954         * tst-cancel1.c: Add some comments.
3956         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
3957         timeout correctly.
3959 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
3961         * Makefile (CFLAGS-pthread_cancel.c): Define.
3963 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
3965         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
3966         Change type of __writer element to int.
3967         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3968         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3969         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3970         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3971         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3972         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
3973         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3974         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
3975         Compare with TID to determine deadlocks.
3976         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
3977         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3978         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
3979         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3980         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3981         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3982         Likewise.
3983         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3984         Likewise.
3985         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3986         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3987         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3988         Likewise.
3989         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3990         Likewise.
3991         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3992         * Makefile (tests): Add tst-rwlock12.
3993         * tst-rwlock12.c: New file.
3995 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
3997         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
3998         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
3999         Remove bogus hidden_proto.
4000         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
4001         Likewise.
4002         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
4003         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
4004         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
4005         ___lll_mutex_timedlock): Likewise.
4007 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
4009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4010         (__pthread_cond_signal): Add some code to eventually handle
4011         cond_lock!=0.
4013 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
4015         * Makefile (tests): Add tst-exec4.
4016         (tst-exec4-ARGS): Define.
4017         * tst-exec4.c: New file.
4019 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
4021         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
4022         Also fail if tv_nsec < 0.
4023         (__lll_timedwait_tid): Likewise.
4024         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
4025         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
4026         Likewise.
4027         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
4028         Likewise.
4029         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
4030         Likewise.
4031         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
4032         Likewise.
4033         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
4034         Likewise.
4035         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
4036         Likewise.
4038         * Makefile (tests): Add tst-sem8 and tst-sem9.
4039         * tst-sem8.c: New file.
4040         * tst-sem9.c: New file.
4041         * sem_open.c: Fix creation of in_use record if the file exists but
4042         no internal record.
4044         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
4045         definitions.
4047         * sysdeps/pthread/timer_create.c (timer_create): In case
4048         evp==NULL, assign timer ID to sival_ptr.
4050         * descr.h (struct pthread_unwind_buf): Change type of prev element to
4051         struct pthread_unwind_buf *.
4052         (struct pthread): Likewise for cleanup_jmp_buf element.
4054         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
4055         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
4056         * unwind.c (__pthread_unwind_next): Likewise.
4058 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
4060         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4061         (lll_futex_timed_wait): Use int for futex value parameter.
4062         (lll_futex_wake): Likewise.
4063         (lll_futex_requeue): Likewise.
4065         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
4066         Replace one memory operation with one register operation.
4068         * tst-join4.c (do_test): Fix error message.
4070         * tst-rwlock6.c (do_test): Use correct format specifier.
4072         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4073         (__lll_mutex_lock_wait): Replace one memory operation with one
4074         register operation.
4075         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
4076         (__lll_mutex_lock_wait): Likewise.
4078         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4079         (__lll_mutex_cond_lock): Add one to value parameter of
4080         __lll_lock_wait to reflect reality in the futex syscall.
4081         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4082         (lll_mutex_cond_lock): Likewise.
4084 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4086         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
4087         New function.
4088         (lll_mutex_cond_lock): Define.
4090 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
4092         * Makefile (tests): Add tst-signal6.
4093         * tst-signal6.c: New file.
4095         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
4096         (__lll_mutex_unlock_force): New function
4097         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4099         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4100         (__lll_mutex_unlock_force): New function.
4101         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
4103         * tst-rwlock7.c (do_test): Use correct format specifier.
4105         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
4106         Find break parameter in correct asm argument.
4108 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
4110         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
4111         Remove out4.
4112         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
4113         error occured.
4114         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4115         Add __mutex.
4116         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
4117         lll_futex_requeue, lll_mutex_unlock_force): Define.
4119 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
4121         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4122         (pthread_cond_t): Add __mutex.
4123         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
4124         lll_futex_requeue, lll_mutex_unlock_force): Define.
4126 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4128         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
4129         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4130         Add __mutex field.
4131         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
4132         Define.
4133         (lll_futex_wait, lll_futex_wake): Define.
4134         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
4135         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
4136         FUTEX_REQUEUE instead of FUTEX_WAIT.
4137         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
4138         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
4139         mutex which was used in condvar structure.  Call
4140         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
4141         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
4143         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
4144         include tcb-offsets.h.  Read wakeup value in locked region.
4145         Use the value of gbr register as THREAD_ID.
4146         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4147         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4148         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4150         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
4151         macros.
4153 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
4155         * sysdeps/pthread/pthread_cond_broadcast.c
4156         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
4158 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
4160         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
4161         typo in register name.
4162         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
4163         correctly.  Actually use requeue.  Little optimization.
4164         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
4165         mutex address early.  Handle cancellation state as 32-bit value.
4166         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4167         Remove unnecessary label.
4169 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
4171         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
4172         instead of FUTEX_WAIT.
4173         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
4174         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4175         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4176         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4177         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4178         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
4179         used in condvar structure.  Call __pthread_mutex_cond_lock instead
4180         of __pthread_mutex_lock_internal.
4181         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4182         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4183         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4184         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
4185         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4186         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4187         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
4188         Add pthread_mutex_cond_lock.
4189         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
4190         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
4191         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
4192         lll_mutex_cond_lock.
4193         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4194         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4195         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4196         Add __mutex field.
4197         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4198         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4200         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
4201         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4203         * pthreadP.h: Declare __pthread_mutex_cond_lock.
4204         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
4205         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
4206         macro don't define aliases.
4208         * cancellation.c: Remove __pthread_enable_asynccancel_2.
4209         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
4210         * sysdeps/pthread/pthread_cond_timedwait.c: Use
4211         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
4212         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4213         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4214         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4215         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4216         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4218 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
4220         * sem_open.c: Fix one endless loop.  Implement correct semantics
4221         wrt opening the same semaphore more then once.
4222         * sem_close.c: Adjust for sem_open change.
4223         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
4224         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
4225         * Makefile (tests): Add tst-sem7.
4226         * tst-sem7.c: New file.
4228 2003-05-16  Roland McGrath  <roland@redhat.com>
4230         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
4231         uninitialized variable braino.
4233 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
4235         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
4236         test for syscall availability.
4238         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
4239         __no_posix_timers to -1 if the syscalls don't exist.
4241         * pthread_join.c (pthread_join): Set tid field of the joined
4242         thread to -1.  This isn't necessary but helps to recognize some
4243         error conditions with almost no cost.
4245         * allocatestack.c (FREE_P): Also negative values indicate an
4246         unused stack.
4248         * unwind.c: Include <unistd.h>.
4250 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
4252         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
4254 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
4256         * Makefile (crti-objs, crtn-objs): New variables.
4257         (omit-deps, extra-objs): Add crtn.
4258         ($(objpfx)libpthread.so): Depend on both crti and crtn
4259         and links to them in multidir.
4260         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
4262 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
4264         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4265         (lll_mutex_unlock): Use atomic_exchange_rel.
4267 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
4269         * cond-perf.c (cons): Add missing locking around setting of alldone.
4271 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
4273         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
4274         related macros.
4275         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4277 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
4279         * tst-sem6.c: New file.
4280         * Makefile (tests): Add tst-sem6.
4282         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
4283         Use atomic_exchange_rel instead of atomic_exchange.
4284         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
4285         Likewise.
4287         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
4288         code for lll_futex_wait and lll_futex_wake in static apps.  Use
4289         vsyscall is possible.
4291         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
4292         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
4293         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
4294         pthread_setaffinity_np.
4295         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
4296         and pthread_setaffinity_np.
4297         * Makefile (libpthread-routines): Add pthread_getaffinity and
4298         pthread_setaffinity.
4300         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
4301         use it in case mmap to allocate the stack fails.
4302         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
4303         ARCH_MAP_FLAGS here.
4304         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
4305         ARCH_RETRY_MMAP.
4307 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
4309         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
4310         handler implementation.  It is now lockless in fork().
4311         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
4312         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
4313         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
4314         declare the __fork_*_lists.
4315         (struct fork_handler): Include pointers to all three functions.
4316         Add next, refcntr and need_signal elements.
4317         (__fork_handlers): New declaration.
4318         (__register_atfork_malloc): Remove declaration.
4319         (HAVE_register_atfork_malloc): Remove definition.
4320         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
4321         __pthread_child_handler variable.
4322         (__libc_pthread_init): Use __register_atfork instead of explicitly
4323         adding to the list.
4324         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
4325         and lll_futex_wake.
4326         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4328         * unwind.c (unwind_cleanup): Print error message and then abort.  This
4329         function must never be reached.
4331         * cond-perf.c: New file.
4333 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
4335         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
4337 2003-05-04  Roland McGrath  <roland@redhat.com>
4339         * Makefile ($(objpfx)../libc.so): New target.
4341 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
4343         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4344         (pthread_condattr_t): Size is only an int, don't use long for
4345         alignment.
4346         (pthread_mutexattr_t): Likewise.
4347         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4348         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4349         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4351 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
4353         * sysdeps/i386/tls.h: Define THREAD_ID.
4354         * sysdeps/ia64/tls.h: Likewise.
4355         * sysdeps/powerpc/tls.h: Likewise.
4356         * sysdeps/s390/tls.h: Likewise.
4357         * sysdeps/sh/tls.h: Likewise.
4358         * sysdeps/x86_64/tls.h: Likewise.
4359         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
4360         record ownership.
4361         * pthread_mutex_timedlock.c: Likewise.
4362         * pthread_mutex_trylock.c: Likewise.
4363         * pthread_mutex_unlock.c: Likewise.
4364         * pthread_rwlock_trywrlock.c: Likewise.
4365         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
4366         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
4367         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4368         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
4370         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
4371         flag.
4373 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
4375         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4376         (__SIZEOF_PTHREAD_COND_T): Define to 48.
4377         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
4378         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4379         Make __align long long instead of long.
4380         (pthread_rwlock_t): Formatting.
4381         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
4382         (pthread_rwlock_t): Formatting.
4383         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4384         (pthread_cond_t): Make __align long long instead of long.
4385         (pthread_rwlock_t): Move __flags field to the same position as in
4386         linuxthreads.
4388 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
4390         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
4391         * tst-rwlock7.c (do_test): Likewise.
4393 2003-04-26  Roland McGrath  <roland@redhat.com>
4395         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
4397 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
4399         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
4400         sizeof (struct pthread).
4401         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
4402         1 struct pthread.
4403         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
4404         to 0.
4405         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
4406         struct pthread.
4407         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
4408         to 32-bit bytes.
4409         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
4410         tcbp.
4411         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
4412         unneccessarily.
4413         (NO_TLS_OFFSET): Define.
4414         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
4415         add TLS_TCB_SIZE unnecessarily.
4417 2003-04-22  Roland McGrath  <roland@redhat.com>
4419         * Makeconfig (shared-thread-library): Reverse link order to work
4420         around linker bug.
4422 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
4424         * semaphore.h: Fix typo in comment.
4426 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
4428         * sysdeps/pthread/sigfillset.c: New file.
4430         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
4431         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
4432         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
4433         * sysdeps/pthread/sigaction.c: Likewise.
4434         * sysdeps/pthread/sigprocmask.c: New file.
4435         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
4436         __SIGRTMIN+1.
4437         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4438         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
4439         in this case.
4441 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
4443         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4444         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
4446         * sysdeps/unix/sysv/linux/unregister-atfork.c
4447         (__unregister_atfork): Don't free memory not allocated dynamically.
4449         * semaphore.h: Remove __THROW marker from cancellation points.
4450         * nptl/sysdeps/pthread/pthread.h: Likewise.
4452 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
4454         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
4455         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
4456         __THROW.
4458 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
4460         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
4462 2003-04-15  Roland McGrath  <roland@redhat.com>
4464         * forward.c (__pthread_unwind): Tweak to avoid warning.
4466 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
4468         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
4470 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
4472         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
4473         overflow CFA advance instructions.
4474         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4476 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
4478         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
4479         * sysdeps/i386/pthread_spin_lock.c: Likewise.
4480         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
4481         defined.
4483         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
4484         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
4485         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
4486         DW_CFA_advance_loc for .Laddl-.Lsubl.
4488 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
4490         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
4491         position-independent unwind data for static libraries.
4492         Add missing unwind info.  Add comments.
4494         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
4495         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4496         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4497         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4499 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
4501         * Makefile: Make sure all cancellation points are compiled with
4502         exception and asynchronous unwind tables.
4504         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
4505         which mishandles loading of global object addresses in PIC.
4506         (THREAD_SETMEM_NC): Likewise.
4508 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4510         * pthread.h: Define new data structure for cleanup buffer.  Declare
4511         new cleanup handler interfaces.
4512         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
4513         (struct pthread): Add cleanup_jmp_buf pointer.  Define
4514         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
4515         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
4516         it.  Declare old cleanup handler installation functions.
4517         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
4518         handling.
4519         * cleanup_defer.c: Likewise.
4520         * cleanup_compat.c: New file.  Old cleanup code.
4521         * cleanup_def_compat.c: New file.  Old cleanup code.
4522         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
4523         if own thread descriptor.
4524         * unwind.c: New file.
4525         * forward.c: Add __pthread_unwind.
4526         * init.c (pthread_functions): Add __pthread_unwind.
4527         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
4528         Add ptr___pthread_unwind.
4529         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
4530         and unwind function.
4531         * Makefile (libpthread-routines): Add cleanup_compat,
4532         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
4533         table generation if necessary.
4534         * version.c: Record whether unwind support is compiled in.
4535         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
4536         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
4537         handler interfaces.
4538         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
4539         complication to generate unwind information for syscall wrappers.
4540         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4541         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
4542         __cleanup_fct_attribute.
4544         * Makefile: Add rules to build and run tst-cleanup0.
4545         * tst-cleanup0.c: New file.
4546         * tst-cleanup0.expect: New file.
4548         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
4549         caller.  Optimize to avoid often unecessary local variable.
4551 2003-04-11  Roland McGrath  <roland@redhat.com>
4553         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
4554         sets variable `multidir'; include that.
4555         (generated): Add it.
4556         ($(objpfx)$(multidir)/crti.o): New target.
4557         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
4559 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4561         * tst-attr2.c (do_test): Add cast to avoid warning.
4562         * tst-mutex4.c (do_test): Likewise.
4564 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
4566         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
4567         in child.
4569 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
4571         * Makefile (tests): Add tst-detach1.
4572         * tst-detach1.c: New file.
4574 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
4576         * sysdeps/pthread/pthread.h: Remove duplicate
4577         pthread_cleanup_{push,pop} definitions.
4579         * tst-barrier2.c: Eliminate warnings.
4580         * tst-cancel4.c: Likewise.
4581         * tst-cond4.c: Likewise.
4582         * tst-cond6.c: Likewise.
4583         * tst-detach1.c: Likewise.
4584         * tst-rwlock4.c: Likewise.
4585         * tst-rwlock6.c: Likewise.
4586         * tst-rwlock7.c: Likewise.
4587         * tst-sem3.c: Likewise.
4588         * tst-spin2.c: Likewise.
4589         * tst-umask1.c: Likewise.
4591 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
4593         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
4595 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
4597         * descr.h (struct pthread): Move cancelhandling member to the front.
4599 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
4601         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
4602         malloc_parent, and malloc_child statically.
4603         (__register_atfork_malloc): New function.
4604         (free_mem): Don't free any of the malloc_* variables on the list.
4605         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
4606         Define HAVE_register_atfork_malloc.
4608 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
4610         * sysdeps/pthread/createthread.c (create_thread): Add some more
4611         comments explaining when to set multiple_threads and when not.
4613         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4614         THREAD_ATOMIC_BIT_SET if not already defined.
4615         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4616         THREAD_ATOMIC_BIT_SET:
4617         * sysdeps/x86_64/tls.h: Likewise.
4618         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
4619         THREAD_ATOMIC_CMPXCHG_VAL.
4620         (_pthread_cleanup_pop_restore): Likewise.
4621         * cancellation.c (__pthread_enable_asynccancel): Likewise.
4622         (__pthread_enable_asynccancel_2): Likewise.
4623         (__pthread_disable_asynccancel): Likewise.
4624         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4625         (__libc_disable_asynccancel): Likewise.
4626         * init.c (sigcancel_handler): Likewise.
4627         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
4628         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
4630 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
4632         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
4633         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4634         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
4635         * Makefile (tests): Add tst-cancel11.
4636         * tst-cancel11.c: New file.
4638 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
4640         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
4641         round, not the first.  Use specific_used flag instead of local
4642         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
4643         (__free_tcb): Don't call deallocate_tsd here.
4644         (start_thread): Call deallocate_tsd here.
4645         * pthread_setspecific.c: Set specific_used flag really only when
4646         needed.
4647         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
4648         * tst-tsd3.c: New file.
4649         * tst-tsd4.c: New file.
4651 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4653         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
4654         Use atomic_exchange_and_add instead of __lll_add.
4655         (__lll_mutex_timedlock): Likewise.
4656         Patch by Ian Wienand.
4658 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
4660         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4661         (SINGLE_THREAD_P): Fix typo.
4662         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
4664 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4666         * Makefile (tests): Add tst-align.
4667         * tst-align.c: New file.
4668         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
4670         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
4671         function correctly.
4673         * tst-tsd2.c: Add casts to avoid warnings.
4675 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
4677         * descr.h (struct pthread): Move most often used elements to the front.
4679 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
4681         * Makefile (libpthread-routines): Add pthread_atfork.
4682         (libpthread-static-only-routines): Add pthread_atfork.
4684 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4686         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
4687         of TLS_DTV_AT_TP.
4688         (INSTALL_DTV): Add parens.
4689         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
4690         Use passed descr instead of THREAD_SELF.
4691         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
4692         (__lll_mutex_timedlock_wait): Correct expected value after
4693         spurious wakeup.
4694         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
4695         Release lock before waking up the waiters.
4696         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
4697         criteria.  Reorderstruct passed to cleanup handler.  Fix
4698         handling of cancellation and failung pthread_mutex_unlock call.
4699         Use __pthread_enable_asynccancel_2 instead of
4700         __pthread_enable_asynccancel.
4701         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4702         Return result of lock re-get if it fails.
4703         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
4704         for __pthread_cleanup_push.
4705         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
4706         completely broken rwlock implementation.
4707         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4708         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4709         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4710         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
4711         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4712         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
4713         versioned_symbol macro.
4714         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
4715         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4717 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
4719         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
4720         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
4721         and __helper_tid.
4722         (struct timer): Remove th and bar field.
4723         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
4724         debugging code.  Create only one helper thread.
4725         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
4726         helper thread.
4727         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4728         Renamed.  Define statically.  Use thread info from siginfo.
4729         (__helper_once): New variable.
4730         (__helper_tid): New variable.
4731         (__reset_helper_control): New function.
4732         (__start_helper_thread): New function.
4734         * pthread_create.c (start_thread): Don't use setjmp inside
4735         __builtin_expect to work around gcc bug.
4737         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
4738         timer_delete syscall fails, but not with ENOSYS, set
4739         __no_posix_timers.
4741         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
4742         (timer_settime): Fix typo.
4743         * sysdeps/unix/sysv/linux/timer_getoverr.c
4744         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
4746 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
4748         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
4749         offset of cleanupbuf.__prev.
4751 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
4753         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
4754         of included file.
4756 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
4758         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
4759         NULL provide default definition to syscall.
4761 2003-03-25  Roland McGrath  <roland@redhat.com>
4763         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
4764         (timer_id2ptr): Fix typo.
4766 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
4768         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
4769         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
4770         * sysdeps/ia64/pthreaddef.h: Likewise.
4771         * sysdeps/powerpc/pthreaddef.h: Likewise.
4772         * sysdeps/s390/pthreaddef.h: Likewise.
4773         * sysdeps/sh/pthreaddef.h: Likewise.
4774         * sysdeps/x86_64/pthreaddef.h: Likewise.
4775         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
4776         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
4777         being changed.
4778         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4779         SIGTIMER is not unblocked.
4780         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
4781         RT signal taken.
4782         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
4783         be send.
4784         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
4785         pass pointer through as ID.
4786         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
4787         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
4788         * sysdeps/unix/sysv/linux/timer_create.c: New file.
4789         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
4790         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
4791         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
4792         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
4793         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
4794         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
4795         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
4796         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
4797         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
4798         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
4799         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
4800         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
4801         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
4802         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
4803         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
4804         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
4805         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
4806         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
4807         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
4808         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
4809         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
4810         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
4811         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
4812         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
4813         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
4814         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
4815         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
4816         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
4817         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
4818         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
4820         * pthreadP.h: Remove FRAME_LEFT definition.
4821         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
4822         already left frame.  Programs which have this problem are not POSIX
4823         compliant.
4824         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
4826 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
4828         * sysdeps/pthread/tst-timer.c: Check return values of the
4829         functions we test.
4831 2003-03-23  Roland McGrath  <roland@redhat.com>
4833         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
4834         * tst-tls3mod.c: Likewise.
4835         * tst-tls1.c: Likewise.
4836         * tst-tls2.c: Likewise.
4838         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
4839         undefined behavior.
4841         * tst-join5.c (tf1, tf2): Add a cast.
4843         * Makeconfig (includes): Append -I$(..)nptl to this variable.
4845         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
4846         Don't test anything.
4847         * tst-cond4.c: Likewise.
4848         * tst-cond6.c: Likewise.
4849         * tst-flock2.c: Likewise.
4850         * tst-mutex4.c: Likewise.
4851         * tst-rwlock4.c: Likewise.
4852         * tst-signal1.c: Likewise.
4853         * tst-spin2.c: Likewise.
4854         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
4856         * tst-mutex4.c: Use test-skeleton.c.
4857         * tst-spin2.c: Likewise.
4858         * tst-sysconf.c: Likewise.
4859         * tst-barrier2.c: Likewise.
4860         * tst-cond4.c: Likewise.
4861         * tst-cond6.c: Likewise.
4862         * tst-rwlock4.c: Likewise.
4863         * tst-unload.c: Likewise.
4864         * tst-flock2.c (do_test): Use return instead of exit.
4866 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
4868         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
4870 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
4872         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4873         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
4874         instead of __lll_compare_and_swap.
4875         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4876         Likewise.
4877         Removed definition if __lll_compare_and_swap.
4879         * cancellation.c: Adjust for new form of compare&exchange macros.
4880         * cleanup_defer.c: Likewise.
4881         * init.c: Likewise.
4882         * libc-cancellation.c: Likewise.
4883         * old_pthread_cond_broadcast.c: Likewise.
4884         * old_pthread_cond_signal.c: Likewise.
4885         * old_pthread_cond_timedwait.c: Likewise.
4886         * old_pthread_cond_wait.c: Likewise.
4887         * pthread_cancel.c: Likewise.
4888         * pthread_create.c: Likewise.
4889         * pthread_detach.c: Likewise.
4890         * pthread_join.c: Likewise.
4891         * pthread_key_delete.c: Likewise.
4892         * pthread_setcancelstate.c: Likewise.
4893         * pthread_setcanceltype.c: Likewise.
4894         * pthread_timedjoin.c: Likewise.
4895         * pthread_tryjoin.c: Likewise.
4896         * sysdeps/pthread/createthread.c: Likewise.
4898 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
4900         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
4901         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
4902         definitions.  Replace uses with calls to atomic_* functions.
4903         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
4904         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
4905         __lll_test_and_set calls with atomic_exchange_and_add and
4906         atomic_exchange calls respectively.
4907         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
4908         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
4909         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
4910         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
4911         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
4912         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
4913         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
4915         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
4916         returns the old value.
4918 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
4920         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
4921         int for variable OLDVAL and correct inline assembler contraint.
4922         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
4923         type int for variable OLD.
4925         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
4926         only for s390-32.
4927         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4928         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
4929         instead of multiple_threads field in the TCB.
4931 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
4933         * sysdeps/i386/i686/bits/atomic.h: Removed.
4934         * sysdeps/i386/i586/bits/atomic.h: Removed.
4935         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
4936         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
4937         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
4938         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
4939         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
4940         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
4941         * atomic.h: Removed.  Moved to glibc.
4943         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
4944         support for clock selection.
4946         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
4947         signalling waiters.
4949 2003-03-18  Roland McGrath  <roland@redhat.com>
4951         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4952         Add __lll_rel_instr first.  Add memory clobber.
4953         (lll_mutex_unlock): Use __lll_test_and_set.
4954         From Paul Mackerras <paulus@samba.org>.
4956         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
4957         unconditionally.
4958         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4959         (SINGLE_THREAD_P):  Add `header.' prefix.
4960         From Paul Mackerras <paulus@samba.org>.
4962         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
4963         pthread_timedjoin_np to ...
4964         (libpthread: GLIBC_2.3.3): ... here.
4965         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
4967         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4968         Avoid shadowing VAL variable.
4970         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4971         New macro.
4973 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
4975         * Makefile (tests): Add tst-cond11.
4976         * tst-cond11.c: New file.
4978         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
4979         struct passed to cleanup handler to eliminate one more
4980         instruction.
4981         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4983         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4984         (pthrad_cond_t): Replace __unused field with __clock.
4986         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
4987         waken all waiters in cleanup handler.
4988         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4989         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4991         * pthread_condattr_getclock.c: New file.
4992         * pthread_condattr_setclock.c: New file.
4993         * sysdeps/pthread/pthread.h: Declare these new functions.
4994         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
4995         * Makefile (libpthread-routines): Add the new functions.
4996         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
4997         Renamed field to value.  Document use of the bits.
4998         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
4999         change.
5000         * pthread_condattr_setpshared.c: Likewise.
5001         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
5002         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
5003         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5004         Add __clock field.
5005         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5006         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5007         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5008         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
5010         Implement clock selection.
5011         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5012         * pthread-errnos.sym: Add ENOSYS.
5013         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5014         _POSIX_CLOCK_SELECTION.
5015         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5017         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
5018         invalid .size directive.
5020 2003-03-17  Roland McGrath  <roland@redhat.com>
5022         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
5023         Formatting tweaks.
5025 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5027         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
5028         Use __lll_add instead of spelling it out.  Use protected symbol names.
5029         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
5030         Use __lll_add.
5031         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
5032         Renamed from lll_compare_and_swap.  Use new name where necessary.
5033         (__lll_add): Defined.
5034         (__lll_dec_if_positive): Defined.
5035         (__lll_test_and_set): Defined.
5036         * sysdeps/ia64/pthread_spin_init.c: Removed.
5037         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
5038         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
5039         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
5040         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
5041         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
5042         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
5043         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
5044         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
5045         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
5046         __sync_lock_release_si.
5047         Patch by Jakub Jelinek.
5049         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
5050         Fix timeout handling.
5051         (__lll_timedwait_tid): Likewise.
5052         (lll_unlock_wake_cb): Wake up other waiters if necessary.
5053         Patch by Jakub Jelinek.
5055         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
5057 2003-03-17  Roland McGrath  <roland@redhat.com>
5059         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
5060         * sysdeps/pthread/pthread_spin_init.c: New file.
5061         * sysdeps/pthread/pthread_spin_unlock.c: New file.
5062         * sysdeps/powerpc/Makefile: New file.
5063         * sysdeps/powerpc/pthread_spin_lock.c: New file.
5064         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
5065         * sysdeps/powerpc/pthreaddef.h: New file.
5066         * sysdeps/powerpc/tcb-offsets.sym: New file.
5067         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
5068         * sysdeps/powerpc/tls.h: New file.
5069         * sysdeps/powerpc/bits/atomic.h: New file.
5070         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
5071         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
5072         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
5074         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
5075         * sysdeps/unix/sysv/linux/sem_post.c: New file.
5076         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
5077         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
5078         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
5079         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
5080         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
5081         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
5082         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
5083         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
5084         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
5085         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
5086         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
5087         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
5088         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
5090         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
5091         not gettimeofday.
5092         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
5093         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5094         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
5095         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
5096         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5098 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
5100         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
5101         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5102         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5103         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5104         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
5106 2003-03-16  Roland McGrath  <roland@redhat.com>
5108         * tst-fork4.c: Include <string.h>.
5109         * tst-signal2.c: Likewise.
5110         * tst-mutex5.c (do_test): exit -> return.
5111         * tst-mutex2.c: Include <stdlib.h>.
5113 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
5115         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5116         (__lll_mutex_timedlock_wait): Correct expected value after
5117         spurious wakeup.  Otherwise we would never wait again.
5119         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
5120         zone versus inline asm stupidity.  Use correct instructions.
5122         * tst-rwlock6.c: Add some more status output.
5124 2003-03-15  Roland McGrath  <roland@redhat.com>
5126         * sysdeps/pthread/configure.in: New file.
5127         * sysdeps/pthread/configure: New file (generated).
5129 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5131         * allocatestack.c (allocate_stack): Store the exact stack size of
5132         user allocated stacks.
5134 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
5136         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
5137         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
5138         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5139         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
5140         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
5141         Use `header.' prefix.
5142         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
5144 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
5146         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
5147         __builtin_frame_address, use stack pointer.
5149         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
5150         instead of __builtin_frame_pointer.
5152 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5154         * tst-basic1.c (do_test): Add cast to avoid warning.
5155         * tst-basic2.c (do_test): Likewise.
5157         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
5158         amount of stack correction.
5160         * tst-fork4.c: Use test-skeleton.c.
5162 2003-03-14  Roland McGrath  <roland@redhat.com>
5164         * init.c: Fix typo "#eli" for "#else".
5166 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
5168         * allocatestack.c (__stack_user): Use hidden_data_def.
5169         * pthread_create.c (__pthread_keys): Likewise.
5171         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
5173 2003-03-14  Roland McGrath  <roland@redhat.com>
5175         * tst-fork4.c: New file.
5176         * Makefile (tests): Add it.
5178         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
5179         we always define the padding space.
5180         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
5181         stopped supporting its own extensions fully.
5182         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
5183         struct also called `header', so `header.multiple_threads' is the field
5184         name to use on all machines.
5185         * allocatestack.c (allocate_stack): Use `header.' prefix.
5186         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5187         * pthread_create.c (__pthread_create_2_1): Likewise.
5188         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
5189         (THREAD_SELF): Likewise.
5190         * sysdeps/x86_64/tls.h: Likewise.
5191         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5192         (SINGLE_THREAD_P): Likewise.
5193         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5194         (SINGLE_THREAD_P): Likewise.
5195         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
5196         (SINGLE_THREAD_P): Likewise.
5198         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
5199         value directly.
5201 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
5203         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
5204         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
5206         * pthread_create.c (start_thread): setjmp is expected to return 0.
5208         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
5209         (THREAD_GETMEM_NC): Likewise.
5211 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
5213         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
5214         and the size of the stack which must be allocated is a multiple,
5215         allocate one more page.
5216         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
5217         MULTI_PAGE_ALIASING.
5219 2003-03-13  Roland McGrath  <roland@redhat.com>
5221         * pthread_create.c (start_thread): Set EXITING_BIT after the
5222         event-reporting (and destructors), not before.
5224 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
5226         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
5227         lll_futex_wake): Declare register variables as long int instead of
5228         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
5229         Make syscall arguments clobbered by the syscall.
5230         (lll_futex_wait): Define using lll_futex_timed_wait.
5232         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
5233         to void *.
5235         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
5236         PPID if [! NDEBUG].
5238         * allocatestack.c (nptl_ncreated): Only declare if
5239         COLORING_INCREMENT != 0.
5241         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
5242         (__libc_enable_asynccancel_2): Remove prototype.
5244         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
5245         ctid to match kernel.
5247 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5249         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
5250         libc_multiple_threads.
5251         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
5252         __libc_multiple_threads to...
5253         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
5255         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
5256         versioning.
5257         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5258         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5260         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
5261         (__pthread_once_internal): Define.
5263         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
5264         macros instead of .symver directly.
5265         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5266         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
5268         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
5269         * sysdeps/x86_64/tcb-offsets.sym: New file.
5270         * sysdeps/x86_64/Makefile: New file.
5272         * sysdeps/i386/tcb-offsets.sym: Add SELF.
5273         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
5274         to access own pthread_t in TCB.
5275         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5276         Likewise.
5277         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5278         Likewise.
5279         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5281 2003-03-12  Roland McGrath  <roland@redhat.com>
5283         * pthread-errnos.sym: New file.
5284         * Makefile (gen-as-const-headers): New variable, list that file.
5285         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
5286         header <pthread-errnos.h> instead of defining errno values here.
5287         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
5288         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5289         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5290         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5291         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5292         Likewise.
5293         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5294         Likewise.
5295         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5296         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5297         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5298         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5299         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5300         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5301         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5302         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5303         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5304         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5305         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5306         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
5307         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
5308         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
5309         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
5310         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5311         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5312         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5313         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5314         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5315         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5316         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5317         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
5318         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
5319         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
5320         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5321         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5323         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
5324         CLONE_CHILD_SETTID worked.
5326 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
5328         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
5329         file.
5330         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
5331         file.
5333         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5334         (pthread_cond_t): Add padding.
5336         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
5337         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
5338         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
5340         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
5341         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
5342         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
5343         (__pthread_rwlock_timedrdlock): Likewise.
5344         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
5345         (__pthread_rwlock_wrlock): Likewise.
5346         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
5347         (__pthread_rwlock_rdlock): Likewise.
5349         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
5351         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
5352         result of lock re-get if it fails.
5354 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5356         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
5357         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5358         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
5359         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5360         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5361         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
5362         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
5363         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5364         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5365         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5367         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
5368         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
5370         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
5371         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
5372         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
5373         (create_thread): Likewise.
5374         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
5375         * init.c (__pthread_initialize_minimal_internal): Initialize
5376         __libc_multiple_threads_ptr if necessary.
5377         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
5378         __pthread_multiple_threads and __libc_multiple_threads_ptr.
5379         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
5380         __libc_multiple_threads.
5381         (__libc_pthread_init): Return pointer to __libc_pthread_init if
5382         necessary.
5384         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
5385         (THREAD_SETMEM_NC): Likewise.
5387         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
5388         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
5389         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
5390         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
5392         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
5393         Eliminate one entire instruction.
5395         * cancellation.c (__pthread_enable_asynccancel_2): New function.
5396         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
5397         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5398         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
5399         instead of __pthread_enable_asynccancel.
5400         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5401         (__pthread_cond_wait): Likewise.
5402         * sysdeps/pthread/pthread_cond_timedwait.c
5403         (__pthread_cond_timedwait): Likewise.
5404         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5406         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5407         (__condvar_cleanup): Wake up all waiters in case we got signaled
5408         after being woken up but before disabling asynchronous
5409         cancellation.
5410         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5411         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5412         (__condvar_cleanup): Likewise.
5414         * init.c (__NR_set_tid_address): If already defined, don't redefine.
5415         Make it an error if architecture has no #if case.  Add x86-64.
5417         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
5418         pt-initfini.s generation.
5420         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
5421         (TLS_INIT_TP): Fix typo.
5423 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5425         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
5426         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
5428         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
5429         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
5430         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
5431         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
5432         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
5433         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5434         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5435         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5437 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5439         * sysdeps/pthread/pthread_cond_timedwait.c
5440         (__pthread_cond_timedwait): Return the result of the final
5441         locking.  If it succeeds, the regular function return value.
5443         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
5444         Return result of the final locking.
5445         * version.c (__nptl_main): Work around problems with the strange
5446         INTERNAL_SYSCALL macro on ppc32.
5447         * init.c (__pthread_initialize_minimal_internal): Unblock
5448         SIGCANCEL in case the parent blocked it.
5449         Reported by Paul Mackerras <paulus@samba.org>.
5451         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
5452         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
5453         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
5455 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5457         * sysdeps/pthread/pthread_cond_timedwait.c
5458         (__pthread_cond_timedwait): Unlock and fail if
5459         __pthread_mutex_unlock_internal failed.
5461         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
5462         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
5463         Use ARCH_CLONE.
5464         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
5465         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
5466         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
5467         ALLOCATE_STACK): New macros.
5468         (TLS_TPADJ): New macro.
5469         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
5470         (allocate_stack): Handle TLS_DTV_AT_TP and
5471         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
5472         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
5473         Don't set PD->self.
5474         * init.c [__ia64__] (__NR_set_tid_address): Define.
5476         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
5477         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
5478         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
5479         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
5480         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
5481         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
5482         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
5483         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
5484         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
5485         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
5486         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
5487         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
5488         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
5489         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
5490         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
5491         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
5492         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
5493         * sysdeps/ia64/bits/atomic.h: New file.
5494         * sysdeps/ia64/Makefile: New file.
5495         * sysdeps/ia64/pthread_spin_init.c: New file.
5496         * sysdeps/ia64/pthread_spin_lock.c: New file.
5497         * sysdeps/ia64/pthread_spin_trylock.c: New file.
5498         * sysdeps/ia64/pthread_spin_unlock.c: New file.
5499         * sysdeps/ia64/pthreaddef.h: New file.
5500         * sysdeps/ia64/tcb-offsets.sym: New file.
5501         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
5502         * sysdeps/ia64/tls.h: New file.
5504         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
5505         to syscall instead of no arguments.
5507 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
5509         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
5510         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
5511         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
5512         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
5514         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
5515         unused code.
5517         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
5519         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5520         lowlevelbarrier.sym.
5521         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
5522         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
5523         Include lowlevelbarrier.h and don't define offsets locally.
5524         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
5526         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
5527         (__lll_mutex_lock_wait): Reverse order of first two parameters.
5528         (__lll_mutex_timedlock_wait): Likewise.
5529         (lll_mutex_lock): Adjust asm for that.
5530         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
5531         (lll_lock): Adjust asm for operand order change.
5532         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
5533         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
5535         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
5536         Reverse order of parameters.
5537         (__lll_timedwait_tid): Remove regparms attribute.
5538         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
5539         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
5541         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5542         (__lll_timedwait_tid): Remove one unnecessary instruction.
5544         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
5545         __lll_mutex_timedlock_wait only for NOT_IN_libc.
5546         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
5547         lowlevelmutex.S.
5549         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
5550         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
5551         for NOT_IN_libc.
5552         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
5553         lowlevellock.S.
5555         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
5556         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
5557         for libc.so.
5558         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
5559         define LOCK here (if UP is not defined).  The actual code is in
5560         lowlevelmutex.S.
5562         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
5563         LOCK is already defined.  Don't define lll_unlock_wake_cb and
5564         __lll_timedwait_tid for libc.so.
5565         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
5566         define LOCK here (if UP is not defined).  The actual code is in
5567         lowlevellock.S.
5569         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
5570         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
5571         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
5572         instead of lowlevelsem.h.
5573         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5574         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5575         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5577         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5578         lowlevelrwlock.sym.
5579         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
5580         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
5581         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
5583         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
5584         register loading.
5585         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
5586         last changed.  D'oh.
5588         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
5590         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
5591         of __libc_locking_needed.
5592         (lll_trylock): Initialize %eax to zero.
5594         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
5595         pthread_cond_t definition.
5597 2003-03-10  Roland McGrath  <roland@redhat.com>
5599         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
5600         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
5601         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
5602         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
5603         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
5605         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
5606         Instead of setting PD->multiple_threads, set globals
5607         __pthread_multiple_threads and __libc_multiple_threads.
5608         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5609         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
5610         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
5612         * descr.h (struct pthread): Conditionalize first member on
5613         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
5614         containing an anonymous tcbhead_t.  Move `list' member out.
5615         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
5616         * allocatestack.c: Remove use of `header.data.' prefix.
5617         * pthread_create.c: Likewise.
5618         * init.c (__pthread_initialize_minimal_internal): Likewise.
5619         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5620         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
5621         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
5622         * sysdeps/x86_64/tls.h: Likewise.
5623         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5624         (SINGLE_THREAD_P): Likewise.
5625         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5626         (SINGLE_THREAD_P): Likewise.
5627         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
5628         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
5630 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
5632         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
5634         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
5635         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5637         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
5638         leftovers from the ia32 code.
5640         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
5641         memory load.
5642         (clear_once_control): Don't load %esi.
5644         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
5645         handling.
5647         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5649         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
5650         * sysdeps/unix/sysv/linux/createthread.c: ...here.
5652         * Makefile (tests): Add tst-cond10.
5653         * tst-cond10.c: New file.
5655 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
5657         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
5658         * tst-signal3.c (do_test): Likewise.
5659         * tst-sem5.c (do_test): Likewise.
5660         * tst-kill6.c (do_test): Likewise.
5661         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
5663         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
5664         of inc/dec.
5665         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5666         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
5667         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5668         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5669         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5670         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5671         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5672         Likewise.
5673         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5674         Likewise.
5675         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5676         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5677         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5678         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5679         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5680         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5681         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5682         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5684         * allocatestack.c (allocate_stack): If mprotect() fails free the
5685         TLS memory.
5687 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
5689         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
5691         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
5692         lll_wake_tid.  This was used only to work around kernel limits in
5693         the early days.
5694         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
5695         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
5696         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5697         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
5699         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
5700         (__pthread_initialize_minimal_internal): Change initialization of
5701         __static_tls_align_m1 appropriately.
5702         * pthreadP.h (__static_tls_align_m1): Renamed from
5703         __static_tls_align.
5704         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
5705         instead of __static_tls_align-1.
5707 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
5709         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
5711         * pthread_create.c: Define __pthread_keys using nocommon
5712         attribute, not by placing it explicitly in bss.
5713         Remove DEFINE_DEALLOC definition.  Not needed anymore.
5715         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
5716         Use it in mmap call to allocate stacks.
5718         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
5720         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
5721         result of the thread function.
5723 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
5725         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
5726         version is just fine.
5728         * sysdeps/unix/sysv/linux/libc_pthread_init.c
5729         (__pthread_child_handler): Renamed from pthread_child_handler,
5730         exported, and marked hidden.  Change all users.
5731         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
5732         free __pthread_child_handler from child list.
5734 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5736         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
5738         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5739         Fix handling of cancellation and failing pthread_mutex_unlock call.
5740         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5741         (__pthread_cond_wait): Likewise.
5743         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5744         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
5745         lll_futex_timed_wait call.
5746         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5747         (pthread_rwlock_timedwrlock): Likewise.
5749         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
5750         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
5751         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
5753         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
5754         check of lll_futex_wake return value.
5756 2003-03-03  Roland McGrath  <roland@redhat.com>
5758         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
5760         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5761         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
5762         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
5764 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
5766         * sysdeps/pthread/timer_create.c (timer_create): Return correct
5767         error for CPU clocks.
5769         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5770         _POSIX_MONOTONIC_CLOCK.
5771         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5773         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
5774         recent kernels.
5776 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5778         * descr.h (struct pthread): Move cleanup field to the front.
5780 2003-03-01  Roland McGrath  <roland@redhat.com>
5782         * sem_open.c (sem_open): Braino fix.
5784 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5786         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
5787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
5788         __pthread_cleanup_pop functionality.
5789         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5791         * descr.h (struct pthread): Move tid field to the front now that
5792         it is often used.
5794         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
5795         (__lll_mutex_timedlock_wait): Remove.
5796         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5797         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5798         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5799         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5800         (lll_unlock_wake_cb): Don't save and restore %esi.
5801         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5802         %esi.
5803         (__lll_timedwait_tid): Add alignment.
5804         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5805         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5806         %esi.
5807         (__lll_timedwait_tid): Removed.
5808         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5809         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
5810         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5811         (pthread_barrier_wait): Don't save, load, and restore %esi for
5812         last thread.
5813         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5814         (__pthread_cond_signal): Don't save, load, and restore %esi.
5815         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
5816         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
5817         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
5818         Don't save, load, and restore %esi.
5820 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
5822         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
5823         Release lock before waking up the waiters.
5825         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
5827         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
5828         (reader_thread): Likewise.
5830         * sysdeps/pthread/pthread_rwlock_unlock.c
5831         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
5832         to wake up readers if there are none.
5834         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
5835         Release internal lock before wake threads.
5837 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
5839         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
5840         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
5841         predefined.
5842         * tst-rwlock9.c: Likewise.
5843         * tst-rwlock10.c: New file.
5844         * tst-rwlock11.c: New file.
5846         * Makefile (tests): Add tst-dlsym1.
5847         * tst-dlsym1.c: New file.
5849         * init.c (__pthread_initialize_minimal_internal): Set
5850         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
5851         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
5853 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
5855         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
5857         * tst-cond2.c: Fix sychronization with child.
5859         * tst-rwlock8.c (reader_thread): Remove unused variable.
5861         * Makefile: Add rules to build and run tst-tls3.
5862         * tst-tls3.c: New file.
5863         * tst-tls3mod.c: New file.
5865         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
5866         * tst-rwlock8.c: New file.
5867         * tst-rwlock9.c: New file.
5868         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
5869         complete broken rwlock implementation.
5870         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5871         Likewise.
5872         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5873         Likewise.
5874         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5875         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5876         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
5877         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
5878         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5879         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
5880         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
5882 2003-02-23  Roland McGrath  <roland@redhat.com>
5884         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
5886 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
5888         * Makefile (tests): Add tst-context1.
5889         * tst-context1.c: New file.
5891         * Makefile (tests): Add tst-tls1 and tst-tls2.
5892         * tst-tls1.c: New file.
5893         * tst-tls2.c: New file.
5895         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
5896         for failed cmpxchg.
5898         * pthread_create.c (start_thread): Set EXITING_BIT early.
5900         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
5901         (THREAD_GETMEM_NC): Likewise.
5903 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
5905         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
5906         off 3 more bytes by using offset-less instructions when possible.
5908         * Makefile: Add dependency for $(objpfx)version.d.
5910         * eintr.c (eintr_source): Add unnecessary return but the compiler
5911         insists.
5913         * tst-kill3.c: Include <unistd.h>.
5915 2003-02-21  Roland McGrath  <roland@redhat.com>
5917         * pthread_create.c (start_thread): Call __libc_thread_freeres.
5919 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5921         * Makefile (tests): Add tst-eintr1.
5922         (distribute): Add eintr.c.
5923         * tst-eintr1.c: New file.
5924         * eintr.c: New file.
5926         * pthread_cancel.c (pthread_cancel): Use tkill directly.
5928         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
5929         Disallow sending SIGCANCEL.
5931         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
5932         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
5933         * tst-kill1.c: New file.
5934         * tst-kill2.c: New file.
5935         * tst-kill3.c: New file.
5936         * tst-kill5.c: New file.
5937         * tst-kill6.c: New file.
5938         * tst-basic7.c: Renamed to...
5939         * tst-kill4.c: ...this.
5941 2003-02-21  Roland McGrath  <roland@redhat.com>
5943         * Makefile (install-lib-ldscripts): New variable.
5945 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5947         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
5948         * pthread_cancel.c: Use INVALID_TD_P.
5949         * pthread_detach.c: Likewise.
5950         * pthread_getschedparam.c: Likewise.
5951         * pthread_setschedparam.c: Likewise.
5952         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
5953         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5954         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
5955         * pthread_timedjoin.c: Likewise.
5957         * tst-basic7.c: Include <signal.h>.
5959         * pthread_join.c (pthread_join): Limited checking for invalid
5960         descriptors.
5961         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
5963 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
5965         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
5966         beginning of the loop.  Clear the entire first block of TSD.
5967         * Makefile (tests): Add tst-key4.
5968         * tst-key4.c: New file.
5970 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
5972         * Makefile (tests): Add tst-basic7.
5973         * tst-basic7.c: New file.
5975         * pthread_create.c (deallocate_tsd): Mark as internal_function.
5976         Add some more __builtin_expect.
5978         * pthreadP.h: Define dummy version of DEBUGGING_P.
5980 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
5982         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
5983         _POSIX_THREAD_PRIORITY_SCHEDULING.
5984         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
5985         _XOPEN_REALTIME_THREADS.
5986         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
5988         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
5989         kernel returns EINVAL for PID <= 0, work around it.
5991         * Makefile (tests): Add tst-signal5.
5992         * tst-signal5.c: New file.
5994         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
5995         and LOGIN_NAME_MAX.
5997         * tst-cancel1.c (tf): Block all signals.
5999         * Makefile (tests): Add tst-basic6.
6000         * tst-basic6.c: New file.
6002         * tst-basic1.c: Add test for process ID.
6004         * Makefile (tests): Add tst-cancel10.
6005         * tst-cancel10.c: New file.
6007         * Makefile (tests): Add tst-signal4.
6008         * tst-signal4.c: New file.
6010         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
6011         __sigismember instead of sigismember.  Add __builtin_expect.
6013 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
6015         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
6016         pthread_setcancelstate, and pthread_rwlock_setpshared.
6018         * tst-cancel7.c (do_test): Make sure the pid file exists before
6019         canceling the thread.
6021         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
6022         pthread_rwlock_timedrdlock tests.
6023         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
6024         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6025         Check for invalid tv_nsec field.
6026         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6027         Likewise.
6029         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
6030         recursive mutex of overflow.
6032         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
6034         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
6035         going into an endless loop.
6036         * Makefile (tests): Add tst-cancel9.
6037         * tst-cancel9.c: New file.
6039         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
6041 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
6043         * tst-mutex5.c (do_test): Add more timedlock tests.
6045         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
6046         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
6048         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
6049         use INLINE_SYSCALL.  Error number is returned, not -1.
6051         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
6052         and __deallocate_stack with internal_function.
6053         * pthread_create.c: Adjust definitions appropriately.
6054         * allocatestack.c: Likewise.
6056         * pthread_join.c: Add one more __builtin_expect.
6057         * pthread_timedjoin.c: Likewise.
6059         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
6060         not data of sequence number does not match.
6061         Add one __builtin_expect.
6063         * Makefile (tests): Add tst-clock1.
6064         * tst-clock1.c: New file.
6066         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
6067         negative arguments.
6068         * Makefile (tests): Add tst-basic5.
6069         * tst-basic5.c: New file.
6071 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
6073         * Makefile (tests): Add tst-basic4.
6074         * tst-basic4.c: New file.
6076         * pthreadP.h: Add declaraction for __nptl_nthreads.
6077         * pthread_create.c: Define __nptl_nthreads
6078         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
6079         after thread is done.  If then zero, call exit(0).
6080         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6081         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
6082         * init.c (pthread_functions): Initialize ptr_nthreads.
6083         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
6084         (__reclaim_stacks): Decrement __nptl_nthreads.
6085         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
6086         Define.
6087         * Makefile (tests): Add tst-basic3.
6088         * tst-basic3.c: New file.
6090         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
6091         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
6092         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
6093         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
6094         if asynchronous canceling is enabled.
6095         * pthread_join.c (pthread_join): When recognizing circular joins,
6096         take into account the other thread might be already canceled.
6097         * Makefile (tests): Add tst-join5.
6098         * tst-join5.c: New file.
6100         * Makefile (tests): Add tst-join4.
6101         * tst-join4.c: New file.
6103 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6105         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
6107 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6109         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
6110         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
6111         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
6112         warning.
6113         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
6114         to avoid warning.
6115         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
6116         error if lll_futex_wake failed.
6118 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
6120         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
6121         handling of cancellation and failung pthread_mutex_unlock call.
6122         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6123         * Makefile (tests): Add tst-cond8 and tst-cond9.
6124         * tst-cond8.c: New file.
6125         * tst-cond9.c: New file.
6127         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
6129         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
6130         non-standard initializers with __USE_GNU.
6132         * Makefile (tests): Add tst-cleanup3.
6133         * tst-cleanup3.c: New file.
6135 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
6137         * Makefile (tests): Add tst-attr1 and tst-attr2.
6138         * tst-attr1.c: New file.
6139         * tst-attr2.c: New file.
6141         * Makefile: Add rules to build and run tst-atfork2 test.
6142         * tst-atfork2.c: New file.
6143         * tst-atfork2mod.c: New file.
6145         * sysdeps/unix/sysv/linux/unregister-atfork.c
6146         (__unregister_atfork): Free the memory allocated for the handlers
6147         after removing them from the lists.
6149         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
6150         cleanup function.
6152         * tst-atfork1.c (do_test): Wait for the child we forked.
6153         Report error in child.
6155         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
6157         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
6159 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
6161         * Makefile (tests): Add tst-cancel8.
6162         * tst-cancel8.c: New file.
6164         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
6165         clearing of control variable.
6166         * Makefile (tests): Add tst-once3 and tst-once4.
6167         * tst-once3.c: New file.
6168         * tst-once4.c: New file.
6170 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
6172         * sysdeps/sh/Makefile: New file.
6173         * sysdeps/sh/bits/atomic.h: New file.
6174         * sysdeps/sh/pthread_spin_init.c: New file.
6175         * sysdeps/sh/pthread_spin_lock.c: New file.
6176         * sysdeps/sh/pthread_spin_trylock.S: New file.
6177         * sysdeps/sh/pthread_spin_unlock.S: New file.
6178         * sysdeps/sh/pthreaddef.h: New file.
6179         * sysdeps/sh/tcb-offsets.sym: New file.
6180         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
6181         * sysdeps/sh/tls.h: New file.
6182         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
6183         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
6184         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
6185         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
6186         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
6187         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
6188         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
6189         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
6190         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
6191         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
6192         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
6193         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
6194         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
6195         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
6196         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
6197         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
6198         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
6199         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
6200         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
6201         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
6202         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
6203         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
6204         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
6205         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
6206         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
6207         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
6208         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
6209         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
6210         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
6211         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
6213 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
6215         * tst-cond2.c: Rearrange code to not rely on behavior undefined
6216         according to POSIX.
6218         * tst-basic2.c (do_test): Lock mutex before creating the thread.
6220 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
6222         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
6223         (TLS_GET_FS): New #define.
6224         (TLS_SET_FS): New #define.
6225         Correct value of __NR_set_thread_area.
6227         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
6229 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
6231         * Makefile (tests): Add tst-popen1.
6232         * tst-popen1.c: New file.
6234         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
6235         but inactive generalization.
6236         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6237         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6238         Minor optimization, remove one instruction.
6239         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6241 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6243         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
6245 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6247         * init.c (__NR_set_tid_address): Add #ifdef for s390.
6248         * sysdeps/pthread/pthread_barrier_wait.c: New file.
6249         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
6250         * sysdeps/pthread/pthread_cond_signal.c: New file.
6251         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
6252         * sysdeps/pthread/pthread_cond_wait.c: New file.
6253         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
6254         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
6255         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
6256         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
6257         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
6258         * sysdeps/s390/Makefile: New file.
6259         * sysdeps/s390/bits/atomic.h: New file.
6260         * sysdeps/s390/pthread_spin_init.c: New file.
6261         * sysdeps/s390/pthread_spin_lock.c: New file.
6262         * sysdeps/s390/pthread_spin_trylock.c: New file.
6263         * sysdeps/s390/pthread_spin_unlock.c: New file.
6264         * sysdeps/s390/pthreaddef.h: New file.
6265         * sysdeps/s390/tcb-offsets.sym: New file.
6266         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
6267         * sysdeps/s390/tls.h: New file.
6268         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
6269         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
6270         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
6271         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
6272         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
6273         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
6274         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6275         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
6276         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
6277         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
6278         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
6279         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
6280         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
6281         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
6282         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
6283         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
6284         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
6285         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
6286         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
6287         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
6288         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
6289         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
6290         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
6292 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
6294         * atomic.h: Add a couple more default implementations.
6295         (atomic_compare_and_exchange_acq): Use
6296         __arch_compare_and_exchange_32_acq in return value definition.  It
6297         always exists.
6298         (atomic_bit_set): Renamed from atomic_set_bit.
6299         Add missing atomic_ prefixes.
6301         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
6302         thread library is available, use correct value to mark initialized
6303         once variable.
6305 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
6307         * allocatestack.c (allocate_stack): Use __getpagesize instead of
6308         __sysconf to determine pagesize.
6310         * pthread_create.c: Include <atomic.h>.
6311         * allocatestack.c (allocate_stack): Implement coloring of the
6312         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
6313         size minus one.  Adjust users.
6314         * sysdeps/i386/i686/Makefile: New file.
6316 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
6318         * allocatestack.c: Improve comment throughout the file.
6320         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6321         (__lll_lock_wait): Add branch prediction.
6322         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6323         (__lll_lock_wait): Likewise.
6324         (lll_unlock_wake_cb): Removed.
6326 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
6328         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
6329         _POSIX_THREAD_PRIORITY_SCHEDULING.
6331 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
6333         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6334         Fix return type of ptr___pthread_getspecific.
6336 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
6338         * Makefile (tests): Add tst-umask1.
6339         (tst-umask1-ARGS): Define.
6340         * tst-umask1.c: New file.
6342 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
6344         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
6345         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
6346         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
6347         pthread_rwlock_unlock.
6348         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
6349         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
6350         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
6351         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
6352         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6353         New file.
6354         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
6355         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6356         New file.
6357         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
6358         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
6359         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
6360         New file.
6361         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
6362         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
6363         New file.
6364         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
6365         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
6366         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
6367         New file.
6368         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
6369         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
6370         New file.
6371         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
6373         * Makefile (libpthread-routines): Remove lowlevelcond and
6374         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
6375         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
6376         and pthread_cond_broadcast.
6377         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
6378         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
6379         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
6380         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
6381         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
6382         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
6383         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
6384         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
6385         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
6386         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
6387         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
6388         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
6389         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
6390         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
6391         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
6392         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
6393         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
6394         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
6395         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
6396         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
6397         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
6398         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
6399         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
6400         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
6401         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
6402         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
6403         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
6404         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
6405         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
6406         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
6407         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
6409         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
6410         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
6411         of the code is moved to ...
6412         * sysdeps/pthread/createthread.c: ...here.  New file.
6414 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
6416         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
6417         (__new_sem_post): Clear %eax before returning.
6418         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
6420         * Makefile (tests): Add tst-cleanup2.
6421         * tst-cleanup2.c: New file.
6423         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6424         Interpret first parameter correctly.
6426 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
6428         * Makefile (headers): Add bits/semaphore.h.
6430 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
6432         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
6433         if not SHARED.
6435 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
6437         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
6438         must be used and mapping failed.
6439         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
6441         * Makefile (CFLAGS-pthread_self.os): Define this, not
6442         CFLAGS-pthread_self.c.
6444 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6446         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
6447         lll_unlock_wake_cb.
6449         * Makefile (libpthread-routines): Add version.  Add rules to build
6450         version.os and banner.h.
6451         * version.c: New file.
6453 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
6455         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
6456         the alias unconditional.
6457         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
6459 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6461         * Makefile (CFLAGS-pthread_self.c): New definition.
6463 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6465         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
6466         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
6467         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
6468         * init.c (__pthread_initialize_minimal_internal): Likewise.
6470 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
6472         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
6474         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6475         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6476         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6477         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6478         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6479         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6481 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6483         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
6484         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
6485         * tst-cancel-wrappers.sh: Remove all exceptions.
6487 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
6489         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
6490         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
6492         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
6493         Use __libc_pthread_functions array if SHARED.
6495         * pthreadP.h: Move pthread_cond_2_0_t definition to...
6496         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
6498         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
6499         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
6500         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
6501         __libc_ptf_call instead of __libc_maybe_call.
6502         (PTF): New #define.
6503         (__libc_cleanup_region_start): Wrap function name with PTF call.
6504         (__libc_cleanup_region_end): Likewise.
6505         (__libc_cleanup_end): Likewise.
6507         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
6508         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
6509         * pthread_key_create.c: Add __pthread_key_create_internal alias.
6510         * pthreadP.h: Add prototypes.
6512         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
6513         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
6514         __pthread_rwlock_unlock aliases.
6515         * pthreadP.h: Add prototypes for new aliases.
6517         * pthreadP.h (struct pthead_functions): Moved to...
6518         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
6519         * init.c (pthread_functions): Add initializers for new elements.
6521         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
6522         __pthread_cleanup_pop_restore aliases.
6523         * pthreadP.h: Add prototypes.
6525         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
6526         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
6527         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
6528         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
6529         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
6530         * pthreadP.h: Adjust prototypes and callers.
6532 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
6534         * Makefile (tests): Add tst-cancel7.
6535         (tst-cancel7-ARGS): New variable.
6536         * tst-cancel7.c: New file.
6538         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
6539         around gcc defficiencies.
6540         * old_pthread_cond_signal.c: Likewise.
6541         * old_pthread_cond_timedwait.c: Likewise.
6542         * old_pthread_cond_wait.c: Likewise.
6544         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
6546 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6548         * Makefile (tests): Add tst-cond7.
6549         * tst-cond7.c: New file.
6551         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6552         (condvar_cleanup): Get condvar address from the right place.
6554         * atomic.h: Correct definitions of atomic_full_barrier,
6555         atomic_read_barrier, atomic_write_barrier.
6557         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
6558         race-free.
6559         * old_pthread_cond_signal.c: Likewise.
6560         * old_pthread_cond_timedwait.c: Likewise.
6561         * old_pthread_cond_wait.c: Likewise.
6563 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
6565         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
6567 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6569         * pthreadP.h (pthread_cond_2_0_t): New type.
6570         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
6571         Use new type for the 2.0 condvar function prototypes.
6572         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
6573         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
6574         parameter.
6575         * old_pthread_cond_destroy.c: Likewise.
6576         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
6577         * old_pthread_cond_signal.c: Likewise.
6578         * old_pthread_cond_timedwait.c: Likewise.
6579         * old_pthread_cond_wait.c: Likewise.
6581         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6582         (__pthread_cond_wait): Don't save cancellation mode and seq value
6583         in same location.
6585         * herrno.c (__h_errno_location): Don't define as weak.
6587 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6589         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
6590         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
6591         and pthread_cond_wait.
6592         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
6593         Renamed to...
6594         (__pthread_cond_broadcast_2_0): ... this.
6595         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
6596         Renamed to...
6597         (__pthread_cond_destroy_2_0): ... this.
6598         * old_pthread_cond_init.c (__old_pthread_cond_init):
6599         Renamed to...
6600         (__pthread_cond_init_2_0): ... this.
6601         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
6602         Renamed to...
6603         (__pthread_cond_signal_2_0): ... this.
6604         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
6605         Renamed to...
6606         (__pthread_cond_wait_2_0): ... this.
6607         * pthread_cond_destroy.c: Include shlib-compat.h.
6608         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
6609         * pthread_cond_init.c: Include shlib-compat.h.
6610         (pthread_cond_init): Change strong_alias into versioned_symbol.
6611         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
6612         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
6613         fields.
6614         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
6615         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
6616         __pthread_cond_wait_2_0): New prototypes.
6617         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
6618         __old_pthread_cond_init, __old_pthread_cond_signal,
6619         __old_pthread_cond_wait): Removed.
6620         * init.c: Include shlib-compat.h.
6621         (pthread_functions): Guard ptr___pthread_attr_init_2_0
6622         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
6623         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
6624         ptr___pthread_cond_*_2_0 fields.
6625         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
6626         pthread_cond_*@GLIBC_2.0 compatibility symbols.
6628         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
6629         LIBC_SIGACTION was not yet defined.
6630         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
6631         [!defined LIBC_SIGACTION] (__sigaction): New function and
6632         libc_hidden_weak.
6633         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
6634         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
6636 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6638         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
6640 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
6642         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6643         New, larger type definition.
6644         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
6645         implementation.
6646         * Versions [libpthread]: Add definitions for new pthread_cond_*
6647         interfaces for version GLIBC_2.3.2.
6648         * pthread_cond_init.c: Update initialization for new type definition.
6649         * Makefile (libpthread-routines): Remove pthread_cond_wait,
6650         pthread_cond_timedwait, pthread_cond_signal, and
6651         pthread_cond_broadcast.  Add old_pthread_cond_init,
6652         old_pthread_cond_destroy, old_pthread_cond_wait,
6653         old_pthread_cond_timedwait, old_pthread_cond_signal, and
6654         old_pthread_cond_broadcast.
6655         * old_pthread_cond_broadcast.c: New file.
6656         * old_pthread_cond_destroy.c: New file.
6657         * old_pthread_cond_init.c: New file.
6658         * old_pthread_cond_signal.c: New file.
6659         * old_pthread_cond_timedwait.c: New file.
6660         * old_pthread_cond_wait.c: New file.
6661         * pthreadP.h: Add prototypes for the compatibility interfaces.
6663         * pthread_cond_destroy.c: Don't include <errno.h>.
6665 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
6667         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
6668         unnecessary zero offset when addressing MUTEX.
6670 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6672         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6673         __register_atfork.
6674         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
6675         for __register_atfork.
6677 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6679         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
6680         instead of ASSEMBLER test macro.
6682         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
6683         __libc_current_sigrtmax): Add libc_hidden_def.
6685         * sysdeps/pthread/list.h: Remove assert.h include.
6687 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6689         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
6690         __pthread_initialize_minimal_internal not
6691         __pthread_initialize_minimal.
6693 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
6695         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
6696         __pthread_initialize_minimal as hidden.
6698         * init.c (__pthread_initialize_minimal_internal): Don't mark as
6699         constructor.
6701 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6703         * Makefile ($(inst_libdir)/libpthread.so): Depend on
6704         $(common-objpfx)format.lds, include that into the output script.
6705         Fix comment.
6706         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
6708 2002-12-28  Andreas Jaeger  <aj@suse.de>
6710         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
6711         nsec resolution changes.
6712         (xstat64_conv): Likewise.
6713         (xstat32_conv): Likewise.
6714         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
6715         struct kernel_stat.
6716         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
6717         structs stat and stat64.
6718         * time/time.h (__timespec_defined): Define for __USE_MISC.
6719         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
6721 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
6723         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
6724         argument.
6725         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
6726         (pthread_exit): Use strong_alias to avoid warnings.
6727         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
6728         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
6729         ptr___pthread_attr_init_2_*.
6730         * init.c (pthread_functions): Adjust.
6732 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
6734         * forward.c: Make all functions available by default again.  It
6735         caused too much trouble.
6737         * pt-siglongjmp.c: Removed.
6739 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
6741         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
6742         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
6743         * sysdeps/i386/Makefile: New file.
6744         * sysdeps/i386/tcb-offsets.sym: New file.
6745         * sysdeps/pthread/tcb-offsets.h: New file.
6746         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6747         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
6749         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
6750         __register_atfork...
6751         (GLIBC_2.3.2): ...here.
6753 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6755         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
6756         pthread_attr_setstackaddr with __attribute_deprecated__.
6758 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6760         * pt-system.c (system): Remove cancellation handling.
6761         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
6762         cancellation routines.
6764 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6766         * descr.h: Include <dl-sysdep.h>.
6767         (struct pthread): Move header.data.list to the back of the struct.
6768         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
6769         (MULTIPLE_THREADS_OFFSET): Adjust offset.
6770         (SYSINFO_OFFSEET): Likewise.
6772 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6774         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
6775         Define.
6776         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
6777         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
6778         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
6779         (USE_DL_SYSINFO): Undef.
6781 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
6783         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
6784         $(common-objpfx)libc.so.
6785         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
6786         it is bigger than pipe buffer size even on arches with bigger
6787         page size.
6788         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
6790 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
6792         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
6793         correct errno access for case that USE___THREAD is not defined.
6795 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
6797         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
6798         Patch by Marijn Ros <marijn@mad.scientist.com>.
6800 2002-12-22  Roland McGrath  <roland@redhat.com>
6802         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
6804 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
6806         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
6808 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
6810         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
6811         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
6812         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
6814         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
6815         of int $0x80.
6816         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6817         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
6818         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
6819         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
6820         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
6821         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
6822         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
6823         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
6825         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
6826         sysenter.
6827         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
6829         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
6831         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
6832         in new TCB.
6833         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
6834         that sysinfo is properly initialized.
6835         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
6836         to 1 only for ld.so.
6838         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
6839         RTLD_CORRECT_DYNAMIC_WEAK.
6841 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
6843         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
6844         Use return 0 as 6th argument to FORWARD4.
6845         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
6847 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6849         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
6850         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
6851         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
6852         (INIT_SYSINFO): New #define.
6853         (TLS_TP_INIT): Use INIT_SYSINFO.
6854         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6855         At test to make sure SYSINFO_OFFSET value is correct.
6856         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
6858 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
6860         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
6861         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
6862         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
6863         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
6864         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
6865         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
6866         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
6868 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6870         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
6871         macro instead of using int $0x80 directly.
6873         * sysdeps/pthread/bits/stdio-lock.h: New file.
6874         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
6875         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
6876         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
6877         * Makefile (routines): Add libc-lowlevelmutex.
6879         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
6880         __i686.get_pc_thunk.dx.
6882 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6884         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
6885         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
6886         ($(objpfx)tst-cancel-wrappers.out): New rule.
6887         * tst-cancel-wrappers.sh: New test.
6888         * tst-locale1.c: Include signal.h.
6889         (uselocale): Test static linking of __libc_current_sigrt*.
6891 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
6893         * Makefile (tests): Add tst-cancel6.
6894         * tst-cancel6.c: New file
6896 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6898         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
6899         Define meaningfully for assembler as well.
6900         * pthreadP.h (struct pthread_functions): Remove
6901         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
6902         and ptr_pthread_attr_init_2_1 fields.
6903         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
6904         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
6905         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
6906         (FORWARD3): Define using FORWARD4.
6907         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
6908         versions.
6909         * pt-system.c: Remove duplicate stdlib.h include.
6911 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
6913         * sem_init.c: Define sem_init@GLIBC_2.0.
6914         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
6915         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
6917         * flockfile.c: Moved to...
6918         * sysdeps/pthread/flockfile.c: ...here.  New file.
6919         * funlockfile.c: Moved to...
6920         * sysdeps/pthread/funlockfile.c: ...here.  New file.
6921         * ftrylockfile.c: Moved to...
6922         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
6924 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
6926         * libc-cancellation.c: Guard both function with
6927         #if !defined NOT_IN_libc.
6928         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
6929         automatically provided pthread wrappers.
6930         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
6931         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
6932         nor in libpthread.
6933         * pt-open.c: Removed.
6934         * pt-fcntl.c: Removed.
6935         * pt-fsync.c: Removed.
6936         * pt-lseek.c: Removed.
6937         * pt-msgrcv.c: Removed.
6938         * pt-msgsnd.c: Removed.
6939         * pt-msync.c: Removed.
6940         * pt-nanosleep.c: Removed.
6941         * pt-open64.c: Removed.
6942         * pt-pause.c: Removed.
6943         * pt-pread.c: Removed.
6944         * pt-pread64.c: Removed.
6945         * pt-pwrite.c: Removed.
6946         * pt-pwrite64.c: Removed.
6947         * pt-read.c: Removed.
6948         * pt-recv.c: Removed.
6949         * pt-recvfrom.c: Removed.
6950         * pt-recvmsg.c: Removed.
6951         * pt-send.c: Removed.
6952         * pt-sendto.c: Removed.
6953         * pt-sigtimedwait.c: Removed.
6954         * pt-sigwait.c: Removed.
6955         * pt-wait.c: Removed.
6956         * pt-waitpid.c: Removed.
6957         * pt-write.c: Removed.
6958         * pt-accept.c: Removed.
6959         * pt-close.c: Removed.
6960         * pt-connect.c: Removed.
6961         * pt-lseek64.c: Removed.
6962         * pt-sendmsg.c: Removed.
6963         * pt-tcdrain.c: Removed.
6965 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
6967         * init.c (__pthread_initialize_minimal_internal): Renamed from
6968         __pthread_initialize_minimal.  Make old name an alias.  This
6969         converts a normal relocation into a relative relocation.
6971         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
6973         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
6974         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
6975         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
6976         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
6977         pt-sigwaitinfo, pt-waitid, and pt-writev.
6978         * pt-creat.c: Removed.
6979         * pt-poll.c: Removed.
6980         * pt-pselect.c: Removed.
6981         * pt-readv.c: Removed.
6982         * pt-select.c: Removed.
6983         * pt-sigpause.c: Removed.
6984         * pt-sigsuspend.c: Removed.
6985         * pt-sigwaitinfo.c: Removed.
6986         * pt-waitid.c: Removed.
6987         * pt-writev.c: Removed.
6989         * init.c (pthread_functions): New variable.
6990         (__pthread_initialize_minimal): Pass pointer to pthread_functions
6991         (or NULL) to __libc_pthread_init.
6992         * forward.c: Rewrite to use __libc:pthread_functions array to get
6993         function addresses.
6994         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
6995         prototype.
6996         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6997         Take new parameter.  Copy content of variable pointed to by it
6998         to __libc_pthread_init.
7000         * pthreadP.h (struct pthread_functions): New type.
7001         (__libc_pthread_init): Declare.
7003         * pthread_attr_destroy.c: Add namespace protected alias.
7004         * pthread_attr_getdetachstate.c: Likewise.
7005         * pthread_attr_getinheritsched.c: Likewise.
7006         * pthread_attr_getschedparam.c: Likewise.
7007         * pthread_attr_getschedpolicy.c: Likewise.
7008         * pthread_attr_getscope.c: Likewise.
7009         * pthread_attr_setdetachstate.c: Likewise.
7010         * pthread_attr_setinheritsched.c: Likewise.
7011         * pthread_attr_setschedparam.c: Likewise.
7012         * pthread_attr_setschedpolicy.c: Likewise.
7013         * pthread_attr_setscope.c: Likewise.
7014         * pthread_cond_broadcast.c: Likewise.
7015         * pthread_cond_destroy.c: Likewise.
7016         * pthread_cond_init.c: Likewise.
7017         * pthread_cond_signal.c: Likewise.
7018         * pthread_cond_wait.c: Likewise.
7019         * pthread_condattr_destroy.c: Likewise.
7020         * pthread_condattr_init.c: Likewise.
7021         * pthread_equal.c: Likewise.
7022         * pthread_exit.c: Likewise.
7023         * pthread_getschedparam.c: Likewise.
7024         * pthread_self.c: Likewise.
7025         * pthread_setcancelstate.c: Likewise.
7026         * pthread_setschedparam.c: Likewise.
7027         * pthread_mutex_destroy.c: Likewise.
7028         * pthread_mutex_init.c: Likewise.
7029         * pthreadP.h: Add prototypes for the aliases.
7031         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
7032         multiple_threads member in correct TCB to 1.
7034         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
7035         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
7036         member of thread decriptor, otherwise return unconditionally 1.
7038 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7040         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
7041         regular Linux version.  Remove file.
7042         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
7043         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
7044         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
7045         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
7046         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
7047         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
7048         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
7049         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
7050         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
7051         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
7052         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
7053         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
7054         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
7055         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
7056         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
7057         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
7058         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
7059         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
7060         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
7061         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
7062         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
7063         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
7064         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
7065         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
7066         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
7067         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
7068         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
7069         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
7070         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
7071         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
7073 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7075         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
7076         * sysdeps/unix/sysv/linux/open.c: Removed.
7077         * sysdeps/unix/sysv/linux/fsync.c: Removed.
7078         * sysdeps/unix/sysv/linux/lseek.c: Removed.
7079         * sysdeps/unix/sysv/linux/msync.c: Removed.
7080         * sysdeps/unix/sysv/linux/read.c: Removed.
7081         * sysdeps/unix/sysv/linux/close.c: Removed.
7082         * sysdeps/unix/sysv/linux/creat.c: Removed.
7083         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
7084         * sysdeps/unix/sysv/linux/pause.c: Removed.
7085         * sysdeps/unix/sysv/linux/select.c: Removed.
7086         * sysdeps/unix/sysv/linux/write.c: Removed.
7088 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
7090         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
7091         element in TCB to see whether locking is needed.
7093         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
7094         MULTIPLE_THREADS_OFFSET value is correct.
7096         * sysdeps/unix/sysv/linux/close.c: New file.
7097         * sysdeps/unix/sysv/linux/connect.S: New file.
7098         * sysdeps/unix/sysv/linux/creat.c: New file.
7099         * sysdeps/unix/sysv/linux/fsync.c: New file.
7100         * sysdeps/unix/sysv/linux/llseek.c: New file.
7101         * sysdeps/unix/sysv/linux/lseek.c: New file.
7102         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
7103         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
7104         * sysdeps/unix/sysv/linux/msync.c: New file.
7105         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
7106         * sysdeps/unix/sysv/linux/open.c: New file.
7107         * sysdeps/unix/sysv/linux/open64.c: New file.
7108         * sysdeps/unix/sysv/linux/pause.c: New file.
7109         * sysdeps/unix/sysv/linux/poll.c: New file.
7110         * sysdeps/unix/sysv/linux/pread.c: New file.
7111         * sysdeps/unix/sysv/linux/pread64.c: New file.
7112         * sysdeps/unix/sysv/linux/pselect.c: New file.
7113         * sysdeps/unix/sysv/linux/pwrite.c: New file.
7114         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
7115         * sysdeps/unix/sysv/linux/readv.c: New file.
7116         * sysdeps/unix/sysv/linux/recv.S: New file.
7117         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
7118         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
7119         * sysdeps/unix/sysv/linux/select.c: New file.
7120         * sysdeps/unix/sysv/linux/send.S: New file.
7121         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
7122         * sysdeps/unix/sysv/linux/sendto.S: New file.
7123         * sysdeps/unix/sysv/linux/sigpause.c: New file.
7124         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
7125         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7126         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7127         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7128         * sysdeps/unix/sysv/linux/system.c: New file.
7129         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
7130         * sysdeps/unix/sysv/linux/wait.c: New file.
7131         * sysdeps/unix/sysv/linux/waitid.c: New file.
7132         * sysdeps/unix/sysv/linux/waitpid.c: New file.
7133         * sysdeps/unix/sysv/linux/writev.c: New file.
7134         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
7136         * pt-readv.c: Fix comment.
7138 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
7140         * tst-cleanup1.c: Include stdlib.h.
7142         * tst-cancel5.c: New test.
7143         * Makefile (tests): Add tst-cancel5.
7144         (tst-cancel5): Link against libc.so libpthread.so in that order.
7146 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
7148         * forward.c (test_loaded): Prevent recursive calls.
7150         * Makefile (routines): Add libc-cancellation.
7151         * libc-cancellation.c: New file.
7152         * descr.h (struct pthread): Add multiple_threads field.
7153         * allocatestack.c (allocate_stack): Initialize multiple_header field of
7154         new thread descriptor to 1.
7155         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
7156         Initialize multiple_thread field after successful thread creation.
7157         * cancellation.c (__do_cancel): Move to pthreadP.h.
7158         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
7159         (__pthread_disable_asynccancel): Add internal_function attribute.
7160         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
7161         * pthread_setcancelstate.c: Likewise.
7162         * pthread_setcanceltype.c: Likewise.
7163         * pthread_exit.c: Likewise.
7164         * pthreadP.h (CANCELLATION_P): Likewise.
7165         (__do_cancel): Define as static inline.
7166         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
7167         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
7168         declarations.
7169         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
7170         fields.  Define MULTIPLE_THREADS_OFFSET.
7171         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
7172         declaration.
7173         * sysdeps/unix/sysv/linux/accept.S: New file.
7174         * sysdeps/unix/sysv/linux/read.c: New file.
7175         * sysdeps/unix/sysv/linux/write.c: New file.
7176         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
7177         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
7178         initialization of __libc_locking_needed.
7179         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
7180         __libc_locking_needed, use multiple_threads field in TCB.
7181         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7183 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7185         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
7186         version.
7187         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
7189         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
7190         access to __libc_locking_needed for PIC.
7192 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
7194         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
7195         declare for libc.so.
7196         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
7197         expression.
7198         (__libc_lock_lock): Put into statement expression.
7199         (__libc_lock_unlock): Remove trailing semicolon.
7200         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
7202 2002-12-12  Roland McGrath  <roland@redhat.com>
7204         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
7205         "m" constraint to refer to __libc_locking_needed.  Declare it here.
7207 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
7209         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
7210         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
7211         Initialize __libc_locking_needed.
7212         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
7213         instead of __register_pthread_fork_handler.
7214         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
7215         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
7216         fork-gen with libc_pthread_init.
7217         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
7218         of __register_pthread_fork_handler.
7219         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
7220         of __register_pthread_fork_handler.
7221         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
7222         __libc_locking_needed to determine whether lock prefix can be avoided.
7223         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7225 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
7227         * Makefile (tests): Add tst-cleanup1.
7228         * tst-cleanup1.c: New file.
7229         * cancellation.c (__cleanup_thread): Removed.
7230         (__do_cancel): Remove call to __cleanup_thread.
7231         * pthreadP.h: Remove __cleanup_thread prorotype.
7233         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
7234         Remember function and argument even if cancellation handler
7235         function is not available.
7236         (__libc_cleanup_region_end): Execute registered function directly if
7237         pthread functions are not available.
7238         (__libc_cleanup_end): Likewise.
7240         * init.c (__pthread_initialize_minimal): Fix initialization in
7241         static lib by preventing gcc from being too clever.
7243 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
7245         * init.c (__pthread_initialize_minimal): Remove unneccesary
7246         sigaddset call.
7248         * Makefile (tests): We can run tst-locale2 now.
7250 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
7252         * Versions: Remove duplicated sigwait entry.
7254 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
7256         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
7257         inside libpthread.
7259         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
7261         * pthreadP.h: Declare __pthread_enable_asynccancel and
7262         __pthread_disable_asynccancel.
7263         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
7264         (CANCEL_RESET): Use __pthread_disable_asynccancel.
7265         * cancellation.c (__pthread_enable_asynccancel): New function.
7266         (__pthread_disable_asynccancel): New function.
7267         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
7268         * pt-close.c: Likewise.
7269         * pt-connect.c: Likewise.
7270         * pt-creat.c: Likewise.
7271         * pt-fcntl.c: Likewise.
7272         * pt-fsync.c: Likewise.
7273         * pt-lseek.c: Likewise.
7274         * pt-lseek64.c: Likewise.
7275         * pt-msgrcv.c: Likewise.
7276         * pt-msgsnd.c: Likewise.
7277         * pt-msync.c: Likewise.
7278         * pt-nanosleep.c: Likewise.
7279         * pt-open.c: Likewise.
7280         * pt-open64.c: Likewise.
7281         * pt-pause.c: Likewise.
7282         * pt-poll.c: Likewise.
7283         * pt-pread.c: Likewise.
7284         * pt-pread64.c: Likewise.
7285         * pt-pselect.c: Likewise.
7286         * pt-pwrite.c: Likewise.
7287         * pt-pwrite64.c: Likewise.
7288         * pt-read.c: Likewise.
7289         * pt-readv.c: Likewise.
7290         * pt-recv.c: Likewise.
7291         * pt-recvfrom.c: Likewise.
7292         * pt-recvmsg.c: Likewise.
7293         * pt-select.c: Likewise.
7294         * pt-send.c: Likewise.
7295         * pt-sendmsg.c: Likewise.
7296         * pt-sendto.c: Likewise.
7297         * pt-sigpause.c: Likewise.
7298         * pt-sigsuspend.c: Likewise.
7299         * pt-sigtimedwait.c: Likewise.
7300         * pt-sigwait.c: Likewise.
7301         * pt-sigwaitinfo.c: Likewise.
7302         * pt-system.c: Likewise.
7303         * pt-tcdrain.c: Likewise.
7304         * pt-wait.c: Likewise.
7305         * pt-waitid.c: Likewise.
7306         * pt-waitpid.c: Likewise.
7307         * pt-write.c: Likewise.
7308         * pt-writev.c: Likewise.
7309         * pthread_join.c: Likewise.
7310         * pthread_timedjoin.c: Likewise.
7312         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
7313         (__xpg_sigpause): New function.
7314         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
7316 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
7318         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
7320         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
7321         _GI_pthread_cleanup_pop to pthreadP.h.
7323         * ftrylockfile.c: Use _IO_lock_trylock instead of
7324         pthread_mutex_trylock.
7326         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
7327         (CANCEL_RESET): Likewise.
7328         (__pthread_setcanceltype_): Declare.
7329         (__pthread_mutex_lock_internal): Declare.
7330         (__pthread_mutex_unlock_internal): Declare.
7331         (__pthread_once_internal): Declare.
7332         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
7333         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
7335         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
7336         and pthread_mutex_unlock.
7337         * pthread_cond_wait.c: Likewise.
7338         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
7339         * pthread_mutex_unlock.c: Likewise.
7341         * pthread_setcanceltype.c: Add additional alias
7342         __pthread_setcanceltype.
7344         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
7345         * sem_open.c (sem_open): Likewise.
7346         Use __libc_open, __libc_write, and __libc_close instead of
7347         open, write, and close respectively.
7349         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
7350         Rewrite as statement expression since it must return a value.
7352         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
7353         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
7354         __pthread_kill.
7356         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
7357         alias __pthread_once_internal.
7359         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
7361 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
7363         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
7364         * tst-stdio1.c: New file.
7365         * tst-stdio2.c: New file.
7367         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
7369         * Makefile (tests): Comment out tst-locale2 for now.
7370         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
7372         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
7373         -D_IO_MTSAFE_IO.
7374         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
7375         Use _IO_lock_init instead of explicit assignment.
7377         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
7378         Define __libc_lock_* and __libc_lock_recursive macros with
7379         lowlevellock macros, not pthread mutexes.
7381         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
7382         of pthread_mutex_lock.
7383         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
7384         instead of pthread_mutex_unlock.
7386 2002-12-06  Roland McGrath  <roland@redhat.com>
7388         * allocatestack.c (__stack_user): Use uninitialized defn.
7389         * init.c (__pthread_initialize_minimal): Initialize it here.
7391 2002-12-05  Roland McGrath  <roland@redhat.com>
7393         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
7394         string.
7395         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
7397         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
7398         missing & here too.
7400 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
7402         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7403         lowlevellock.
7404         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
7405         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
7406         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
7407         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
7408         for __libc_lock_* macros.
7409         * Makefile (routines): Add libc-lowlevellock.
7411 2002-10-09  Roland McGrath  <roland@redhat.com>
7413         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
7414         Under [__PIC__], call the function via the pointer fetched for
7415         comparison rather than a call by name that uses the PLT.
7416         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
7417         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
7418         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
7419         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
7420         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
7422 2002-12-04  Roland McGrath  <roland@redhat.com>
7424         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
7426         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
7427         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
7429         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
7431 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7433         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
7434         a completely opaque, non-integer type.
7435         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7437 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
7439         * sysdeps/i386/tls.h: Include stdlib.h.
7440         * sysdeps/x86_64/tls.h: Likewise.
7442 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7444         * Makefile (tests): Add tst-locale2.
7445         (tests-static): Likewise.
7446         * tst-locale2.c: New file.
7448         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
7449         volatile and add memory clobbers to lock operations.
7451 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
7453         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
7454         * sysdeps/i386/i486/bits/atomic.h: New file.
7455         * sysdeps/i386/i586/bits/atomic.h: New file.
7456         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
7457         include i486 version.
7458         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
7459         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
7460         Patch by Marijn Ros <marijn@mad.scientist.com>.
7462         * allocatestack.c (get_cached_stack): Don't crash if we first
7463         found a stack with a larger size then needed.
7464         Reported by Hui Huang <hui.huang@sun.com>.
7466         * Makefile (tests): Add tst-sysconf.
7467         * tst-sysconf.c: New file.
7469         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
7470         PTHREAD_THREADS_MAX.
7472 2002-12-02  Roland McGrath  <roland@redhat.com>
7474         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
7475         Declare using hidden_proto instead of attribute_hidden, so there are
7476         non-.hidden static symbols for gdb to find.
7477         (__pthread_keys): Likewise.
7478         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
7479         * allocatestack.c (__stack_user): Likewise.
7480         * pthread_create.c (__pthread_keys): Likewise.
7481         (__nptl_threads_events, __nptl_last_event): Make these static instead
7482         of hidden.
7483         * pthread_key_create.c (__pthread_pthread_keys_max,
7484         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
7486 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
7488         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
7489         statically.
7490         * tst-locale1.c: New file.
7492         * pthread_cond_timedwait.c: Include <stdlib.h>.
7494         * Makefile (tests): Add tst-fork2 and tst-fork3.
7495         * tst-fork2.c: New file.
7496         * tst-fork3.c: New file.
7498 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
7500         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
7502         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
7503         require it to 200112L.
7505         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
7506         instruction only if HAVE_CMOV is defined.
7507         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
7509         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
7511         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
7513         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
7515         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
7517 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
7519         * sysdeps/x86_64/bits/atomic.h: New file.
7521         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
7522         16-bit operations.
7524         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
7525         possible since gettid cannot fail.
7527         * sysdeps/x86_64/pthreaddef.h: New file.
7529         * sysdeps/i386/pthreaddef.h (gettid): Removed.
7531         * sysdeps/x86_64/pthread_spin_init.c: New file.
7532         * sysdeps/x86_64/pthread_spin_lock.c: New file.
7533         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
7534         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
7536         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
7537         Add missing lock prefix.  Minute optimization.
7539         * tst-spin2.c (main): Also check successful trylock call.
7541         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
7542         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
7544         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
7545         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
7547         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
7548         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
7549         value in case of an error.  Add support for INTERNAL_SYSCALL.
7551         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
7552         value in case of an error.
7554         * sysdeps/x86_64/tls.h: New file.
7556 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7558         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
7559         takes the array member name and the index as parameters.
7560         (THREAD_SETMEM_NC): Likewise.
7561         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
7562         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
7563         interfaces.
7565         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
7566         to decide which code to use.
7567         (THREAD_SETMEM_NC): Likewise.
7569         * allocatestack.c (queue_stack): Don't remove stack from list here.
7570         Do it in the caller.  Correct condition to prematurely terminate
7571         loop to free stacks.
7572         (__deallocate_stack): Remove stack from list here.
7574 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7576         * Makefile (tests): Add tst-stack1.
7577         * tst-stack1.c: New file.
7579         * allocatestack.c (allocate_stack): Initialize the TCB on a user
7580         provided stack.
7582         * pthread_attr_getstack.c: Return bottom of the thread area.
7584 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
7586         * Makefile (libpthread-routines): Add pt-allocrtsig and
7587         pthread_kill_other_threads.
7588         * pt-allocrtsig.c: New file.
7589         * pthread_kill_other_threads.c: New file.
7590         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
7591         all three functions.
7592         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7593         allocrtsig.
7594         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
7595         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
7596         and __libc_allocate_rtsig_private.
7597         * Versions (libpthread): Export pthread_kill_other_threads_np,
7598         __libc_current_sigrtmin, and __libc_current_sigrtmax.
7600 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
7602         * allocatestack.c (allocate_stack): stackaddr in attribute points to
7603         the end of the stack.  Adjust computations.
7604         When mprotect call fails dequeue stack and free it.
7605         * pthread_attr_setstack.c: Store top of the stack in stackaddr
7606         attribute.
7607         * pthread_getattr_np.c: Likewise.
7609         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
7610         surprises.
7612 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
7614         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
7615         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7617 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
7619         * pthread_getspecific.c: Optimize access to first 2nd-level array.
7620         * pthread_setspecific.c: Likewise.
7622 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
7624         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
7625         definitions.  Get them from the official place.
7626         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
7628         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
7629         Use new CLONE_ flags in clone() calls.
7631         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
7632         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
7634         * Versions: Add pthread_* functions for libc.
7635         * forward.c: New file.
7637         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
7638         errno-loc.
7639         * herrno.c: New file.
7640         * res.c: New file.
7642         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
7643         sem_trywait, and sem_timedwait.  Add herrno and res.
7644         * sem_init.c: Don't initialize lock and waiters members.
7645         * sem_open.c: Likewise.
7646         * sem_post.c: Removed.
7647         * sem_wait.c: Removed.
7648         * sem_trywait.c: Removed.
7649         * sem_timedwait.c: Removed.
7650         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
7651         Includes full implementations of sem_post, sem_wait, sem_trywait,
7652         and sem_timedwait.
7653         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
7654         for new implementation.
7655         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
7656         and waiters fields.
7658         * tst-sem3.c: Improve error message.
7659         * tst-signal3.c: Likewise.
7661         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
7662         to tell the kernel about the termination futex and to initialize tid
7663         member.  Don't initialize main_thread.
7664         * descr.h (struct pthread): Remove main_thread member.
7665         * cancelllation.c (__do_cancel): Remove code handling main thread.
7666         The main thread is not special anymore.
7668         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
7669         size of the stacks to stack_cache_actsize.
7671         * pt-readv.c: Add missing "defined".
7672         * pt-sigwait.c: Likewise.
7673         * pt-writev.c: Likewise.
7675 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
7677         * Versions: Export __connect from libpthread.
7678         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7680         * Makefile (libpthread-routines): Add pt-raise.
7681         * sysdeps/unix/sysv/linux/raise.c: New file.
7682         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
7683         * sysdeps/generic/pt-raise.c: New file.
7685         * pthread_cond_init.c: Initialize all data elements of the condvar
7686         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7688         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
7689         * pthread_create.c: Likewise.
7691         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
7692         * tst-key1.c: New file.
7693         * tst-key2.c: New file.
7694         * tst-key3.c: New file.
7696         * Versions: Export pthread_detach for version GLIBC_2.0.
7697         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
7699 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
7701         * pthread_key_create.c: Terminate search after an unused key was found.
7702         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7704         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
7705         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7707 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
7709         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
7710         dynamic lookup for errno in PIC.
7712         * allocatestack.c (get_cached_stack): Rearrange code slightly to
7713         release the stack lock as soon as possible.
7714         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
7715         the static TLS block.
7716         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
7718         * cancellation.c: Renamed from cancelation.c.
7719         * Makefile: Adjust accordingly.
7720         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
7721         * cleanup_defer.c: Use CANCELLATION_P.
7722         * pthread_testcancel.c: Likewise.
7723         * descr.h: Fix spelling in comments.
7724         * init.c: Likewise.
7725         * pthread_getattr_np.c: Likewise.
7726         * pthread_getschedparam.c: Likewise.
7727         * pthread_setschedparam.c: Likewise.
7728         * Versions: Likewise.
7730         * pt-pselect.c: New file.
7731         * Makefile (libpthread-routines): Add pt-pselect.
7732         * Versions: Add pselect.
7734         * tst-cancel4.c: New file.
7735         * Makefile (tests): Add tst-cancel4.
7737 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
7739         * pthread_mutex_lock.c: Always record lock ownership.
7740         * pthread_mutex_timedlock.c: Likewise.
7741         * pthread_mutex_trylock.c: Likewise.
7743         * pt-readv.c: New file.
7744         * pt-writev.c: New file.
7745         * pt-creat.c: New file.
7746         * pt-msgrcv.c: New file.
7747         * pt-msgsnd.c: New file.
7748         * pt-poll.c: New file.
7749         * pt-select.c: New file.
7750         * pt-sigpause.c: New file.
7751         * pt-sigsuspend.c: New file.
7752         * pt-sigwait.c: New file.
7753         * pt-sigwaitinfo.c: New file.
7754         * pt-waitid.c: New file.
7755         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
7756         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
7757         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
7758         * Versions: Add all the new functions.
7760         * tst-exit1.c: New file.
7761         * Makefile (tests): Add tst-exit1.
7763         * sem_timedwait.c: Minor optimization for more optimal fastpath.
7765 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
7767         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
7769         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
7770         call.  pthread_join is an official cancellation point.
7771         * pthread_timedjoin.c: Likewise.
7773         * pthread_cond_wait.c: Revert order in which internal lock are dropped
7774         and the condvar's mutex are retrieved.
7775         * pthread_cond_timedwait.c: Likewise.
7776         Reported by dice@saros.East.Sun.COM.
7778 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
7780         * pthreadP.h: Cut out all type definitions and move them...
7781         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
7782         * pthreadP.h: Include <internaltypes.h>.
7784         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
7785         performance tweaks.
7787         * sem_trywait.c: Shuffle #includes around to get right order.
7788         * sem_timedwait.c: Likewise.
7789         * sem_post.c: Likewise.
7790         * sem_wait.c: Likewise.
7792         * nptl 0.3 released.
7794         * Makefile (tests): Add tst-signal3.
7795         * tst-signal3.c: New file.
7797 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
7799         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
7800         the asms modify the sem object.
7801         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
7803         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
7804         the actual members.
7805         * pthreadP.h (struct sem): New type.  Actual semaphore type.
7806         * semaphoreP.h: Include pthreadP.h.
7807         * sem_getvalue.c: Adjust to sem_t change.
7808         * sem_init.c: Likewise.
7809         * sem_open.c: Likewise.
7810         * sem_post.c: Likewise.
7811         * sem_timedwait.c: Likewise.
7812         * sem_trywait.c: Likewise.
7813         * sem_wait.c: Likewise.
7815 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
7817         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
7818         * tst-basic2.c: New file.
7819         * tst-exec1.c: New file.
7820         * tst-exec2.c: New file.
7821         * tst-exec3.c: New file.
7823         * tst-fork1.c: Remove extra */.
7825         * nptl 0.2 released.  The API for IA-32 is complete.